Branch and Keyspace Management
Tools for managing the parameter space of a parallel run.
- class vivarium_cluster_tools.psimulate.branches.Keyspace(branches, keyspace)[source]
A representation of a collection of simulation configurations.
- classmethod from_entry_point_args(input_branch_configuration_path, keyspace_path, branches_path, extras)[source]
- vivarium_cluster_tools.psimulate.branches.calculate_input_draws(input_draw_count, existing_draws=None)[source]
Determines a random sample of the GBD input draws to use.
Notes
The input draws returned account for the draw count provided and any already-used draws.
- vivarium_cluster_tools.psimulate.branches.calculate_random_seeds(random_seed_count, existing_seeds=None)[source]
Generates random seeds to use given a count of seeds and any existing seeds.
- Return type:
- Parameters:
- Returns:
A set of unique random seeds, guaranteed not to overlap with any existing random seeds.
- vivarium_cluster_tools.psimulate.branches.expand_branch_templates(templates)[source]
Expand branch template lists into individual branches.
Take a list of dictionaries of configuration values (like the ones used in experiment branch configurations) and expand it by taking any values which are lists and creating a new set of branches which is made up of the product of all those lists plus all non-list values.
For example this:
{'a': {'b': [1,2], 'c': 3, 'd': [4,5,6]}}
becomes this:
[ {'a': {'b': 1, 'c': 3, 'd': 4}}, {'a': {'b': 2, 'c': 3, 'd': 5}}, {'a': {'b': 1, 'c': 3, 'd': 6}}, {'a': {'b': 2, 'c': 3, 'd': 4}}, {'a': {'b': 1, 'c': 3, 'd': 5}}, {'a': {'b': 2, 'c': 3, 'd': 6}} ]
- vivarium_cluster_tools.psimulate.branches.validate_artifact_path(artifact_path)[source]
Validates that the path to the data artifact from the branches file exists.
The path specified in the configuration must be absolute
- Return type:
- Parameters:
artifact_path (str) – The path to the artifact.
- Raises:
FileNotFoundError – If the artifact path is not an absolute path or does not exist.