Skip to content

Development

./scripts/setup.sh          # set up the environment
uv run pytest               # tests
uv run ruff check . && uv run ruff format --check .
uv run mypy
uv run --only-group docs mkdocs build --strict   # the docs site, as CI builds it
uv run --env-file .env_hcho --env-file .env.local cdk synth   # review infrastructure before deploying
uv run --env-file .env_hcho --env-file .env.local cdk deploy

The Processor class in virtualizarr_processor/processor.py is the sole implementation. The template's synthetic reference implementation lives on as tests/stub_processor.py and still exercises the generic fork/merge mechanics.

Scripts

scripts/ holds the production tooling. The operating pages and runbooks say when to run each one. Run the Python scripts with uv run scripts/<script>.py from the project environment.

Script Purpose
setup.sh install the uv environment, Node, and the cdk CLI
run_codebuild.sh run an in-region job in the stack's CodeBuild project: inventory build, stamp recording (-R), or verification (-V)
build_backfill_inventory.py build the backfill inventory (Backfill inventory)
start_backfill.sh start the backfill Step Functions execution
verify_store.py spot-check the store against CMR and the source granules
check_virtual_containers.py check that a store's virtual chunk containers cover its references, and fix the config with --fix
generate_template.py regenerate the store template and reference coordinate arrays
measure_publish_order.py measure CMR publication order and production lag
mirror_to_source_coop.py copy a store to Source Cooperative
compare_to_gibs.py render a scan from the public copy beside the GIBS image for the same scan, as a visual check
record_stamps.py and relativize_refs.py one-time migration to relative references (runbook)
rewrite_manifests.py one-time migration that re-splits the chunk manifests of a store backfilled before manifest splitting was configured
smoke_test_lambda_images.sh build each Lambda image and import its handlers in the runtime image, to catch packaging errors before a deploy
check_env_hygiene.sh the pre-commit check that keeps local-only values out of tracked env files

Exploration

exploration/ holds standalone PEP 723 scripts used to characterize the source data and to build test stores. Run them with uv run exploration/<script>.py. All take --collection {hcho,no2} (default hcho) plus --concept-id for any other collection, and need Earthdata Login credentials in ~/.netrc.

  • tempo_dataset_info.py: CMR/UMM-C collection report with extents, granule count, distribution info, and the most recent granule.
  • inspect_granule_metadata.py: HDF5 structure dump of granules (chunk layouts, codecs, fill values, attributes) and a cross-granule comparison of what varies.
  • combine_twenty_spread_virtual.py: virtualizes N granules spread across the collection's temporal extent, combines them in an in-memory Icechunk store, and reads data back to prove the path end to end.
  • build_titiler_test_store.py: small local store (12 recent granules) for titiler-multidim smoke tests.
  • build_s3_test_store.py: realistic S3-hosted store (100 recent granules, credential-less virtual chunk container). Run it on in-region compute.

titiler-multidim smoke test takeaways (2026-08-06)

A 12-granule store per collection was served through titiler-multidim's feat/http-virtual-chunk-auth branch. All checked endpoints (/variables, /info, /tiles, /point) passed for both collections. What carries forward:

  • Flat-at-root layout is required. titiler-xarray does not walk nested groups or resolve group-inherited coordinates. The production stores use it.
  • Clients must always select a time step (sel=time=...&sel_method=nearest). A multi-time variable reaching the renderer fails with "Source data must be 1 band".
  • Tile latency is dominated by per-request virtual-chunk fetches and scales with the area a tile covers. z2 tiles took 3 to 7 s, and z4/z6 tiles 1.5 to 2.7 s over HTTPS. A dataset/session cache is advisable in production, and Lambda's 1024 file-descriptor limit is a real constraint under tile bursts.
  • Per-scan coverage is inherently partial: single east-west scans, daylight-only retrieval, occasional short rapid-scan slices. Portal time sliders and "latest available" defaults need to account for it.
  • Map clients should set noWrap and maxBounds. Tiles crossing ±180 hit an antimeridian error upstream in rio-tiler.
  • CMR publication behavior shaped the forward-processing design. The publication-order and lag figures quoted under Forward processing came from an August 2026 14-day window, with the historical archive back-filling at about 1,000 granules per week.