sverdrup 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sverdrup-0.1.0/.claude/CLAUDE_SETTINGS_summarize_and_exit.json +11 -0
- sverdrup-0.1.0/.claude/hooks/summarize-and-exit.sh +32 -0
- sverdrup-0.1.0/.github/workflows/release.yml +38 -0
- sverdrup-0.1.0/.gitignore +36 -0
- sverdrup-0.1.0/.pre-commit-config.yaml +47 -0
- sverdrup-0.1.0/.scaffold.lock +0 -0
- sverdrup-0.1.0/CLAUDE.md +126 -0
- sverdrup-0.1.0/LICENSE +202 -0
- sverdrup-0.1.0/PKG-INFO +120 -0
- sverdrup-0.1.0/PROGRESS.md +91 -0
- sverdrup-0.1.0/README.md +80 -0
- sverdrup-0.1.0/docs/oracle-runbook.md +74 -0
- sverdrup-0.1.0/docs/phase1_claude_code_prompt.md +84 -0
- sverdrup-0.1.0/docs/phase1_scope_spec.md +260 -0
- sverdrup-0.1.0/docs/superpowers/ci/release.yml +38 -0
- sverdrup-0.1.0/docs/superpowers/plans/2026-06-21-regatta-phase1.md +4006 -0
- sverdrup-0.1.0/docs/superpowers/plans/2026-06-21-regatta-phase1.md.tasks.json +29 -0
- sverdrup-0.1.0/docs/superpowers/plans/2026-06-21-sverdrup-pypi-release.md +494 -0
- sverdrup-0.1.0/docs/superpowers/plans/2026-06-21-sverdrup-pypi-release.md.tasks.json +13 -0
- sverdrup-0.1.0/docs/superpowers/specs/2026-06-21-regatta-phase1-architecture-design.md +468 -0
- sverdrup-0.1.0/docs/superpowers/specs/2026-06-21-sverdrup-pypi-release-design.md +197 -0
- sverdrup-0.1.0/pixi.lock +15969 -0
- sverdrup-0.1.0/pixi.toml +161 -0
- sverdrup-0.1.0/pyproject.toml +110 -0
- sverdrup-0.1.0/src/sverdrup/__init__.py +0 -0
- sverdrup-0.1.0/src/sverdrup/__main__.py +49 -0
- sverdrup-0.1.0/src/sverdrup/_version.py +24 -0
- sverdrup-0.1.0/src/sverdrup/adapters/__init__.py +0 -0
- sverdrup-0.1.0/src/sverdrup/adapters/executor_dask.py +74 -0
- sverdrup-0.1.0/src/sverdrup/adapters/odc/__init__.py +0 -0
- sverdrup-0.1.0/src/sverdrup/adapters/odc/download.py +56 -0
- sverdrup-0.1.0/src/sverdrup/adapters/odc/fixtures.py +87 -0
- sverdrup-0.1.0/src/sverdrup/adapters/odc/natl60.py +29 -0
- sverdrup-0.1.0/src/sverdrup/adapters/odc/ose.py +31 -0
- sverdrup-0.1.0/src/sverdrup/adapters/storage_fsspec.py +128 -0
- sverdrup-0.1.0/src/sverdrup/application/__init__.py +0 -0
- sverdrup-0.1.0/src/sverdrup/application/config.py +24 -0
- sverdrup-0.1.0/src/sverdrup/application/pipeline.py +167 -0
- sverdrup-0.1.0/src/sverdrup/application/solve.py +152 -0
- sverdrup-0.1.0/src/sverdrup/application/splits.py +78 -0
- sverdrup-0.1.0/src/sverdrup/application/uow.py +28 -0
- sverdrup-0.1.0/src/sverdrup/core/__init__.py +0 -0
- sverdrup-0.1.0/src/sverdrup/core/derived.py +48 -0
- sverdrup-0.1.0/src/sverdrup/core/distribution.py +56 -0
- sverdrup-0.1.0/src/sverdrup/core/evaluation.py +84 -0
- sverdrup-0.1.0/src/sverdrup/core/grid.py +149 -0
- sverdrup-0.1.0/src/sverdrup/core/method.py +34 -0
- sverdrup-0.1.0/src/sverdrup/core/observations.py +153 -0
- sverdrup-0.1.0/src/sverdrup/core/parameters.py +60 -0
- sverdrup-0.1.0/src/sverdrup/core/ports.py +40 -0
- sverdrup-0.1.0/src/sverdrup/core/product.py +41 -0
- sverdrup-0.1.0/src/sverdrup/core/provenance.py +59 -0
- sverdrup-0.1.0/src/sverdrup/core/seeding.py +26 -0
- sverdrup-0.1.0/src/sverdrup/core/types.py +36 -0
- sverdrup-0.1.0/src/sverdrup/derived/__init__.py +0 -0
- sverdrup-0.1.0/src/sverdrup/derived/area_average.py +19 -0
- sverdrup-0.1.0/src/sverdrup/derived/eke.py +17 -0
- sverdrup-0.1.0/src/sverdrup/derived/firstdifference.py +113 -0
- sverdrup-0.1.0/src/sverdrup/derived/transport.py +17 -0
- sverdrup-0.1.0/src/sverdrup/derived/velocity.py +17 -0
- sverdrup-0.1.0/src/sverdrup/distributions/__init__.py +0 -0
- sverdrup-0.1.0/src/sverdrup/distributions/adapters.py +128 -0
- sverdrup-0.1.0/src/sverdrup/distributions/ensemble.py +59 -0
- sverdrup-0.1.0/src/sverdrup/distributions/gaussian.py +66 -0
- sverdrup-0.1.0/src/sverdrup/distributions/persisted.py +129 -0
- sverdrup-0.1.0/src/sverdrup/eval/__init__.py +0 -0
- sverdrup-0.1.0/src/sverdrup/eval/accuracy.py +31 -0
- sverdrup-0.1.0/src/sverdrup/eval/calibration.py +70 -0
- sverdrup-0.1.0/src/sverdrup/eval/groundtrack.py +35 -0
- sverdrup-0.1.0/src/sverdrup/methods/__init__.py +0 -0
- sverdrup-0.1.0/src/sverdrup/methods/kernel.py +55 -0
- sverdrup-0.1.0/src/sverdrup/methods/oi.py +129 -0
- sverdrup-0.1.0/src/sverdrup/methods/registry.py +8 -0
- sverdrup-0.1.0/src/sverdrup/methods/solver.py +71 -0
- sverdrup-0.1.0/src/sverdrup/methods/trivial.py +65 -0
- sverdrup-0.1.0/src/sverdrup/py.typed +0 -0
- sverdrup-0.1.0/tests/__init__.py +0 -0
- sverdrup-0.1.0/tests/fixtures/make_fixtures.py +41 -0
- sverdrup-0.1.0/tests/fixtures/natl60_ref_tiny.nc +0 -0
- sverdrup-0.1.0/tests/fixtures/natl60_tiny.nc +0 -0
- sverdrup-0.1.0/tests/fixtures/ose_tiny.nc +0 -0
- sverdrup-0.1.0/tests/integration/__init__.py +0 -0
- sverdrup-0.1.0/tests/integration/config_osse.json +15 -0
- sverdrup-0.1.0/tests/integration/test_cancellation.py +45 -0
- sverdrup-0.1.0/tests/integration/test_executor.py +48 -0
- sverdrup-0.1.0/tests/integration/test_solve_unit.py +77 -0
- sverdrup-0.1.0/tests/integration/test_storage.py +40 -0
- sverdrup-0.1.0/tests/integration/test_vertical_slice.py +58 -0
- sverdrup-0.1.0/tests/oracle/__init__.py +0 -0
- sverdrup-0.1.0/tests/oracle/conftest.py +33 -0
- sverdrup-0.1.0/tests/oracle/test_oi_oracle.py +54 -0
- sverdrup-0.1.0/tests/unit/__init__.py +0 -0
- sverdrup-0.1.0/tests/unit/_doubles.py +28 -0
- sverdrup-0.1.0/tests/unit/test_accuracy.py +17 -0
- sverdrup-0.1.0/tests/unit/test_adapters.py +57 -0
- sverdrup-0.1.0/tests/unit/test_calibration.py +32 -0
- sverdrup-0.1.0/tests/unit/test_datasource.py +24 -0
- sverdrup-0.1.0/tests/unit/test_derived_route.py +24 -0
- sverdrup-0.1.0/tests/unit/test_distributions.py +72 -0
- sverdrup-0.1.0/tests/unit/test_evaluation.py +31 -0
- sverdrup-0.1.0/tests/unit/test_firstdifference.py +44 -0
- sverdrup-0.1.0/tests/unit/test_grid.py +54 -0
- sverdrup-0.1.0/tests/unit/test_groundtrack.py +15 -0
- sverdrup-0.1.0/tests/unit/test_kernel.py +32 -0
- sverdrup-0.1.0/tests/unit/test_observations.py +51 -0
- sverdrup-0.1.0/tests/unit/test_oi.py +61 -0
- sverdrup-0.1.0/tests/unit/test_parameters.py +22 -0
- sverdrup-0.1.0/tests/unit/test_persisted.py +55 -0
- sverdrup-0.1.0/tests/unit/test_product.py +23 -0
- sverdrup-0.1.0/tests/unit/test_provenance.py +30 -0
- sverdrup-0.1.0/tests/unit/test_seeding.py +18 -0
- sverdrup-0.1.0/tests/unit/test_solver.py +24 -0
- sverdrup-0.1.0/tests/unit/test_splits.py +42 -0
- sverdrup-0.1.0/tests/unit/test_trivial.py +38 -0
- sverdrup-0.1.0/tests/unit/test_types.py +17 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Written in 2026 at JPL by Emmy Killett (she/her) and Claude Opus 4.7 adaptive (it/its).
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
input=$(cat)
|
|
6
|
+
transcript=$(echo "$input" | jq -r '.transcript_path')
|
|
7
|
+
|
|
8
|
+
# Prefer LOOP_ITERATION from the outer loop; fall back to next free number.
|
|
9
|
+
if [[ -n "${LOOP_ITERATION:-}" ]]; then
|
|
10
|
+
iter="$LOOP_ITERATION"
|
|
11
|
+
else
|
|
12
|
+
n=1
|
|
13
|
+
while [[ -e "PROGRESS$(printf '%03d' "$n").md" ]]; do ((n++)); done
|
|
14
|
+
iter=$(printf '%03d' "$n")
|
|
15
|
+
fi
|
|
16
|
+
outfile="PROGRESS${iter}.md"
|
|
17
|
+
|
|
18
|
+
# Headless sub-session generates the summary from the transcript.
|
|
19
|
+
# Timeout prevents indefinite hangs (rate limit, network failure, etc.).
|
|
20
|
+
if timeout 120 claude -p "Read the transcript JSONL at $transcript and write a \
|
|
21
|
+
concise progress report to $outfile in the current directory, covering: \
|
|
22
|
+
current task, completed work, pending work, files modified, and the \
|
|
23
|
+
exact next step to resume. Be specific enough that a fresh session can \
|
|
24
|
+
continue without re-reading the transcript." >/dev/null 2>&1 && [[ -s "$outfile" ]]; then
|
|
25
|
+
# Progress saved successfully — kill the outer session so the loop advances.
|
|
26
|
+
kill -TERM "$PPID" 2>/dev/null || true
|
|
27
|
+
echo "Threshold reached — progress saved to $outfile" >&2
|
|
28
|
+
exit 2
|
|
29
|
+
else
|
|
30
|
+
echo "WARNING: Failed to save progress to $outfile — letting Claude continue." >&2
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
with:
|
|
13
|
+
fetch-depth: 0 # hatch-vcs needs full history + tags
|
|
14
|
+
- uses: actions/setup-python@v5
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.12"
|
|
17
|
+
- name: Build
|
|
18
|
+
run: |
|
|
19
|
+
python -m pip install --upgrade build twine
|
|
20
|
+
python -m build
|
|
21
|
+
python -m twine check dist/*
|
|
22
|
+
- uses: actions/upload-artifact@v4
|
|
23
|
+
with:
|
|
24
|
+
name: dist
|
|
25
|
+
path: dist/
|
|
26
|
+
|
|
27
|
+
publish:
|
|
28
|
+
needs: build
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
environment: pypi
|
|
31
|
+
permissions:
|
|
32
|
+
id-token: write # OIDC for Trusted Publishing
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/download-artifact@v4
|
|
35
|
+
with:
|
|
36
|
+
name: dist
|
|
37
|
+
path: dist/
|
|
38
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Python bytecode
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Test / coverage / type caches
|
|
7
|
+
.coverage
|
|
8
|
+
.coverage.*
|
|
9
|
+
htmlcov/
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
.mypy_cache/
|
|
12
|
+
.ruff_cache/
|
|
13
|
+
|
|
14
|
+
# Build artefacts + generated version file
|
|
15
|
+
dist/
|
|
16
|
+
src/sverdrup/_version.py
|
|
17
|
+
|
|
18
|
+
# Secrets — never commit env files or cloud creds
|
|
19
|
+
.env
|
|
20
|
+
.env.*
|
|
21
|
+
!.env.example
|
|
22
|
+
*.pem
|
|
23
|
+
*.key
|
|
24
|
+
*-sa.json
|
|
25
|
+
|
|
26
|
+
# Editor / OS
|
|
27
|
+
.DS_Store
|
|
28
|
+
|
|
29
|
+
# Superpowers session state + logs
|
|
30
|
+
.superpowers/
|
|
31
|
+
*.log
|
|
32
|
+
|
|
33
|
+
# Project-local
|
|
34
|
+
.claude-project-id
|
|
35
|
+
.sandbox_settings.json
|
|
36
|
+
data/cache/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: local
|
|
3
|
+
hooks: # On macOS, pixi-installed tools (pytest, ruff, mypy) can fail due to shebang path resolution issues. Using python -m <tool> bypasses this reliably.
|
|
4
|
+
- id: ruff
|
|
5
|
+
name: ruff
|
|
6
|
+
entry: pixi run python -m ruff check --fix
|
|
7
|
+
language: system
|
|
8
|
+
types: [python]
|
|
9
|
+
- id: ruff-format
|
|
10
|
+
name: ruff-format
|
|
11
|
+
entry: pixi run python -m ruff format
|
|
12
|
+
language: system
|
|
13
|
+
types: [python]
|
|
14
|
+
- id: mypy
|
|
15
|
+
name: mypy
|
|
16
|
+
entry: pixi run python -m mypy .
|
|
17
|
+
language: system
|
|
18
|
+
types: [python]
|
|
19
|
+
pass_filenames: false
|
|
20
|
+
|
|
21
|
+
# Built-in pygrep — no remote pre-commit-hooks dep, no network.
|
|
22
|
+
# Real conflict markers: `<<<<<<< <ref>` and `>>>>>>> <ref>` (with
|
|
23
|
+
# trailing space) and `=======` *alone on a line*. The bare-`=======`
|
|
24
|
+
# form would otherwise false-positive on pytest's `======== … ========`
|
|
25
|
+
# header lines (>7 equals followed by text), so we anchor it $.
|
|
26
|
+
- id: check-merge-conflict
|
|
27
|
+
name: check-merge-conflict
|
|
28
|
+
entry: '^(<<<<<<< |>>>>>>> |={7}$)'
|
|
29
|
+
language: pygrep
|
|
30
|
+
|
|
31
|
+
# Local reimplementation of pre-commit-hooks' check-added-large-files
|
|
32
|
+
# (default maxkb=500 → 500000 bytes). System bash + wc only; bash's
|
|
33
|
+
# arithmetic context strips BSD-wc's leading whitespace so no tr needed.
|
|
34
|
+
- id: check-added-large-files
|
|
35
|
+
name: check-added-large-files (limit 500 KB)
|
|
36
|
+
entry: 'bash -c ''max=500000; rc=0; for f in "$@"; do sz=$(wc -c < "$f"); if (( sz > max )); then echo "$f: $sz bytes exceeds limit of $max" >&2; rc=1; fi; done; exit $rc'' --'
|
|
37
|
+
language: system
|
|
38
|
+
|
|
39
|
+
# Local reimplementation of pre-commit-hooks' check-toml. tomllib is
|
|
40
|
+
# stdlib in 3.11+; this template requires 3.12+. Routed through
|
|
41
|
+
# `pixi run python` so the env (and its Python) is the same one the
|
|
42
|
+
# other hooks use.
|
|
43
|
+
- id: check-toml
|
|
44
|
+
name: check-toml
|
|
45
|
+
entry: 'pixi run python -c ''import sys,tomllib;[tomllib.load(open(f,"rb")) for f in sys.argv[1:]]'''
|
|
46
|
+
language: system
|
|
47
|
+
types: [toml]
|
|
File without changes
|
sverdrup-0.1.0/CLAUDE.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Project: sverdrup
|
|
2
|
+
|
|
3
|
+
## Session resume protocol (read this first, every session)
|
|
4
|
+
This project may be built across multiple sessions, and a session can die
|
|
5
|
+
mid-run. On **every** new or resumed session, before doing anything else:
|
|
6
|
+
|
|
7
|
+
1. Read `PROGRESS.md` at the repo root. It carries the index of the current
|
|
8
|
+
active work AND the project's running notebook of deferred items,
|
|
9
|
+
cross-cutting decisions, gotchas, and open questions. Read all of it.
|
|
10
|
+
2. Open the design doc and implementation plan that `PROGRESS.md` points to.
|
|
11
|
+
3. Run `git log --oneline -20` to see what is already committed.
|
|
12
|
+
4. Resume from the first unchecked task in the plan. **Do not** redo work
|
|
13
|
+
that is already committed.
|
|
14
|
+
|
|
15
|
+
If `PROGRESS.md` does not exist yet, you are at the very start of the
|
|
16
|
+
project; create it (with the headings described in the Durability rules
|
|
17
|
+
below, sections initially empty) as soon as a design or plan exists.
|
|
18
|
+
|
|
19
|
+
If Superpowers is installed and this project uses it, prefer its native
|
|
20
|
+
resume mechanism (`/superpowers-extended-cc:executing-plans <plan-path>`)
|
|
21
|
+
over reading `PROGRESS.md`'s **Current work** section by hand — that
|
|
22
|
+
command reads the plan's `.tasks.json` and picks up exactly where the
|
|
23
|
+
last session stopped. The other PROGRESS.md sections (deferred items,
|
|
24
|
+
decisions, gotchas, open questions) are NOT covered by Superpowers, so
|
|
25
|
+
read them either way.
|
|
26
|
+
|
|
27
|
+
## Durability rules (always)
|
|
28
|
+
- **Git is the source of truth, not the conversation.** Commit after every
|
|
29
|
+
completed task, with a clear message. Never end a step with completed
|
|
30
|
+
work left uncommitted.
|
|
31
|
+
- **Keep `PROGRESS.md` current.** The **Current work** block is an index
|
|
32
|
+
— point at the design doc, plan, and task tracker; do NOT duplicate the
|
|
33
|
+
task checklist into PROGRESS.md (link to the plan instead, so there's
|
|
34
|
+
one place to update task state). The other sections (deferred items,
|
|
35
|
+
cross-cutting decisions, gotchas, open questions) hold canonical content
|
|
36
|
+
that lives nowhere else; add to them as the project teaches you things
|
|
37
|
+
worth not forgetting. Refresh the "next action" line and commit
|
|
38
|
+
PROGRESS.md after each task.
|
|
39
|
+
- **Persist the brainstorm as it forms.** During brainstorming, append
|
|
40
|
+
each validated design section to the design doc and commit it — never
|
|
41
|
+
leave the agreed design only in the conversation.
|
|
42
|
+
- **Migrate, don't duplicate.** When a deferred item or open question
|
|
43
|
+
becomes active work, move it out of PROGRESS.md into the new design/plan
|
|
44
|
+
rather than leaving a copy behind.
|
|
45
|
+
|
|
46
|
+
## Environment & tools
|
|
47
|
+
|
|
48
|
+
- Use `rg` instead of `grep`, `fd` instead of `find`.
|
|
49
|
+
|
|
50
|
+
## Workspace scaffolding
|
|
51
|
+
|
|
52
|
+
This project has already been scaffolded. The following files
|
|
53
|
+
already exist and should NOT be recreated:
|
|
54
|
+
|
|
55
|
+
- `pyproject.toml` — project metadata + ruff/mypy/pytest/coverage config
|
|
56
|
+
- `pixi.toml` — pixi workspace with dev dependencies (ruff, mypy, pytest, pytest-cov, pre-commit)
|
|
57
|
+
- `.pre-commit-config.yaml` — pre-commit hooks (ruff, ruff-format, mypy, trailing-whitespace, end-of-file-fixer, etc.)
|
|
58
|
+
- `.gitignore` — standard Python ignores
|
|
59
|
+
|
|
60
|
+
**Do NOT run `pixi init` or `pre-commit sample-config`.**
|
|
61
|
+
|
|
62
|
+
## Project layout
|
|
63
|
+
|
|
64
|
+
Use a `src/` layout:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
src/
|
|
68
|
+
<package_name>/
|
|
69
|
+
__init__.py
|
|
70
|
+
__main__.py
|
|
71
|
+
...
|
|
72
|
+
tests/
|
|
73
|
+
__init__.py
|
|
74
|
+
test_*.py
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The package name should be the project name normalized to a valid Python identifier
|
|
78
|
+
(lowercase, spaces/hyphens replaced with underscores).
|
|
79
|
+
|
|
80
|
+
## Running tools
|
|
81
|
+
|
|
82
|
+
All dev tools are installed via pixi. Use `pixi run` to invoke them:
|
|
83
|
+
|
|
84
|
+
- `pixi run test` — run tests (pytest)
|
|
85
|
+
- `pixi run lint` — lint (ruff check .)
|
|
86
|
+
- `pixi run format` — format (ruff format .)
|
|
87
|
+
- `pixi run typecheck` — type check (mypy .)
|
|
88
|
+
- `pixi run pre-commit run` — run pre-commit on staged files
|
|
89
|
+
- `pixi run pre-commit run --files <path>` — run pre-commit on specific files
|
|
90
|
+
- `pixi run pre-commit run --all-files` — run pre-commit on every file
|
|
91
|
+
- `pixi run pre-commit install` — install the git pre-commit hook
|
|
92
|
+
(`pre-commit` is only available via `pixi run` — no system binary)
|
|
93
|
+
|
|
94
|
+
To add a new dependency: `pixi add <package>`
|
|
95
|
+
To add a PyPI-only dependency: `pixi add --pypi <package>`
|
|
96
|
+
|
|
97
|
+
## Cross-platform conda gotchas
|
|
98
|
+
|
|
99
|
+
This project's `pixi.toml` lists `platforms = ["linux-64", "osx-arm64", "osx-64"]`,
|
|
100
|
+
so `pixi install` must solve cleanly on macOS even when the actual run happens in
|
|
101
|
+
the Linux container. Some conda-forge packages have no `osx-arm64` build and will
|
|
102
|
+
fail resolution on macOS with `No candidates were found`. Move them into
|
|
103
|
+
`[target.linux-64.dependencies]` (already scaffolded into your `pixi.toml`)
|
|
104
|
+
instead of `[dependencies]`.
|
|
105
|
+
|
|
106
|
+
Symptom: `pixi add <pkg>` (or `pixi install`) fails with
|
|
107
|
+
`No candidates were found for <pkg>` while the package clearly exists on
|
|
108
|
+
conda-forge for linux-64.
|
|
109
|
+
|
|
110
|
+
Fix: edit `pixi.toml` to add the package under `[target.linux-64.dependencies]`,
|
|
111
|
+
then `pixi install`. Or use `pixi add --platform linux-64 <pkg>`.
|
|
112
|
+
|
|
113
|
+
Known offenders (non-exhaustive):
|
|
114
|
+
|
|
115
|
+
- `pngquant` — pulled in by `ocrmypdf`; together they force linux-64-only.
|
|
116
|
+
- `pytorch-cuda` — CUDA runtime, linux-only by design.
|
|
117
|
+
|
|
118
|
+
If you can swap to a lighter cross-platform alternative, prefer that
|
|
119
|
+
(e.g. `tesseract` + `pytesseract` + `pypdfium2` instead of `ocrmypdf`).
|
|
120
|
+
|
|
121
|
+
## First-time setup
|
|
122
|
+
|
|
123
|
+
Already done by the container entrypoint — git repo
|
|
124
|
+
initialized, git identity configured, dependencies
|
|
125
|
+
installed, pre-commit hooks active, initial scaffold
|
|
126
|
+
committed.
|
sverdrup-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
sverdrup-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sverdrup
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Regional sea-surface-height-anomaly reconstruction with first-class predictive uncertainty
|
|
5
|
+
Project-URL: Homepage, https://github.com/killett/sverdrup
|
|
6
|
+
Project-URL: Repository, https://github.com/killett/sverdrup
|
|
7
|
+
Project-URL: Issues, https://github.com/killett/sverdrup/issues
|
|
8
|
+
Author-email: Emmy Killett <emmykillett@gmail.com>
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: gaussian process,oceanography,optimal interpolation,sea surface height,uncertainty quantification
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Python: <3.14,>=3.12
|
|
21
|
+
Requires-Dist: numpy>=1.26
|
|
22
|
+
Requires-Dist: pyproj>=3.6
|
|
23
|
+
Requires-Dist: scipy>=1.11
|
|
24
|
+
Provides-Extra: all
|
|
25
|
+
Requires-Dist: dask[distributed]>=2024.1; extra == 'all'
|
|
26
|
+
Requires-Dist: fsspec>=2024.1; extra == 'all'
|
|
27
|
+
Requires-Dist: netcdf4>=1.6; extra == 'all'
|
|
28
|
+
Requires-Dist: requests>=2.31; extra == 'all'
|
|
29
|
+
Requires-Dist: tenacity>=8.2; extra == 'all'
|
|
30
|
+
Requires-Dist: xarray>=2024.1; extra == 'all'
|
|
31
|
+
Provides-Extra: dask
|
|
32
|
+
Requires-Dist: dask[distributed]>=2024.1; extra == 'dask'
|
|
33
|
+
Provides-Extra: io
|
|
34
|
+
Requires-Dist: fsspec>=2024.1; extra == 'io'
|
|
35
|
+
Requires-Dist: netcdf4>=1.6; extra == 'io'
|
|
36
|
+
Requires-Dist: requests>=2.31; extra == 'io'
|
|
37
|
+
Requires-Dist: tenacity>=8.2; extra == 'io'
|
|
38
|
+
Requires-Dist: xarray>=2024.1; extra == 'io'
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
|
|
41
|
+
# sverdrup
|
|
42
|
+
|
|
43
|
+
A regional SSHA (sea-surface-height anomaly) reconstruction framework with first-class,
|
|
44
|
+
rigorous predictive-distribution uncertainty. Phase 1 wires a single space-time tile
|
|
45
|
+
end-to-end (OSSE + OSE) through a hexagonal stack: a hand-rolled dense space-time GP / optimal
|
|
46
|
+
interpolation exposes native covariance and whole-field samples behind a `CovarianceOperator`
|
|
47
|
+
seam, and each unit of work returns a *Persisted* `Product` bundle (mean + exact marginal
|
|
48
|
+
variance + low-rank factor + clipped diagonal residual + eval-point predictions) reduced
|
|
49
|
+
on-worker while the exact operator is still live.
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
Dependencies are managed with [pixi](https://pixi.sh):
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
pixi install
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Quick usage
|
|
60
|
+
|
|
61
|
+
Run a config-driven pipeline over a regional tile (OSSE on the committed fixtures):
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
pixi run python -m sverdrup tests/integration/config_osse.json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
This windows the observations, dispatches the solve through a `dask.distributed` LocalCluster,
|
|
68
|
+
writes the persisted `Product` to an fsspec URL, and prints evaluator scores (RMSE vs truth,
|
|
69
|
+
calibration, ground-track power).
|
|
70
|
+
|
|
71
|
+
Programmatically:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from sverdrup.adapters.odc.fixtures import FixtureSource
|
|
75
|
+
from sverdrup.application.pipeline import PipelineInputs, run_pipeline
|
|
76
|
+
|
|
77
|
+
src = FixtureSource("tests/fixtures/natl60_tiny.nc", ref_path="tests/fixtures/natl60_ref_tiny.nc")
|
|
78
|
+
product, scores = run_pipeline(PipelineInputs(
|
|
79
|
+
mode="OSSE", method_name="oi", source=src, out_url="file:///tmp/osse.zarr",
|
|
80
|
+
lon_range=(-64, -56), lat_range=(34, 42), time_range=(0, 5), output_times=[2.0],
|
|
81
|
+
params={"length_scale": 300.0, "time_scale": 10.0, "variance": 0.05},
|
|
82
|
+
))
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Common tasks
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
pixi run test # pytest (the opt-in oracle is skipped without SVERDRUP_ODC_DATA)
|
|
89
|
+
pixi run lint # ruff check
|
|
90
|
+
pixi run format # ruff format
|
|
91
|
+
pixi run typecheck # mypy
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The correctness oracle (reproducing the ODC OI leaderboard number) is opt-in — see
|
|
95
|
+
[`docs/oracle-runbook.md`](docs/oracle-runbook.md).
|
|
96
|
+
|
|
97
|
+
## Releasing
|
|
98
|
+
|
|
99
|
+
Publishing to PyPI is automated via GitHub Actions Trusted Publishing on tag push. The
|
|
100
|
+
workflow lives at `docs/superpowers/ci/release.yml`; copy it to `.github/workflows/release.yml`
|
|
101
|
+
in the GitHub repo (a one-time step — the local tooling token cannot push workflow files).
|
|
102
|
+
Configure the PyPI trusted publisher (project `sverdrup`, owner `killett`, repo `sverdrup`,
|
|
103
|
+
workflow `release.yml`, environment `pypi`), then `git tag -a vX.Y.Z -m "..." && git push origin vX.Y.Z`.
|
|
104
|
+
|
|
105
|
+
## Project structure
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
src/sverdrup/
|
|
109
|
+
core/ # pure protocols + value objects (grid, types, distribution, product, ports, ...)
|
|
110
|
+
distributions/ # Gaussian / Ensemble / Persisted distributions + lifting adapters
|
|
111
|
+
methods/ # space-time Matern-3/2 kernel, Cholesky solver, GP/OI (Method 1), trivial (Method 0)
|
|
112
|
+
derived/ # CRS-aware first-difference (real) + committed stubs
|
|
113
|
+
eval/ # accuracy, calibration (+ polar-void), ground-track evaluators
|
|
114
|
+
adapters/ # dask executor, fsspec result sink, ODC data sources + fixtures
|
|
115
|
+
application/ # unit of work, solve_unit, splits, run config, end-to-end pipeline
|
|
116
|
+
tests/ # unit, integration, oracle; tiny committed NetCDF fixtures
|
|
117
|
+
docs/ # architecture design, implementation plan, oracle runbook
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
See `PROGRESS.md` for the running project notebook (decisions, gotchas, deviations).
|