Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Dependency graph

How the stack's repositories depend on one another, and the rules that keep the graph acyclic

Abstract

geostack builds on twenty-one repositories in four layers. This page draws how they depend on one another, from what each library declares (base dependencies and extras) and what its code actually imports (including lazy, try-guarded and type-checking-only imports). It then states eight rules that keep the graph free of cycles.

Today the graph breaks none of them.

Keywords:dependency graphcircular dependencieslayerspipekitgeotoolz

1The graph

The diagram folds packages into repositories: pipekit’s seven packages are one box, so are geotoolz’s five, xrtoolz’s six and pyrox’s four. Each arrow reads “imports or depends on”.

The repositories in five layer bands, with edges pointing down from each repository to those it depends on or imports.
The same graph as Mermaid

22 repositories, 49 packages and 76 dependencies between repositories, from each submodule’s pyproject.toml and imports. Solid arrows are base dependencies or imports, dashed ones extras; an arrow a longer path implies is not drawn. Dev, docs and tutorial dependency groups are not library dependencies and are left out.

What it shows:

2The rules

Each rule is a check in scripts/dependency_graph.py. The name in brackets is the rule’s name in Table 2.

  1. Layers point down (upward). A repository may depend on its own layer or a lower one: Core at the bottom, then GeoNumerics, GeoStack, GeoML, and GeoModels on top. GeoStack may import GeoNumerics, and GeoNumerics never imports GeoStack (OP-O9, 23 Nov 2026). Core is the stack layer map’s layer of maths and plumbing that know no geography (pipekit, gaussx, functax, argminax and integrix); its repositories keep their submodule directories under references/geostack/ and references/numerics/.

  2. Within a layer, tiers point down (tier). Each repository has a tier in its layer (Table 1) and imports only repositories of a lower tier. Two repositories of the same tier never import each other. In GeoModels, radtrax and sesmax share tier 0 and plumax sits above them in tier 1, because its plume-to-radiance coupling composes a plume model with radtrax’s forward model. A group of packages inside one repository can sit in a higher tier of its own (PACKAGE_TIERS, package-tier): the xrtoolz packages sit in GeoStack tier 2 inside geotoolz, so xrops may import geoops, but no other geotoolz package may import or depend on xrtoolz, xrtoolz-ops or xrtoolz-products. A cycle check alone would miss geocatalog or geoproducts importing xrops, because xrops depends on neither. Between repositories, each package’s own tier applies. A workspace package may also sit in a different layer from the rest of its repository (PACKAGE_LAYERS, stale-package-layer): it is listed with its own layer and tier, and the repository keeps its own entry in TIERS. Inside the repository, an edge between two layers is checked like an edge between repositories, so a GeoML package may import a Core package of its own repository and never the reverse; only edges between packages of one layer use package-tier. A repository with packages in more than one layer gets one forbidden list per package in its generated guard test, and an entry that names a package the repository no longer has is a stale-package-layer.

  3. Every library edge counts. Base dependencies, extras, and imports, whether at module level, inside a function, behind a try or under TYPE_CHECKING, all go into the graph. An optional edge is still an edge, and optional edges are where cycles hide: the last cycle the graph had was a lazy, guarded import. Dependency groups (dev, docs, tutorials) are not: they install tools for working on the repository, not the library, so a tutorial may use a library above it.

  4. No cycles (cycle, package-cycle): not between repositories, and not between the packages of one workspace (pipekit’s, geotoolz’s, xrtoolz’s, pyrox’s).

  5. Every import is declared (undeclared), as a base dependency or an extra. An extra suits an optional module (one the package’s __init__ does not import) or a lazy or guarded import; whatever import <package> runs needs a base dependency. A TYPE_CHECKING-only import needs no declaration but still obeys rules 1 and 2. Code the package ships never relies on a dependency group. The one way out is UNDECLARED_OK in scripts/dependency_graph.py: a guarded integration with a library that cannot be installed beside the package, listed with its reason.

  6. A reverse edge is fixed by moving code, never by a shim. When a lower repository needs something from a higher one, either the primitive moves down into the lower one, or the adapter moves up into the higher one (as an integrations/ module behind an extra). A moved name leaves no re-export behind: its old path raises an ImportError naming its new home, because a re-export is a reverse edge (Package boundaries).

  7. A third-party repository is a leaf (third-party). georeader belongs to spaceml-org: we depend on it and never change it, and nothing of ours moves into it.

  8. A new repository arrives with its place (untiered, stale-tier, stale-package-tier, stale-package-layer). Adding a submodule means adding it to TIERS in scripts/dependency_graph.py with its layer and tier, in the same pull request, and removing or renaming one means changing its entry there too.

3Layers and tiers

Table 1:Each repository’s tier in its layer. A repository may import lower tiers of its own layer and any tier of a lower layer.

LayerTierRepositoriesHolds
GeoModels1plumaxplume models, which may build on radtrax
GeoModels0radtrax, sesmaxradiative transfer and Earth-system dynamics
GeoML3pyrox, vardaxprobabilistic models and variational assimilation (may build on filterax)
GeoML2filterax, manipyensemble filters and manifold learning
GeoML1kernellib, pyrox (pyrox-gauss, pyrox-xtreme)kernels, Gaussian distributions and extremes
GeoML0gauss_flows, geonnaxlayers and flows
GeoStack2geotoolz (xrtoolz, xrtoolz-ops, xrtoolz-products)operators on xarray, lifting geoops over cubes
GeoStack1geotoolzoperators on arrays and geoarray carriers
GeoStack0georeaderreaders
GeoNumerics2traceraxLagrangian particles
GeoNumerics1gridax, radiomaxgrids and finite volume, and observation geometry and radiometry
GeoNumerics0geophysix, spectraldiffxphysical facts about the Earth, and spectral methods
Core1argminax, integrix, gauss_flows (gauss-flows-maps)optimisation and integration
Core0functax, gaussx, pipekitpipelines, linear algebra, Gaussians and function approximation

The tiers follow what each repository is for, not only the edges it has today. filterax could sit lower, since it imports only gaussx; it sits at tier 2 so that vardax, alone at tier 3, may build on it and never the other way round. The two already overlap: each has its own observation operators (filterax’s AbstractObsOperator and LinearizableObsOperator, vardax’s LinearObs, InterpObs and MaskedIdentity), adjoint strategies and dynamics wrappers, and vardax’s ensemble posterior already defers to filterax. A hybrid ensemble–variational scheme builds vardax’s background covariance from a filterax ensemble; nothing in filterax needs a variational solver. So the shared vocabulary belongs in filterax, and vardax reuses it (open question 1).

4Where the graph breaks the rules today

Table 2:Every rule the graph breaks, from the check. The check fails on a row not listed in KNOWN in the script, and on a listed one that is fixed, so this table only shrinks.

RuleFromToWhereWhy, and the fix
none

The fixes:

  1. Move pipekit-train’s window dataset into geotoolz-patcher (geopatcher.integrations.train, behind geotoolz-patcher[train]). This is Report 16’s step D2, and rule 6’s “move the adapter up”. It removes the cycle, the tier break and the two undeclared imports, which are four rows for one dataset. The imports are broken anyway: geotoolz-patcher has geopatcher.temporal, not geopatcher.time.

gauss-flows-models’s guarded gaussx import (the transform filters) stays undeclared, as an exception in UNDECLARED_OK, until gauss_flows#183 declares gaussx; geostack#343 then removes the entry.

5Open questions

  1. Do vardax’s observation operators and dynamics move to filterax, or to a smaller shared package below both? Tier order decides only which may import which. Moving the shared types into filterax is the smallest step; a separate package is worth it only if a third library (somax’s da module, a future smoother) needs them without either engine.

  2. May pyrox and filterax import each other? Decided on 10 Nov 2026 (geostack#147): pyrox may import filterax, and not the other way round. pyrox moved to tier 3, beside vardax, so that pyrox-ssm’s ensemble likelihood can wrap filterax.differentiable_assimilate behind its [ensemble] extra (pyrox#369). Nothing imported pyrox, so no edge broke; pyrox and vardax, now sharing tier 3, may not import each other.

6Upcoming work

Table 3:Follow-ups.

Follow-upWhereWhy
Move XarrayWindowDataset and _xreader to geopatcher.integrations.trainpipekit, geotoolzfix 1; Report 16 D2
The same check inside each repository: python scripts/dependency_graph.py --guard <repo> writes its test_dependency_rules.pyeach upstream repository but georeadercatches a reverse edge before it reaches geostack’s pin
Move vardax’s observation operators and dynamics onto filterax’svardax, filteraxopen question 1

7Every edge

Table 4:Every dependency between two repositories, with its strongest evidence (base dependency, extra, import, in that order) and one package-level example.

FromToStrongest evidenceExample
plumaxargminaxextraplumax → argminax
plumaxfunctaxbaseplumax → functax
plumaxgaussxbaseplumax → gaussx
plumaxgeophysixbaseplumax → geophysix
plumaxgeoreaderextraplumax → georeader-spaceml
plumaxgeotoolzextraplumax → geotoolz-ops
plumaxgridaxbaseplumax → gridax
plumaxintegrixbaseplumax → integrix
plumaxkernellibbaseplumax → kernellib
plumaxpipekitbaseplumax → pipekit-array
plumaxpyroxextraplumax → pyrox-xtreme
plumaxradtraxbaseplumax → radtrax
plumaxtraceraxbaseplumax → tracerax
plumaxvardaxextraplumax → vardax
radtraxargminaxbaseradtrax → argminax
radtraxfunctaxbaseradtrax → functax
radtraxgaussxbaseradtrax → gaussx
radtraxgeophysixbaseradtrax → geophysix
radtraxgeoreaderextraradtrax → georeader-spaceml
radtraxgeotoolzextraradtrax → geotoolz-ops
radtraxpipekitextraradtrax → pipekit-ops
radtraxradiomaxbaseradtrax → radiomax
sesmaxfilteraxextrasesmax-core → filterax
sesmaxfunctaxbasesesmax-core → functax
sesmaxgaussxbasesesmax-core → gaussx
sesmaxgeophysixbasesesmax-core → geophysix
sesmaxgridaxbasesesmax-core → gridax
sesmaxintegrixbasesesmax-core → integrix
sesmaxpipekitbasesesmax-core → pipekit-array
sesmaxspectraldiffxbasesesmax-core → spectraldiffx
sesmaxvardaxextrasesmax-core → vardax
filteraxgaussxbasefilterax → gaussx
gauss_flowsfunctaxbasegauss-flows-maps → functax
gauss_flowsgaussxbasegauss-flows-models → gaussx
geonnaxfunctaxbasegeonnax → functax
geonnaxgauss_flowsbasegeonnax → gauss-flows-maps
kernellibfunctaxbasekernellib → functax
kernellibgaussxbasekernellib → gaussx
manipygaussxbasemanipy-jax → gaussx
manipykernellibbasemanipy-jax → kernellib
pyroxargminaxbasepyrox-gp → argminax
pyroxfilteraxextrapyrox-ssm → filterax
pyroxfunctaxbasepyrox-gp → functax
pyroxgauss_flowsbasepyrox-nn → gauss-flows-maps
pyroxgaussxbasepyrox-gauss → gaussx
pyroxgeonnaxbasepyrox-nn → geonnax
pyroxkernellibbasepyrox-gp → kernellib
vardaxargminaxbasevardax → argminax
vardaxfunctaxbasevardax → functax
vardaxgaussxbasevardax → gaussx
vardaxgeonnaxbasevardax → geonnax
vardaxintegrixbasevardax → integrix
vardaxpipekitbasevardax → pipekit-cycle
geotoolzfunctaxbasegeotoolz-array → functax
geotoolzgeophysixbasegeotoolz-ops → geophysix
geotoolzgeoreaderbasegeotoolz-cloud → georeader-spaceml
geotoolzgridaxbasexrtoolz-ops → gridax
geotoolzpipekitbasegeotoolz-array → pipekit-array
geotoolzradiomaxbasegeotoolz-ops → radiomax
geophysixpipekitbasegeophysix → pipekit-array
gridaxgaussxextragridax → gaussx
gridaxgeophysixbasegridax → geophysix
gridaxintegrixextragridax → integrix
gridaxpipekitbasegridax → pipekit-array
gridaxspectraldiffxextragridax → spectraldiffx
radiomaxgeophysixbaseradiomax → geophysix
radiomaxpipekitbaseradiomax → pipekit-array
spectraldiffxfunctaxbasespectraldiffx → functax
spectraldiffxgaussxbasespectraldiffx → gaussx
traceraxfunctaxbasetracerax → functax
traceraxgeophysixbasetracerax → geophysix
traceraxintegrixbasetracerax → integrix
traceraxpipekitbasetracerax → pipekit-array
argminaxgaussxbaseargminax → gaussx
integrixfunctaxbaseintegrix → functax
integrixgaussxbaseintegrix → gaussx