stilt.output.Output#

class stilt.output.Output(path: 'str | Path | UPath') → 'None'[source]#

An output directory: particles and footprints, by their settings.

Each kind of result has a tree, and in it a folder per set of settings, named settings=<variant>-<hash>. A variant’s folder is found by the hash of its settings, whatever name it was created under, so projects that run the same settings share it. Every method takes the kind of result ("particles" or "footprints") and the variant, resolved (project.variants).

Parameters

pathstr or Path

The directory, created on first write. A URL such as s3://bucket/output puts it on an object store, read and written through fsspec (install its package, such as s3fs).

Methods#

clear_failure(kind, variant, receptor_id[, ...])

Remove a receptor's failure record of kind, once its result is written.

complete(variant[, receptor_ids, realization])

Return the receptors whose simulations under variant are complete (completed()).

failure(kind, variant, receptor_id[, ...])

Return why a receptor's result of kind failed, as the worker recorded it, or None.

failures(kind, variant[, receptor_ids, ...])

Return {receptor_id: record} for the receptors with a failure record of kind.

folder(kind, variant)

Return variant's folder of kind, or None before it exists.

folders([variants])

Return every settings folder in the output directory, one row each.

hashes(kind)

Return every folder of kind, as {name: settings hash} in name order.

keep_workdir(variant, receptor_id, workdir)

Copy a run's working directory to kept_workdir(), replacing an earlier copy.

kept_workdir(variant, receptor_id[, realization])

Return where a receptor's failed run's working directory is kept, or None before its folder exists.

log_path(variant, receptor_id[, realization])

Return where the log of a receptor's transport model run is kept, or None before its folder exists.

logged(variant[, receptor_ids, realization])

Return the receptors that have a transport model log for variant.

path(kind, variant, receptor_id[, realization])

Return the file of one receptor's result, whether or not it exists.

present(kind, variant[, receptor_ids, ...])

Return the receptors that have a file of kind for variant.

read(kind, variant, receptor_id[, ...])

Return one receptor's result file as a table of its stored columns.

record_failure(kind, variant, receptor_id, ...)

Write why a receptor's result of kind failed, replacing an earlier record.

table(kind, variant[, receptor_ids, ...])

Return the files of many receptors as one table.

write_empty_footprint(variant, receptor[, ...])

Record that a receptor's footprint is empty: no particle reached the grid.

write_footprint(variant, foot[, realization])

Write one receptor's footprint (stilt.footprint.write_footprint()).

write_log(variant, receptor_id, text[, ...])

Write the log of a receptor's transport model run.

write_particles(variant, receptor, ...[, ...])

Write a receptor's particles (stilt.particles.write_particles()).