runtraj.Project#

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

A project’s particle runs: releases, settings, and the simulations they define.

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

Make a new project with init(). After that, config.yaml is yours to edit; runtraj 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().

releases

The releases, one row per release, in file order.

releases_path

The project's releases.csv.

simulations

Every release under every variant, one row per simulation.

variants

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

Methods#

add_releases(releases)

Add releases to releases.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.

concentration([sel])

Load the concentration result of every selected simulation that has one.

fetch([sel, skip_existing])

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.

incomplete([sel])

Return the selected simulations that are missing an expected result.

init(path[, releases, config])

Make a new project and return it.

particles([sel, columns])

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

release(release_id)

Return one release by id, built from its rows.

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

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

simulation(release_id, variant[, realization])

Return one simulation: a release 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 or Kubernetes, and return at once.

table_path(name)

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

trajectories([sel])

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