runtraj.config.Variant#

class runtraj.config.Variant(name: 'str', met: 'str', met_config: 'Any', transport: 'TransportConfig', model: 'str', realizations: 'int | None' = None, stages: 'dict[str, Any]'=<factory>, stage_classes: 'dict[str, str]'=<factory>) → None[source]#

One variant, resolved: its configs, its met, its transport model, and its hashes.

Get one from project.variants or sim.variant. A variant with realizations: N is an ensemble: its simulations run N times, realization k with seed + k (transport_for()), and its results share one folder, a realization=k partition each.

Variants with equal result_hash share one run of the transport model per release (and realization) and differ only in what their stages make of it. The hashes are computed once. Change a variant with dataclasses.replace(), which computes them again.

Attributes#

build

The transport model build that runs it.

met_settings

What a run records of the met, its config's settings().

readable_run_settings

The settings that identify this variant's particles, without what cannot be read here.

realization_numbers

The realizations its simulations run as, from 0 to N - 1, or [None] for a single run.

result

The type of result the variant's transport model makes, such as particles or concentration.

result_hash

Hash of run_settings, which finds the folder of the transport model's result.

run_settings

The settings that identify this variant's particles, as _settings.yaml records them.

stage_hashes

The hash that finds each stage's settings folder, by the stage's name.

stage_order

The names of the variant's stages in the order they run, each after the stages it reads.

stage_settings

The settings that identify each stage's results, by the stage's name, as its _settings.yaml records them.

Methods#

stage(name)

Return the stage called name, one of stages.

stage_hashes_on(result_hash)

Return the hash of each stage's settings folder for a result hashed result_hash.

transport_for(realization)

Return the transport config realization realization runs with.