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 given a draw count and any existing 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.
- Parameters:
- Returns:
A set of unique random seeds, guaranteed not to overlap with any existing random seeds.
- Return type:
List[int]
- vivarium_cluster_tools.psimulate.branches.expand_branch_templates(templates)[source]
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}} ]