Exceptions#
Every exception runtraj raises is a runtraj.RuntrajError, so one
except clause catches them all:
import runtraj
try:
project.run()
except runtraj.RuntrajError as error:
print(f"runtraj stopped: {error}")
Each one also subclasses the builtin that describes it. A
SimulationError is a RuntimeError, and a
HYSPLITNotFoundError is a FileNotFoundError.
A MeteorologyError, raised when a met’s files
cannot be found, is both. An except for the builtin catches it too. Plain input checks, such as
a negative particle count, raise ValueError.
Base class#
Base class for every exception runtraj raises. |
Failed runs#
A worker records a SimulationError as a failed
simulation (runtraj.Simulation.failure). Its reason is a short
name for the cause: for HYSPLIT, one of
runtraj.models.hysplit.FailureReason, such as MET_COVERAGE,
NO_PARTICLE_DATA, or TIMEOUT. A run that the meteorology does not
cover fails as MET_COVERAGE.
Two reasons come from runtraj itself, for any transport model:
RELEASE_REFUSEDThe transport model cannot run the release, and said so in its
check_releasesbefore the run;runtraj checklists it too. With HYSPLIT, it is a multipoint release whose points share a horizontal location: use aColumnReleasefor a column, or onePointReleaseper height.NO_RELEASE_ROWSWhere the particles of a column or multipoint release started is not known: the model wrote no row at
age = 0and gives norelease_rows, or itsrelease_rowsleft out a particle. A model should write a release row atage = 0(The Particle Table).
A simulation failed while it ran. |
|
The meteorology files a simulation needs could not be found or staged. |
Stopped runs#
A run on cpus above 1 raises WorkerDied when a
worker process is killed outright, as the out-of-memory killer does. It is not
a failed simulation: nothing is recorded, and running again continues.
A worker process died without Python's say, and the run stopped. |
Setup#
A project does not open on a machine where a class its config.yaml
names by import path is not installed
(MissingClass, an ImportError): a transport
model or a stage in another package. The message names the package to
install, and the runtraj commands exit with 2.
The HYSPLIT executable ( |
|
A class that |