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_datawith each parameter dictionary in- param_dicts. Saves each variant as- {i}.cPicklein- outdir, where- iis the index of the parameter dictionary in- param_dictsused to create that variant. Also saves- metadata.jsonin- outdirthat 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/variantsfolder
- outdir (str) – Path to folder where variant - sim_datapickles are saved
- skip_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 - variantskey 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: