diff --git a/binarycpython/utils/grid.py b/binarycpython/utils/grid.py index 12cd6f0bbe0873d3ec596e5ab71d7c931e14803e..246a9853cb875e6630ccc9a7bf3085bbbc16de0d 100644 --- a/binarycpython/utils/grid.py +++ b/binarycpython/utils/grid.py @@ -606,7 +606,7 @@ class Population: } # Check for gridtype input - if not gridtype in ["edge", "centred"]: + if not gridtype in ["edge", "right", "right edge", "left", "left edge", "centred", "centre", "center"]: msg = "Unknown gridtype value. Please start another one" raise ValueError(msg) @@ -1186,6 +1186,12 @@ class Population: # TODO: build in method to handle with the HPC. # Continuously fill the queue for system_number, system_dict in enumerate(generator): + + # skip systems before start_at, and apply modulo + if(not(system_number >= self.grid_options['start_at'] and + (system_number - self.grid_options['start_at']) % self.grid_options['modulo'] == 0)): + continue + # Put job in queue job_queue.put((system_number, system_dict)) @@ -2155,7 +2161,6 @@ class Population: # TODO: Add correct logging everywhere # TODO: add part to handle separation if orbital_period is added. Idea. use default values # for orbital parameters and possibly overwrite those or something. - # TODO: add centre left right for the spacing. # TODO: add sensible description to this function. # TODO: Check whether all the probability and phasevol values are correct. # TODO: import only the necessary packages/functions diff --git a/binarycpython/utils/grid_options_defaults.py b/binarycpython/utils/grid_options_defaults.py index 7fc2cb7222bf05e3ec8a45439dc34bfb7b8aa9c0..24feaf9ed54e319b2ae00f3ce3cfe71b51f12f86 100644 --- a/binarycpython/utils/grid_options_defaults.py +++ b/binarycpython/utils/grid_options_defaults.py @@ -119,7 +119,8 @@ grid_options_defaults_dict = { "_population_id": 0, # Random id of this grid/population run, Unique code for the population. Should be set only once by the controller process. "_total_mass_run": 0, # To count the total mass that thread/process has ran "_total_probability_weighted_mass_run": 0, # To count the total mass * probability for each system that thread/process has ran - "modulo": 1, # run modulo n of the grid. #TODO: fix this + "modulo": 1, # run modulo n of the grid. + "start_at": 0, # start at the first model ## Grid type evolution "_grid_variables": {}, # grid variables "gridcode_filename": None, # filename of gridcode