Kinds and roles: three kinds of function, three kinds of data
Design · working page · how code in the stack is packaged, what data it sees, the role each name plays in its library, and the rules that place any name in the stack
Abstract¶
A working page split from the layer map, which keeps the layers, the imports and the boundaries of each library. This page holds the two axes every name in the stack sits on: how its code is packaged and what data it sees. It starts from the silent failures of geo code, defines the objects in symbols with one running example (a methane plume in an EMIT hyperspectral scene over an oil and gas field: a matched filter, a plume mask, and an emission rate from the integrated mass enhancement and the wind), climbs the role ladder inside a library, and ends with the rules that decide where a name may live and what it may call.
Status. A draft, still being worked on; the open questions are tracked in #122 (the role ladder per library).
TL;DR: two axes, one ladder, four rules¶
Why. Seven ways geo code goes wrong without an error: axes by position, a lost georeference, mismatched grids, nodata, maths locked in one container, setup that can’t be traced, and pipelines held together by scripts. The first four are about the data; the last three are about how the code is packaged.
The data axis. A plain array ; a named array , with a name and coordinates per axis (pipekit-array’s
DimArray, xarray’sDataArray); and a carrier , with the georeference (geoarray’sGeoArray).The kind axis. A function of the data , what it needs to know about where the data sits (geometry, band positions), and parameters ; a Module, whose setup runs once and whose call is jittable after; and an Operator , which lifts a function onto carriers with a JSON config , : unwrap, compute on arrays, rewrap.
The role ladder. ⓪ structure, ① primitive, ② strategy, ③ model, ④ algorithm, ⑤ step (one transformation with its settings), ⑥ recipe (steps composed into a job, in code or as data); orchestration sits above the ladder and is not a rung.
Who works where. Data engineers at ⑥ and in orchestration; geoscience researchers at ⑤ and ⑥, where carriers begin; ML researchers at ② to ④; numerics and CS at ⓪ to ④. Each band treats the rung below it as its floor.
Four rules. The cell (kind × data) decides the lowest layer a name may live in; the tier decides what a library may import; the kind and the data decide what a name may take and call (arrays go everywhere, carriers stop at GeoStack, configs stop at Operators); each library declares its cells.
On the page¶
The problem: why geo code is hard to write well
The objects, in symbols: the data axis (plain array, named array, carrier) and the kind axis (function, Module, Operator), each with a worked example in code, and a note on the parallels with operator learning (encoder, approximator, reconstructor), Lift & Learn and Koopman
The running example, end to end, as four lifted functions, and the data axis in three lines
Inside a library: the role ladder, with steps, recipes and orchestration; then the running example up the ladder: the data, primitives, strategies and models, algorithms, one step per stage, and the recipe (retrieval, segmentation, quantification) with its orchestration
Who works where: bands of the ladder
One vocabulary per axis, and whether we need a name change
The four rules, the three invariants, and what enforces them today
geoarray, gridax and functax: geometry has no CRS below GeoStack