sierra.core.variables.builtin#

Builtin batch criteria which can be used with any Engine/Project.

Batch criteria in this file are the ONLY ones which come with SIERRA which can be used as-is. Other stuff in sierra.core.variables are base classes which require specialization to use as batch criteria, or are just experimental variables.

Classes#

MonteCarlo

Criteria which does nothing put provide a set of experiments via cardinality.

Functions#

linspace_parse(→ list[float])

Generate an array from a linspace spec of the form <min>.<max>.C<cardinality>.

Module Contents#

class sierra.core.variables.builtin.MonteCarlo(cli_arg: str, main_config: sierra.core.types.YAMLDict, batch_input_root: pathlib.Path, cardinality: int)[source]#
Inheritance diagram of sierra.core.variables.builtin.MonteCarlo

Criteria which does nothing put provide a set of experiments via cardinality.

See Monte Carlo for documentation.

arena_dims(cmdopts: sierra.core.types.Cmdopts) list[sierra.core.utils.ArenaExtent]#

Get the arena dimensions used for each experiment in the batch.

Not applicable to all criteria.

Must be implemented on a per-engine basis, as different engines have different means of computing the size of the arena.

gen_attr_changelist() list[sierra.core.experiment.definition.AttrChangeSet][source]#

Generate expdef attributes to change in a batch experiment definition.

Modifications are sets, one per experiment in the batch, because the order you apply them doesn't matter.

gen_element_addlist() list[sierra.core.experiment.definition.ElementAddList]#

Generate expdef elelemnts to add to the batch experiment definition.

Modifications are lists, one per experiment in the batch, because the order you apply them matters.

gen_files() None#

Generate files to add to the batch experiment definition.

Presumably, the created files will be referenced in the --expdef-template file by path.

gen_tag_rmlist() list[sierra.core.experiment.definition.ElementRmList]#

Generate expdef tags to remove from the batch experiment definition.

Modifications are lists, one per experiment in the batch, because the order you apply them matters.

graph_info(cmdopts: sierra.core.types.Cmdopts, batch_output_root: pathlib.Path | None = None, exp_names: list[str] | None = None) sierra.core.graphs.bcbridge.GraphInfo[source]#

Generate graph info for generating graphs from Batch Criteria.

Parameters:

exp_names -- Needed as an optional for bivariate batch criteria. When calculating say yticks using criteria2, if criteria2 uses populations() in the process, the criteria's OWN gen_exp_names() will be used, which will result in bad directory name calculations. This can be overcome by passing the list of exp names to use at THIS level, which should override the value otherwise present in GraphInfo.

populations(cmdopts: sierra.core.types.Cmdopts, exp_names: list[str] | None = None) list[int]#

Calculate system sizes used the batch experiment, sorted.

Parameters:
  • cmdopts -- Dictionary of parsed command line options.

  • exp_names -- If is not None, then these directories will be used to calculate the system sizes, rather than the results of gen_exp_names().

scaffold_exps(batch_def: sierra.core.experiment.definition.BaseExpDef, cmdopts: sierra.core.types.Cmdopts) None#

Scaffold a batch experiment.

Takes the raw template input file and apply expdef modifications from the batch criteria for all experiments, and save the result in each experiment's input directory.

sierra.core.variables.builtin.linspace_parse(arg: str, scale_factor: float | None = 1.0) list[float][source]#

Generate an array from a linspace spec of the form <min>.<max>.C<cardinality>.

Parameters:
  • arg -- The CLI string.

  • scale_factor -- A linear factor applied to the min/max to shift the range. This can be used to, e.g., generate ranges like 0.4-0.8 from specs like 4.8.C8 instead of having to do contortions around parsing decimal values out of CLI strings directly.