feat(esm-tools-plus/simcat): add esm_catalog — STAC-based experiment catalog#1473
feat(esm-tools-plus/simcat): add esm_catalog — STAC-based experiment catalog#1473siligam wants to merge 2 commits into
Conversation
… for ESM-Tools Introduces the esm_catalog package as part of the ESM-Tools-plus/simcat initiative. Provides a DuckDB-backed STAC API, scanner, CLI, and MCP server for cataloguing and querying climate model experiment output. See src/esm_catalog/ARCHITECTURE.md for design overview. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move catalog deps (duckdb, pyarrow, pystac, shapely, cfgrib, etc.)
to extras_require["catalog"] to fix pip install in CI
- Add from __future__ import annotations for Python 3.8 compatibility
- Guard duckdb import with try/except for optional install
- Exclude src/esm_catalog and src/esm_viz from pytest auto-discovery
- Fix esm_motd _get_real_dir_from_pth_file("") crash with try/except
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
I don't think I can review 32k lines of code. ESM-Tools is a ~85k line code itself. @siligam, does it really need to be so huge? The issue is not only review time but also maintainability. I would expect that this PR does "just" a few things:
Can you attempt to break it down into much smaller units? That would help me learning the code but also would probably also improve integration and structure. |
Design for reintroducing esm_catalog to release as a dependency-ordered stack of small, reviewable PRs (responding to review feedback on #1473). Rebuild-from-end-state; opening PRs mirror scan->shard->sync; MCP dropped. Covers all three parallel workstreams: esm_catalog (#1473), esm_viz (#1474), and the stac-browser fork. esm_catalog API core is the critical path; esm_viz and the browser UI run as parallel tracks off it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@mandresm — you're right, and thanks for the push-back. 32k lines in one commit isn't a fair ask. We've stepped back and written a decomposition plan that reintroduces
…then the STAC API serve layer ( Full plan: 2026-06-13-esm-catalog-pr-decomposition-design.md Converting this PR to draft — it'll be superseded by the sliced stack, which I'll open shortly, and closed once the first sliced PR is up. |
|
First two slices are up, @mandresm:
Suggest reviewing #1483 first (trivial), then #1484. This PR stays as a draft reference until the sliced stack lands, then I'll close it. |
Context
Part of the ESM-Tools-plus/simcat initiative, which adds a STAC-based experiment catalog to ESM-Tools for indexing, querying and browsing climate model output.
This PR introduces
esm_catalog— the catalog API, scanner, and CLI.A companion PR adds
esm_viz— the visualization service.What's included
src/esm_catalog/— the package (108 files, ~32k lines)api/scan/stac/storage/hpc/integration/mcp/cli.pyesm-catalogCLI (scan, serve, mcp, reindex, …)STAC extensions defined:
hpc— HPC system name on assets (hpc:system)namelist— F90 namelist parameters (nml:*)paleo— deep-time metadata (paleo:years_bp)datacube— variable/dimension axescontacts— experiment owner infoAPI highlights:
GET /collections— all experiments, filterable via CQL2GET /experiments— experiment-level search with CQL2 (component=,variable=,nml:radctl.co2vmr > 284)GET /search— STAC item searchGET /queryables— OGC queryables for browser filter UIGET /paleo-presets— named paleo time periods (LGM, mid-Holocene, …)GET /collections/{id}/nml-parameters— namelist params for an experiment/personal/…)/catalogs) + web admin UI at/uiOption A catalog layout (current): one STAC Collection per experiment, components stored as item properties (
properties.component), enabling cross-component queries without per-component collection proliferation.tests/test_esm_catalog/— test suite~4000 lines covering API, CLI, storage, scanning, personal collections, integration, HPC detection, and STAC object construction.
Shared infrastructure (also in this PR)
pixi.toml/pixi.locksetup.py.github/workflows/docker-esm-catalog.ymldocs/esm_catalog_*.rstexamples/fesom_stac/examples/echam_grib/examples/notebooks/utils/Key design decisions
Test plan
pixi run pytest tests/test_esm_catalog/passesesm-catalog scan --helpandesm-catalog serve --helprun without erroresm-catalog scan <experiment_path>produces acatalog.duckdbesm-catalog serve --catalog catalog.duckdbservesGET /collectionsandGET /searchGET /queryablesreturns variables, components, experiment types?filter=variable='sst'returns only SST items🤖 Generated with Claude Code