stilt.Project#

class stilt.Project(path: 'str | Path', *, output: 'str | Path | None' = None) → 'None'[source]#

A STILT project: receptors, settings, and the simulations they define.

Project(path) opens a project directory and reads it. It is every receptor under every variant, and a view of their results: list the simulations, see which have finished, load particles and footprints. The results are in the output directory config.yaml names (./output by default), which several projects can share.

Make a new project with init() (or stilt init). After that, config.yaml is yours to edit; PYSTILT never rewrites it.

Parameters

pathstr or Path

Project directory.

outputstr or Path, optional

Read and write results here instead of the output directory config.yaml names: a path, or a URL such as s3://bucket/output. For a container whose output is somewhere else than the project’s.

Attributes#

config

The settings, read from config.yaml.

config_path

The project's config.yaml.

name

The project's name, which is the name of its directory.

output

The output directory.

plot

Plotting methods, such as project.plot.availability().

receptors

The receptors, one row per receptor, in file order.

receptors_path

The project's receptors.csv.

simulations

Every receptor under every variant, one row per simulation.

variants

Each variant, resolved, by name, in config order.

Methods#

add_receptors(receptors)

Add receptors to receptors.csv and return the ids of the new ones.

add_table(name, table)

Add rows to one of the project's input tables, and return its path.

check()

Return what would stop the project's simulations, found before any run.

fetch([sel])

Get the met files the unfinished simulations need, and return them.

folders()

Return every settings folder in the output directory, and which variants use it.

footprints([sel])

Open the footprints of the selected simulations as one dataset.

incomplete([sel])

Return the selected simulations that are missing an expected result.

init(path[, receptors, config, starter])

Make a new project and return it.

jacobian(sel, target, time_bins, *[, workers])

Sum the selected footprints onto a target, per time bin, as one sparse matrix.

particles([sel, columns])

Load the particles of every selected simulation that has them, as one table.

receptor(receptor_id)

Return one receptor by id, built from its rows.

run([skip_existing, compute_root, ...])

Run every simulation that has not finished, and wait for it.

simulation(receptor_id, variant[, realization])

Return one simulation: a receptor under a variant, and a realization of an ensemble.

status([sel])

Return the selected simulations with what each has, and where it stands.

submit([skip_existing, compute_root, ...])

Submit every simulation that has not finished to Slurm, and return at once.

table_path(name)

Return where the project's table name is kept: tables/<name>.parquet.

transport_error(sel, error, flux, *[, workers])

Return the transport error of each selected simulation's modeled enhancement.