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.
About this page
| Status | The graph and the tables are generated; the rules are proposed and checked |
| Audience | anyone adding a dependency, an import or a repository to the stack, and anyone reviewing one |
| Companions | Package boundaries (the plume and radiative-transfer moves, and the counterfactual cycle they avoid); Report 16 (step D2, which removes the cycle); the capability indexes (what each repository exports) |
| Code checked against | the submodule pins in references/<layer>/ on this commit |
| Generated by | scripts/dependency_graph.py, which reads files only (it imports and installs nothing); tests/test_dependency_graph.py fails when this page or the README is stale, when the graph breaks a rule not in Table 2, and when one of those is fixed |
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 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:
Every edge between layers points down. GeoModels uses GeoML, GeoNumerics and GeoStack. GeoML uses GeoNumerics and GeoStack. GeoStack uses geophysix and radiomax of GeoNumerics, and Core. Core uses nothing above it.
gaussx is the foundation. Every repository in GeoNumerics, GeoML and GeoModels except geonnax, geophysix and radiomax reaches it. A breaking change in gaussx is a change to almost the whole stack.
plumax is the one GeoModels repository that imports another. It builds on radtrax: plume physics uses radiative transfer, never the reverse (package boundaries, rule 2).
The graph has no cycle. The last one was inside GeoStack: pipekit-train imported
geopatcher.timefrom geotoolz-patcher while geotoolz depends on pipekit. It ended whenXarrayWindowDatasetmoved togeopatcher.integrations.train, so pipekit imports nothing from geotoolz.
2The rules¶
Each rule is a check in scripts/dependency_graph.py. The name in brackets
is the rule’s name in Table 2.
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 underreferences/geostack/andreferences/numerics/.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 inTIERS. 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 usepackage-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 astale-package-layer.Every library edge counts. Base dependencies, extras, and imports, whether at module level, inside a function, behind a
tryor underTYPE_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.No cycles (
cycle,package-cycle): not between repositories, and not between the packages of one workspace (pipekit’s, geotoolz’s, xrtoolz’s, pyrox’s).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; whateverimport <package>runs needs a base dependency. ATYPE_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 isUNDECLARED_OKinscripts/dependency_graph.py: a guarded integration with a library that cannot be installed beside the package, listed with its reason.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 anImportErrornaming its new home, because a re-export is a reverse edge (Package boundaries).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.A new repository arrives with its place (
untiered,stale-tier,stale-package-tier,stale-package-layer). Adding a submodule means adding it toTIERSinscripts/dependency_graph.pywith 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.
| Layer | Tier | Repositories | Holds |
|---|---|---|---|
| GeoModels | 1 | plumax | plume models, which may build on radtrax |
| GeoModels | 0 | radtrax, sesmax | radiative transfer and Earth-system dynamics |
| GeoML | 3 | pyrox, vardax | probabilistic models and variational assimilation (may build on filterax) |
| GeoML | 2 | filterax, manipy | ensemble filters and manifold learning |
| GeoML | 1 | kernellib, pyrox (pyrox-gauss, pyrox-xtreme) | kernels, Gaussian distributions and extremes |
| GeoML | 0 | gauss_flows, geonnax | layers and flows |
| GeoStack | 2 | geotoolz (xrtoolz, xrtoolz-ops, xrtoolz-products) | operators on xarray, lifting geoops over cubes |
| GeoStack | 1 | geotoolz | operators on arrays and geoarray carriers |
| GeoStack | 0 | georeader | readers |
| GeoNumerics | 2 | tracerax | Lagrangian particles |
| GeoNumerics | 1 | gridax, radiomax | grids and finite volume, and observation geometry and radiometry |
| GeoNumerics | 0 | geophysix, spectraldiffx | physical facts about the Earth, and spectral methods |
| Core | 1 | argminax, integrix, gauss_flows (gauss-flows-maps) | optimisation and integration |
| Core | 0 | functax, gaussx, pipekit | pipelines, 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.
| Rule | From | To | Where | Why, and the fix |
|---|---|---|---|---|
| none |
The fixes:
Move pipekit-train’s window dataset into geotoolz-patcher (
geopatcher.integrations.train, behindgeotoolz-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 hasgeopatcher.temporal, notgeopatcher.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¶
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
damodule, a future smoother) needs them without either engine.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_assimilatebehind 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-up | Where | Why |
|---|---|---|
Move XarrayWindowDataset and _xreader to geopatcher.integrations.train | pipekit, geotoolz | fix 1; Report 16 D2 |
The same check inside each repository: python scripts/dependency_graph.py --guard <repo> writes its test_dependency_rules.py | each upstream repository but georeader | catches a reverse edge before it reaches geostack’s pin |
| Move vardax’s observation operators and dynamics onto filterax’s | vardax, filterax | open 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.
| From | To | Strongest evidence | Example |
|---|---|---|---|
| plumax | argminax | extra | plumax → argminax |
| plumax | functax | base | plumax → functax |
| plumax | gaussx | base | plumax → gaussx |
| plumax | geophysix | base | plumax → geophysix |
| plumax | georeader | extra | plumax → georeader-spaceml |
| plumax | geotoolz | extra | plumax → geotoolz-ops |
| plumax | gridax | base | plumax → gridax |
| plumax | integrix | base | plumax → integrix |
| plumax | kernellib | base | plumax → kernellib |
| plumax | pipekit | base | plumax → pipekit-array |
| plumax | pyrox | extra | plumax → pyrox-xtreme |
| plumax | radtrax | base | plumax → radtrax |
| plumax | tracerax | base | plumax → tracerax |
| plumax | vardax | extra | plumax → vardax |
| radtrax | argminax | base | radtrax → argminax |
| radtrax | functax | base | radtrax → functax |
| radtrax | gaussx | base | radtrax → gaussx |
| radtrax | geophysix | base | radtrax → geophysix |
| radtrax | georeader | extra | radtrax → georeader-spaceml |
| radtrax | geotoolz | extra | radtrax → geotoolz-ops |
| radtrax | pipekit | extra | radtrax → pipekit-ops |
| radtrax | radiomax | base | radtrax → radiomax |
| sesmax | filterax | extra | sesmax-core → filterax |
| sesmax | functax | base | sesmax-core → functax |
| sesmax | gaussx | base | sesmax-core → gaussx |
| sesmax | geophysix | base | sesmax-core → geophysix |
| sesmax | gridax | base | sesmax-core → gridax |
| sesmax | integrix | base | sesmax-core → integrix |
| sesmax | pipekit | base | sesmax-core → pipekit-array |
| sesmax | spectraldiffx | base | sesmax-core → spectraldiffx |
| sesmax | vardax | extra | sesmax-core → vardax |
| filterax | gaussx | base | filterax → gaussx |
| gauss_flows | functax | base | gauss-flows-maps → functax |
| gauss_flows | gaussx | base | gauss-flows-models → gaussx |
| geonnax | functax | base | geonnax → functax |
| geonnax | gauss_flows | base | geonnax → gauss-flows-maps |
| kernellib | functax | base | kernellib → functax |
| kernellib | gaussx | base | kernellib → gaussx |
| manipy | gaussx | base | manipy-jax → gaussx |
| manipy | kernellib | base | manipy-jax → kernellib |
| pyrox | argminax | base | pyrox-gp → argminax |
| pyrox | filterax | extra | pyrox-ssm → filterax |
| pyrox | functax | base | pyrox-gp → functax |
| pyrox | gauss_flows | base | pyrox-nn → gauss-flows-maps |
| pyrox | gaussx | base | pyrox-gauss → gaussx |
| pyrox | geonnax | base | pyrox-nn → geonnax |
| pyrox | kernellib | base | pyrox-gp → kernellib |
| vardax | argminax | base | vardax → argminax |
| vardax | functax | base | vardax → functax |
| vardax | gaussx | base | vardax → gaussx |
| vardax | geonnax | base | vardax → geonnax |
| vardax | integrix | base | vardax → integrix |
| vardax | pipekit | base | vardax → pipekit-cycle |
| geotoolz | functax | base | geotoolz-array → functax |
| geotoolz | geophysix | base | geotoolz-ops → geophysix |
| geotoolz | georeader | base | geotoolz-cloud → georeader-spaceml |
| geotoolz | gridax | base | xrtoolz-ops → gridax |
| geotoolz | pipekit | base | geotoolz-array → pipekit-array |
| geotoolz | radiomax | base | geotoolz-ops → radiomax |
| geophysix | pipekit | base | geophysix → pipekit-array |
| gridax | gaussx | extra | gridax → gaussx |
| gridax | geophysix | base | gridax → geophysix |
| gridax | integrix | extra | gridax → integrix |
| gridax | pipekit | base | gridax → pipekit-array |
| gridax | spectraldiffx | extra | gridax → spectraldiffx |
| radiomax | geophysix | base | radiomax → geophysix |
| radiomax | pipekit | base | radiomax → pipekit-array |
| spectraldiffx | functax | base | spectraldiffx → functax |
| spectraldiffx | gaussx | base | spectraldiffx → gaussx |
| tracerax | functax | base | tracerax → functax |
| tracerax | geophysix | base | tracerax → geophysix |
| tracerax | integrix | base | tracerax → integrix |
| tracerax | pipekit | base | tracerax → pipekit-array |
| argminax | gaussx | base | argminax → gaussx |
| integrix | functax | base | integrix → functax |
| integrix | gaussx | base | integrix → gaussx |