runtraj.output.Output#

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

An output directory: particles and the files of each stage, 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 the name of a stage such as "footprint") 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, release_id[, ...])

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

complete(variant[, release_ids, realization])

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

failure(kind, variant, release_id[, realization])

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

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

Return {release_id: record} for the releases 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, release_id, workdir[, ...])

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

kept_workdir(variant, release_id[, realization])

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

kinds()

Return the kinds of result the directory holds a tree for: particles, then the others in name order.

log_path(variant, release_id[, realization])

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

logged(variant[, release_ids, realization])

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

make_path(kind, variant, release_id[, ...])

Return where one release's result of kind is written, making the variant's settings folder on first use.

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

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

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

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

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

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

record_failure(kind, variant, release_id, record)

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

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

Return the files of many releases as one table.

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

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

write_particles(variant, release, particles, ...)

Write a release's particles (runtraj.particles.write_particles()).