Skip to content

Commit

Permalink
Process arguments inside doloop function
Browse files Browse the repository at this point in the history
  • Loading branch information
mogres committed Feb 21, 2024
1 parent ef80603 commit 10f2cae
Showing 1 changed file with 23 additions and 29 deletions.
52 changes: 23 additions & 29 deletions cellpack/autopack/Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from cellpack.autopack.plotly_result import PlotlyAnalysis
from cellpack.autopack.upy import colors as col
from cellpack.autopack.upy.colors import map_colors
from cellpack.autopack.utils import check_paired_key, get_paired_key
from cellpack.autopack.utils import check_paired_key, get_paired_key, get_seed_list
from cellpack.autopack.writers import Writer
from cellpack.autopack.writers.ImageWriter import ImageWriter
import concurrent.futures
Expand Down Expand Up @@ -2342,17 +2342,10 @@ def pack_one_seed(

def doloop(
self,
number_of_packings,
recipe_data,
packing_config_data,
bounding_box,
get_distance_distribution=True,
plot_figures=True,
show_grid=True,
seed_list=None,
config_name="default",
recipe_version="1.0.0",
image_export_options=None,
parallel=False,
save_gradient_data_as_image=False,
):
"""
Runs multiple packings of the same recipe in a loop. This workflow
Expand All @@ -2363,26 +2356,17 @@ def doloop(
Parameters
----------
number_of_packing : int
Number of repeats of a packing. Default: 1
bounding_box : np.ndarray
bounding box from the environment
recipe_data: dict
Dictionary containing recipe data
packing_config_data: dict
Dictionary containing packing configuration data
bounding_box: list
List of two lists containing the minimum and maximum coordinates
of the bounding box
get_distance_distribution: bool
specify whether to calculate distance distributions
render: bool
???
plot_figures: bool
specify whether to save figures generated by the analyses
show_grid: bool
specify whether to display packing grid in browser
fbox_bb: ???
???
seed_list: List
list of seeds to use for the packing (for reproducibility)
config_name: string
name of the configuration used for the packing
recipe_version: string
version of the recipe used for the packing
Whether to calculate and store distance and angle distributions
seed_list: list
List of seeds to use for packings
Outputs
-------
Expand All @@ -2393,6 +2377,16 @@ def doloop(
distributions as applicable for each seed, and a combined image
across seeds
"""
number_of_packings = packing_config_data["number_of_packings"]
plot_figures = packing_config_data.get("save_plot_figures", True)
show_grid = packing_config_data["show_grid_plot"]
image_export_options = packing_config_data.get("image_export_options")
parallel = packing_config_data.get("parallel", False)
save_gradient_data_as_image = packing_config_data.get(
"save_gradient_data_as_image", False
)

seed_list = get_seed_list(packing_config_data, recipe_data)
if seed_list is None:
seed_list = self.getHaltonUnique(number_of_packings)
packing_basename = self.env.base_name
Expand Down

0 comments on commit 10f2cae

Please sign in to comment.