Skip to main content

Regional sea-surface-height-anomaly reconstruction with first-class predictive uncertainty

Project description

sverdrup

A regional SSHA (sea-surface-height anomaly) reconstruction framework with first-class, rigorous predictive-distribution uncertainty. Phase 1 wires a single space-time tile end-to-end (OSSE + OSE) through a hexagonal stack: a hand-rolled dense space-time GP / optimal interpolation exposes native covariance and whole-field samples behind a CovarianceOperator seam, and each unit of work returns a Persisted Product bundle (mean + exact marginal variance + low-rank factor + clipped diagonal residual + eval-point predictions) reduced on-worker while the exact operator is still live.

Installation

Dependencies are managed with pixi:

pixi install

Quick usage

Run a config-driven pipeline over a regional tile (OSSE on the committed fixtures):

pixi run python -m sverdrup tests/integration/config_osse.json

This windows the observations, dispatches the solve through a dask.distributed LocalCluster, writes the persisted Product to an fsspec URL, and prints evaluator scores (RMSE vs truth, calibration, ground-track power).

Programmatically:

from sverdrup.adapters.odc.fixtures import FixtureSource
from sverdrup.application.pipeline import PipelineInputs, run_pipeline

src = FixtureSource("tests/fixtures/natl60_tiny.nc", ref_path="tests/fixtures/natl60_ref_tiny.nc")
product, scores = run_pipeline(PipelineInputs(
    mode="OSSE", method_name="oi", source=src, out_url="file:///tmp/osse.zarr",
    lon_range=(-64, -56), lat_range=(34, 42), time_range=(0, 5), output_times=[2.0],
    params={"length_scale": 300.0, "time_scale": 10.0, "variance": 0.05},
))

Common tasks

pixi run test        # pytest (the opt-in oracle is skipped without SVERDRUP_ODC_DATA)
pixi run lint        # ruff check
pixi run format      # ruff format
pixi run typecheck   # mypy

The correctness oracle (reproducing the ODC OI leaderboard number) is opt-in — see docs/oracle-runbook.md.

Releasing

Publishing to PyPI is automated via GitHub Actions Trusted Publishing on tag push. The workflow lives at docs/superpowers/ci/release.yml; copy it to .github/workflows/release.yml in the GitHub repo (a one-time step — the local tooling token cannot push workflow files). Configure the PyPI trusted publisher (project sverdrup, owner killett, repo sverdrup, workflow release.yml, environment pypi), then git tag -a vX.Y.Z -m "..." && git push origin vX.Y.Z.

Project structure

src/sverdrup/
  core/          # pure protocols + value objects (grid, types, distribution, product, ports, ...)
  distributions/ # Gaussian / Ensemble / Persisted distributions + lifting adapters
  methods/       # space-time Matern-3/2 kernel, Cholesky solver, GP/OI (Method 1), trivial (Method 0)
  derived/       # CRS-aware first-difference (real) + committed stubs
  eval/          # accuracy, calibration (+ polar-void), ground-track evaluators
  adapters/      # dask executor, fsspec result sink, ODC data sources + fixtures
  application/   # unit of work, solve_unit, splits, run config, end-to-end pipeline
tests/           # unit, integration, oracle; tiny committed NetCDF fixtures
docs/            # architecture design, implementation plan, oracle runbook

See PROGRESS.md for the running project notebook (decisions, gotchas, deviations).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sverdrup-0.1.0.tar.gz (281.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sverdrup-0.1.0-py3-none-any.whl (52.3 kB view details)

Uploaded Python 3

File details

Details for the file sverdrup-0.1.0.tar.gz.

File metadata

  • Download URL: sverdrup-0.1.0.tar.gz
  • Upload date:
  • Size: 281.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sverdrup-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5cb89fddfa2d153e136dc23cb1bb56f6515872bb12ef76597e4e6f7e9f4a85e4
MD5 a03368638d46c51b028a11ef6d4bd016
BLAKE2b-256 ed724b6fe99efc3f79cc266b94db87ac2dc22ca86044ac38816c12a09669948f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sverdrup-0.1.0.tar.gz:

Publisher: release.yml on killett/sverdrup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sverdrup-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sverdrup-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 52.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sverdrup-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 764e7edb2af86de3929a5de770dfbc9a603fd4e80ec23023508312ba58eca1f4
MD5 26a9e2447ec722e8a1821a315d33cf1f
BLAKE2b-256 136a6026c3a93ffb06b5621baa793ab3d78997828660643229a7b7bf59534e3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sverdrup-0.1.0-py3-none-any.whl:

Publisher: release.yml on killett/sverdrup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page