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.

Core types

Cross-cutting types consumed by multiple designs

UNEP
IMEO
MARS

Status: index of cross-cutting type designs. Scope: types and small dataclasses that are consumed by more than one of the major designs (reader, catalog, geotoolz operators) and therefore deserve their own home rather than being defined inside whichever design happens to need them first. Audience: anyone touching a type that flows between layers.


Primer for newcomers

ELI5. Some Lego pieces have unique shapes that only fit in one castle. Others are the standard 2×4 brick that fits in everything. This directory is for the standard 2×4 bricks of the design — small, reusable, with one shape that lots of places need.

What’s a “type” in this directory?

What it is. A type in this directory is a Python construct — usually a Protocol, occasionally a @dataclass — that defines a shape (what attributes/methods/fields a value must have) without owning the implementation. Types live here when more than one design references them.

How it works. Three flavours show up:

What this means for us. Code that takes a Protocol parameter (def f(reader: GeoData)) accepts any conforming object — no shared base class, no inheritance dance. Code that takes a @dataclass parameter (def f(slice_: GeoSlice)) gets all the dataclass machinery (immutable fields, equality, repr) for free. The patterns are deliberately small and uniform across the directory.

When does a type land here vs in a design subdir?

What it is. The criterion for promoting a type to plans/types/. Three conditions, all of which must hold.

How it works. A type lives here when (1) it’s a public surface — users construct or pattern-match against it directly, (2) it’s consumed by more than one of the major designs, and (3) it’s small enough to specify in one document. Types that fail any of these stay scoped to their owning design — e.g., GeoData / GeoDataBase / AsyncGeoData live in georeader/reader_protocol.md because they’re the subject of that design, not just incidental to it. Same logic kept GeoCatalog in geodatabase and Operator in geotoolz.

What this means for us. This directory grows slowly. Most “types” stay in their owning subdir; the ones that end up here are the ones that flow between layers (GeoSlice, Credential). The bytestore.md doc is here too but is not a Protocol of our own — it documents the decision to defer cloud byte transport to upstream obspec (see bytestore.md).


What goes here

A type lands in this directory when all three are true:

  1. It’s a public surface — users construct or pattern-match against it directly, not just an internal helper.

  2. It’s consumed by more than one design — moves between layers (reader → catalog → operator) rather than being scoped to a single subsystem.

  3. It’s small enough to specify in one document — a dataclass, a Protocol, or a small family of related primitives. Big subsystems (the reader Protocol surface, the catalog Protocol) get their own design dirs.

The georeader-side types that aren’t here, and why:

If a type starts in another design and grows into something multiple designs reference, promote it here — the cleanup is the same shape as the GeoSlice promotion that motivated this directory.


Current designs

DesignType(s) covered
geoslice.mdGeoSlice dataclass + the sampler/stitch family (random_sampler, grid_sampler, stitch) that produces and consumes GeoSlice.
credentials.mdCredential Protocol + per-cloud subclasses (AzureSASCredential, AzureManagedIdentityCredential, AWSStaticCredential, AWSProfileCredential, GCSServiceAccountCredential) + from_config(...) factory + to_obstore_*_store() adapter helpers. Replaces the env-var-soup pattern that every project currently re-implements.
bytestore.mdOne-page passthrough note: cloud byte transport is obspec.AsyncStore (upstream, not ours). We ship a small geotoolz.io.open_store(url) factory and nothing else. Not a Protocol of our own.

Future candidates

These are types that might land here as the geotoolz ecosystem grows. Listed for orientation, not commitment:

When a candidate becomes a real design, it lands here as a sibling to geoslice.md.


Conventions


Open questions, gotchas, and warnings

The cross-cutting types are the load-bearing ones — when they’re wrong, every downstream design ripples. Things to watch: