From 014e48ac0c9e89bd08432f13ccc35b764774300d Mon Sep 17 00:00:00 2001 From: David Hendriks <davidhendriks93@gmail.com> Date: Wed, 11 Mar 2020 12:18:32 +0000 Subject: [PATCH] sorted the grid class a bit --- binarycpython/utils/grid.py | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/binarycpython/utils/grid.py b/binarycpython/utils/grid.py index ed705648e..ddba33e74 100644 --- a/binarycpython/utils/grid.py +++ b/binarycpython/utils/grid.py @@ -547,7 +547,7 @@ class Population(object): """ ### Custom logging code: - self.set_custom_logging() + self.set_custom_logging() # Get argument line argline = self.return_argline(self.bse_options) @@ -681,6 +681,9 @@ class Population(object): ################################################### # Gridcode functions + # + # Function below are used to run populations with + # a variable grid ################################################### def generate_grid_code(self, dry_run=False): @@ -1154,8 +1157,25 @@ class Population(object): ) print(info_string) + ################################################### + # Montecarlo functions + # + # Functions below are used to run populations with + # Monte carlo + ################################################### + + ################################################### + # Population from file functions + # + # Functions below are used to run populations from + # a file containing binary_c calls + ################################################### + + ################################################### # Unordered functions + # + # Functions that arent ordered yet ################################################### def write_binary_c_calls_to_file(self, output_dir=None, output_filename=None, include_defaults=False): @@ -1254,6 +1274,7 @@ class Population(object): print("Error while deleting file {}".format(file)) raise FileNotFoundError + def clean_up_custom_logging(self, evol_type): """ Function to clean up the custom logging. @@ -1286,6 +1307,7 @@ class Population(object): print("Cleaning up the custom logging stuffs. type: population") # TODO: make sure that these also work. not fully sure if necessary tho. whether its a single file, or a dict of files/memaddresses + def increment_probtot(self, prob): """ Function to add to the total probability @@ -1293,13 +1315,11 @@ class Population(object): self.grid_options["probtot"] += prob + def increment_count(self): """ Function to add to the total amount of stars """ self.grid_options["count"] += 1 - - - -################################################################################################ +################################################################################################ \ No newline at end of file -- GitLab