Skip to main content

Module configuration

Module configuration 

Source
Expand description

Strict study settings, named paths, and phase-scoped parameter expansion.

StudySettings loads the process-level replicate policy and preserves one opaque application-owned object from study.json. It remains separate from the scientific parameter registry:

{
  "replicate_settings": {
    "replicates": 1,
    "scheduling": "sequential",
    "failure_policy": "fail_fast",
    "base_seed": 1101
  },
  "application": {
    "protocol": "my-application-study"
  }
}

A study stores scientific parameters in config/parameters.json and named paths independently in config/paths.json. Parameter configuration has one global scope and one or more string-keyed components. Each component contains shared parameters and string-keyed workloads:

global
components
└── <component key>
    ├── shared
    └── workloads
        └── <workload key>

StudyConfiguration validates the complete registry. Calling StudyConfiguration::workload returns a WorkloadConfiguration, whose combinations are the Cartesian composition of global, component-shared, and workload-local selections. There is deliberately no component-level combination API: components share values but are not expandable spaces.

Ordinary JSON values, including arrays, are literal. An object containing exactly "$sweep" declares independent Cartesian choices. A scope-level "$cases" array declares correlated alternatives. One scope cannot mix the two forms.

{
  "global": {
    "temperature": {"$sweep": [280.0, 300.0]},
    "lattice_shape": [64]
  },
  "components": {
    "models": {
      "shared": {"seed": {"$sweep": [7, 11]}},
      "workloads": {
        "glv": {"solver": {"step": 0.01}},
        "analysis": {"include_space": true}
      }
    }
  }
}
use scientific_workflow::configuration::{ProjectPaths, StudyConfiguration};

let study = StudyConfiguration::load("scientific-study")?;
let models = study.workload("models", "glv")?;
let paths = ProjectPaths::load("scientific-study")?;

for configuration in models.combinations() {
    let (temperature, seed): (f64, u64) =
        configuration.decode_values(("/temperature", "/seed"))?;
    println!("temperature={temperature} seed={seed}");
}
println!("recordings={}", paths.resolve_path("recordings")?.display());
}

Configuration loading is immutable and side-effect free beyond reading its source. It validates execution policy but does not enact it, create tasks, resolve model semantics, create output, or inspect path targets. Applications pass ReplicateSettings to the execution module and map ResolvedConfiguration values into their own workloads.

Structs§

ConfigurationIter
Lazy deterministic iterator over all combinations of one workload.
ProjectPaths
A validated read-only dictionary of project-wide named filesystem paths.
ReplicateSettings
Validated policy for executing one or more isolated study replicates.
ResolvedConfiguration
One immutable, lazily materialized workload configuration combination.
StudyConfiguration
One validated study-wide parameter registry.
StudySettings
Validated, immutable study manifest.
WorkloadConfiguration
The lazily expanded parameter space for one component-qualified workload.

Enums§

ConfigurationError
A failure encountered while loading study settings, paths, or parameters.
ReplicateFailurePolicy
Controller response when a replicate subprocess fails.
ReplicateScheduling
Process-level scheduling mode for study replicates.