runscripts.create_variants
- runscripts.create_variants.apply_and_save_variants(sim_data, param_dicts, variant_name, outdir, skip_baseline)[source]
Applies variant function to
sim_data
with each parameter dictionary inparam_dicts
. Saves each variant as{i}.cPickle
inoutdir
, wherei
is the index of the parameter dictionary inparam_dicts
used to create that variant. Also savesmetadata.json
inoutdir
that maps each{i}
to the parameter dictionary used to create it.- Parameters:
sim_data (SimulationDataEcoli) – Simulation data object to modify
param_dicts (list[dict[str, Any]]) – Return value of
parse_variants()
variant_name (str) – Name of variant function file in
ecoli/variants
folderoutdir (str) – Path to folder where variant
sim_data
pickles are savedskip_baseline (bool) – Whether to save metadata for baseline sim_data
- runscripts.create_variants.parse_variants(variant_config)[source]
Parse parameters for a variant specified under
variants
key of config.- Parameters:
variant_config (dict[str, str | dict[str, Any]]) –
Dictionary of the form:
{ # Define one or more parameters with any names EXCEPT `op` 'param_name': { # Each parameter defines only ONE of the following keys # A list of parameter values 'value': [...] # Numpy function that returns array of parameter values # Example: np.linspace 'linspace': { # Kwargs 'start': ..., 'stop': ..., 'num' (optional): ... } # Dictionary of parameters with same rules as this one 'nested': {...} }, # When more than one parameter is defined, an 'op' key # MUST define how to combine them. The three options are: # 'zip': Zip parameters (must have same length) # 'prod': Cartesian product of parameters # 'add': Concatenate parameter lists into single parameter # named {param_name_1}__{param_name_2}__... 'param_2': {...}, 'op': 'zip' }
- Returns:
List of parameter dictionaries generated from variant config
- Return type: