tracmass.run#
- tracmass.run(dtm_start=None, dtm_end=None, state=None, *, env=None, gcm=None, integrator=None, verbose=None, **kwargs)[source]#
Build the grid and flux buffer, seed, and integrate in one call.
- Parameters:
dtm_start (
strorpd.TimestamporNone, optional) – Start date. Default: thedtm_startsetting, else the adapter’s own default date.dtm_end (
strorpd.TimestamporNone, optional) – End date; earlier than the start date means a backward run. Default: thedtm_endsetting, else start + theruntimesetting, else a single window.state (
ParticleStateorcallableorNone, optional) – Initial particles, orseed(grid) -> ParticleStatecalled once the grid is built (and env is active, so it can read settings). Default: seed from the[env.seed]settings table viatracmass.seed.from_settings().env (
strorNone, optional) –tracmass.tomlenvironment to activate first (viasettings.setenv; it stays active after the call, which is what adapters and integrators read during the run). Default: keep the current environment.gcm (
strorcallableorNone, optional) – Adapter name orfluxescallable. Default: thegcm.namesetting.integrator (
strorNone, optional) – Name of the integrator, a key ofINTEGRATORS. Default: theintegratorsetting, else"time_dependent".verbose (
boolorNone, optional) – Print timestamped debug messages for each stage (adapter calls, flux reads and their size, seeding, compilation, each window) to stderr while the run lasts; seetracmass.verbose. Default: theverbosesetting, else False.**kwargs –
dtmis accepted as an alias for dtm_start (matching thedtmnaming ofLazyFluxFields); the rest are passed on to the integrator (e.g.iter_sub,monitor,recorder,patch_buffer,n_windows).
- Returns:
ParticleState– Final particle state.- Raises:
ValueError – If no GCM is given or configured, integrator is unknown, state is omitted and there is no usable
[env.seed]table, or a string dtm_start / dtm_end is not a date (e.g.run("omi")whererun(env="omi")was meant).TypeError – If both dtm_start and its alias
dtmare given. If a particle state or seed callable is passed as dtm_start or dtm_end (the pre-2026-09-30 argument order).
- Return type:
Examples
>>> from tracmass import seed >>> result = tracmass.run( ... "2020-07-01", ... state=lambda grid: seed.ijk(10, 20, 10, 20, 1, 1, grid=grid), ... env="tempvel", integrator="time_dependent_patched", ... ) >>> result = tracmass.run("2007-06-01", env="omi") # seeding from settings too >>> result = tracmass.run(dtm="2007-06-01", env="omi") # same, via the alias