stilt.Model#
- class stilt.Model(project: str | pathlib.Path | None = None, receptors: stilt.receptors.Receptor | collections.abc.Iterable | str | pathlib.Path | None = None, config: stilt.config.model.ModelConfig | None = None, output_dir: str | pathlib.Path | None = None, compute_root: str | pathlib.Path | None = None, runtime: stilt.config.runtime.RuntimeSettings | None = None, **kwargs)[source]#
Science-facing STILT project interface.
Modelis the primary Python entry point for configuring a STILT project, running one-off simulations, and loading simulation results.Completion is read from the outputs by key; the registry is the manifest. A Postgres work queue (
model.queue) is used only for pull/serve workers, exposed through the CLI andstilt.execution.pull_simulations().
Parameters
projectstr or Path or None, optionalLocal project root or cloud URI used to identify the model.
receptorsReceptor or iterable or str or Path or None, optionalIn-memory receptors or a path to a receptor CSV.
configModelConfig or None, optionalIn-memory project config. When omitted, config is loaded lazily from storage.
output_dirstr or Path or None, optionalOutput root. Defaults to
project.compute_rootstr or Path or None, optionalLocal parent directory where worker simulation directories are created.
runtimeRuntimeSettings or None, optionalRuntime-only deployment settings such as cache roots and DB URLs.
**kwargsForwarded to
ModelConfigwhen config is not provided. Any validModelConfigfield name is accepted (e.g.n_hours=-48,numpar=500). Mutually exclusive with config — passing both raisesTypeError.
Methods#
|
Persist model inputs and register one batch of pending work. |
|
Register pending work and start workers to drain it. |
Return completion counts grouped by registered scene. |
|
|
Return completion counts (total/completed/pending) from the registry. |
Attributes#
|
Project |
|
Footprint accessor namespace for named footprint outputs. |
|
Registry of registered simulations ( |
|
Named met streams, resolved from config. |
|
Plotting namespace for this model (e.g. |
|
Postgres work queue, present only when a DB URL is configured. |
|
Sequence-like receptor accessor for this project. |
|
Lazy simulation collection for registered simulations. |
|
Trajectory accessor for querying and loading simulation outputs. |