Skip to content

feat(esm_catalog): PR-B3 — experiment hierarchy routes + paleo presets#1492

Open
siligam wants to merge 1 commit into
esm-catalog/pr-b2-queryablesfrom
esm-catalog/pr-b3-science-routes
Open

feat(esm_catalog): PR-B3 — experiment hierarchy routes + paleo presets#1492
siligam wants to merge 1 commit into
esm-catalog/pr-b2-queryablesfrom
esm-catalog/pr-b3-science-routes

Conversation

@siligam

@siligam siligam commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Provenance: api/paleo_presets.py is ported from Paul Gierz's esm-tools-plus/simcat/pgierz-workbench prototype branch; api/experiment_routes.py is new for this decomposition.

  • api/experiment_routes.py: GET /experiments (list with CQL2 filter support), GET /experiments/{id} (STAC Catalog object), GET /collections/{id}/experiment (shortcut from collection to parent experiment)
  • api/paleo_presets.py: in-memory DuckDB table of 9 built-in paleo periods (LGM, Mid-Holocene, Eemian, etc.); POST /paleo-presets to add custom presets, DELETE /paleo-presets/{id} for user-added presets only
  • Adapted from source: removed paleodatetime dependency (not in project requirements); fixed DuckDB rowcount bug (always returns -1 on DELETE — now checks existence before delete)
  • 12 new tests (113 total); no new dependencies

Test plan

  • CI green on 3.9 + 3.12
  • GET /experiments → list with numberMatched
  • GET /experiments/{id}{"type": "Catalog", ...}
  • GET /collections/{id}/experiment → parent experiment catalog
  • GET /paleo-presets → list including lgm
  • Add + delete custom preset roundtrip
  • Delete built-in preset → 404

🤖 Generated with Claude Code

@siligam
siligam force-pushed the esm-catalog/pr-b2-queryables branch from e061a3b to 4a672c8 Compare June 17, 2026 12:13
@siligam
siligam force-pushed the esm-catalog/pr-b3-science-routes branch from ef49a03 to 95043cd Compare June 17, 2026 12:13
@siligam
siligam force-pushed the esm-catalog/pr-b2-queryables branch from 4a672c8 to 57699a2 Compare June 17, 2026 15:59
@siligam
siligam force-pushed the esm-catalog/pr-b3-science-routes branch from 95043cd to 67fee03 Compare June 17, 2026 16:00
@siligam
siligam force-pushed the esm-catalog/pr-b2-queryables branch from 57699a2 to ad0c766 Compare June 17, 2026 16:34
@siligam
siligam force-pushed the esm-catalog/pr-b3-science-routes branch from 67fee03 to 76f4e7a Compare June 17, 2026 16:34
Adds science-domain API routes:
- api/experiment_routes.py: GET /experiments (list with CQL2 filter),
  GET /experiments/{id} (STAC Catalog), GET /collections/{id}/experiment (shortcut)
- api/paleo_presets.py: in-memory DuckDB table of paleo time periods;
  adapted to drop paleodatetime dep (not in project requirements); DuckDB
  rowcount=-1 workaround (check existence before DELETE)
- api/app.py: wires experiment routers + GET/POST/DELETE /paleo-presets endpoints
- 12 new tests (113 total); no new dependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@siligam
siligam force-pushed the esm-catalog/pr-b2-queryables branch from ad0c766 to aa0bcc5 Compare June 17, 2026 17:03
@siligam
siligam force-pushed the esm-catalog/pr-b3-science-routes branch from 76f4e7a to 61e2fab Compare June 17, 2026 17:03
@siligam

siligam commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the corrected PR-0 base (#1483) — test relocation to tests/test_esm_catalog/, restored dedicated CI workflow at the new path, and a couple of CI fixes (doctest-collection exclusion, eval_type_backport for pydantic on Python 3.9). No change to this PR's own diff/scope. CI is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant