diff --git a/binarycpython/tests/test_grid.py b/binarycpython/tests/test_grid.py index 895bd08fdc9cd2ddf2f10641ea3c58b48ae12e0b..a6503d71c483d6b1a052138f62cc3c9191843fb1 100644 --- a/binarycpython/tests/test_grid.py +++ b/binarycpython/tests/test_grid.py @@ -798,12 +798,12 @@ class test_grid_evolve(unittest.TestCase): analytics = test_pop.evolve() - self.assertTrue(isinstance(test_pop.grid_options["ensemble_results"], dict)) - self.assertNotEqual(test_pop.grid_options["ensemble_results"], {}) + self.assertTrue(isinstance(test_pop.grid_ensemble_results['ensemble'], dict)) + self.assertNotEqual(test_pop.grid_ensemble_results['ensemble'], {}) - self.assertIn("number_counts", test_pop.grid_options["ensemble_results"]) + self.assertIn("number_counts", test_pop.grid_ensemble_results['ensemble']) self.assertNotEqual( - test_pop.grid_options["ensemble_results"]["number_counts"], {} + test_pop.grid_ensemble_results['ensemble']["number_counts"], {} ) def test_grid_evolve_2_threads_with_ensemble_comparing_two_methods(self): @@ -850,7 +850,7 @@ class test_grid_evolve(unittest.TestCase): ) analytics_1 = test_pop_1.evolve() - ensemble_output_1 = test_pop_1.grid_options["ensemble_results"] + ensemble_output_1 = test_pop_1.grid_ensemble_results # second test_pop_2 = Population() @@ -911,18 +911,17 @@ class test_grid_evolve(unittest.TestCase): ensemble_output_2 = merge_dicts(ensemble_output_2, ensemble_json) - for key in ensemble_output_1["number_counts"]["stellar_type"]["0"]: + for key in ensemble_output_1['ensemble']["number_counts"]["stellar_type"]["0"]: self.assertIn(key, ensemble_output_2["number_counts"]["stellar_type"]["0"]) # compare values self.assertLess( np.abs( - ensemble_output_1["number_counts"]["stellar_type"]["0"][key] + ensemble_output_1['ensemble']["number_counts"]["stellar_type"]["0"][key] - ensemble_output_2["number_counts"]["stellar_type"]["0"][key] ), 1e-8, ) - if __name__ == "__main__": unittest.main() diff --git a/binarycpython/utils/grid_options_defaults.py b/binarycpython/utils/grid_options_defaults.py index 059977117b19d0d69f4f1b2780a0c5d452e7128b..ac9d12b00689673ad7f579946cd7560ce7f23ed9 100644 --- a/binarycpython/utils/grid_options_defaults.py +++ b/binarycpython/utils/grid_options_defaults.py @@ -86,8 +86,6 @@ grid_options_defaults_dict = { "_probtot": 0, # total probability "weight": 1.0, # weighting for the probability "repeat": 1, # number of times to repeat each system (probability is adjusted to be 1/repeat) - "results": {}, # dict to store the results. Every process fills this on its own and then it will be joined later - "ensemble_results": {}, # Dict to store the ensemble results "_start_time_evolution": 0, # Start time of the grid "_end_time_evolution": 0, # end time of the grid "_errors_found": False, # Flag whether there are any errors from binary_c @@ -437,7 +435,6 @@ grid_options_descriptions = { "_errors_found": "Variable storing a boolean flag whether errors by binary_c are encountered.", "_errors_exceeded": "Variable storing a boolean flag whether the amount of errors was higher than the set threshold (failed_systems_threshold). If True, then the commandline arguments of the failing systems will not be stored in the failed_system_log files.", "source_file_filename": "Variable containing the source file containing lines of binary_c commandline calls. These all have to start with binary_c.", # TODO: Expand - "results": "Dictionary in which the user can place their results. This dictionary gets merged at the end of a mulitprocessing simulation.", "C_auto_logging": "Dictionary containing parameters to be logged by binary_c. The structure of this dictionary is as follows: the key is used as the headline which the user can then catch. The value at that key is a list of binary_c system parameters (like star[0].mass)", "C_logging_code": "Variable to store the exact code that is used for the custom_logging. In this way the user can do more complex logging, as well as putting these logging strings in files.", "_failed_count": "Variable storing the amount of failed systems.", @@ -465,7 +462,6 @@ grid_options_descriptions = { "repeat": "Factor of how many times a system should be repeated. Consider the evolution splitting binary_c argument for supernovae kick repeating.", # TODO: make sure this is used. "evolution_type": "Variable containing the type of evolution used of the grid. Multiprocessing or linear processing", "combine_ensemble_with_thread_joining": "BOolean flag on whether to combine everything and return it to the user or if false: write it to data_dir/ensemble_output_{popuation_id}_{thread_id}.json", - "ensemble_results": "Dictinary that stores the ensemble results if combine_ensemble_with_thread_joining==True", "log_runtime_systems": "Whether to log the runtime of the systems . Each systems run by the thread is logged to a file and is stored in the tmp_dir. (1 file per thread). Don't use this if you are planning to run alot of systems. This is mostly for debugging and finding systems that take long to run. Integer, default = 0. if value is 1 then the systems are logged", }