Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

runtraj

Tests Documentation Code Quality codecov PyPI version Python Version License: MIT DOI Ruff Pyrefly

runtraj runs particle dispersion models at scale. You describe where and when particles are released and the settings to run them under, and it runs the transport model once for each, on your machine or as a Slurm job array, and keeps the particles where you can find them again. HYSPLIT is the model built in; another model, and what is made from the particles afterwards, plug in by the import path of a class.

runtraj is not a model: it runs one, for every release and every set of settings, and keeps track of what is done.

The guides and the API reference are at https://jmineau.github.io/runtraj.

Status

runtraj is alpha software. There are no backward compatibility guarantees before v1.0, and the public API may still change.

Installation

Install it from PyPI:

pip install runtraj

For plotting and for downloading meteorology from NOAA, add the complete extra (runtraj[complete]).

runtraj runs NOAA's HYSPLIT program, hycs_std, but does not include it or its data tables. Download HYSPLIT from NOAA's Air Resources Laboratory, which asks you to accept the HYSPLIT terms of use first. Unpack it, then set directory under models: hysplit: in config.yaml to the folder it makes, or put that folder's exec/ on PATH:

models:
  hysplit:
    directory: /path/to/hysplit

Quickstart

A release is the time and place a run starts from. Run the transport model for one:

import runtraj

release = runtraj.PointRelease(
    time="2023-07-15 18:00",   # UTC
    longitude=-111.848,
    latitude=40.766,
    altitude=10,               # meters above ground
)
met = "/data/hrrr"             # a folder of ARL files; their headers say what they hold

particles = runtraj.run_trajectories(release, met, n_hours=-24, numpar=100)

particles is a pandas DataFrame, one row per particle per step. A negative n_hours follows the particles backward in time, a positive one forward.

For many releases, a project runs each one and keeps the results:

project = runtraj.Project.init(
    "./my_project",
    releases=[release],
    mets={"hrrr": met},
    models={"hysplit": {"n_hours": -24, "numpar": 100}},
    variants={"hrrr": {}},
)
project.run()   # returns when the run is done

sim = project.simulation(release.id, "hrrr")
sim.particles

Everything is saved in ./my_project. Later, open it again with runtraj.Project("./my_project"). A second run() only runs what is missing. To change a setting, edit config.yaml.

Command line

runtraj check ./my_project         # list what would stop a run, before any run
runtraj run ./my_project           # run every release that is not done yet
runtraj run ./my_project --cpus 8  # the same, eight releases at a time
runtraj submit ./my_project        # the same, as a Slurm job array
runtraj status ./my_project        # what has finished, and the settings folders

runtraj run exits with 0 when every simulation it ran is complete, 1 when some failed, and 3 when it was stopped, or a connection error stopped some, before they finished.

Variants

A variant is a named set of settings. Every release runs once under each variant, and a variant's results are in a folder named for its settings, so a changed setting never overwrites an earlier run:

mets:
  hrrr: /data/hrrr
models:
  hysplit: {n_hours: -24, numpar: 100}
variants:
  hrrr: {}
  hrrr-long: {n_hours: -72}

Plug-ins

A transport model in another package runs in place of HYSPLIT, and a stage makes one file per release from the particles after the model runs. config.yaml names each by the import path of its class, so runtraj imports neither until a project asks for it:

stages:
  footprint:
    class: stilt.footprint.FootprintStage   # PYSTILT's footprint

Citing

If you use runtraj in published work, please cite it through its Zenodo DOI, which always points to the latest release. GitHub's "Cite this repository" gives the reference from CITATION.cff.

Use of AI coding agents

This project is developed with the help of AI coding agents, directed and reviewed by the maintainer, who owns the design and the science.

License

MIT. See LICENSE.

Metadata

Release files for runtraj 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for runtraj 0.1.0a2
File Size Uploaded Provenance Actions
runtraj-0.1.0a2.tar.gz 1.0 MB With provenance Details for runtraj-0.1.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for runtraj 0.1.0a2
File Interpreter ABI Platform Actions
runtraj-0.1.0a2-py3-none-any.whl Python 3 none any Details for runtraj-0.1.0a2-py3-none-any.whl

Total release size: 1.3 MB

Release files / runtraj-0.1.0a2.tar.gz

Download URL runtraj-0.1.0a2.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
d2693707404a9b1ce8c23cd553b654539de11ab77589bc6b4caea421d70170f5
BLAKE2b-256 checksum
How to use checksums
3a8e22c227467efb50c134f9a699faef8800ed0a0dc8c029a49bfc06040c78e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / runtraj-0.1.0a2-py3-none-any.whl

Download URL runtraj-0.1.0a2-py3-none-any.whl
Size 225.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b7b1bd425765f1132a4f96987efbd80e149644fc0c3d0230cac35a5adfab5b7
BLAKE2b-256 checksum
How to use checksums
a3b15a2af18c2b644740a35ab6d01fb5d377187ad06a3e68fd1bce4b536d3e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for runtraj 0.1.0a2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for runtraj-0.1.0a2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page