Skip to content

Add major-chemistry data product (one feature per well) - #81

Merged
jirhiker merged 1 commit into
mainfrom
feature/major-chemistry-product
Jun 26, 2026
Merged

Add major-chemistry data product (one feature per well)#81
jirhiker merged 1 commit into
mainfrom
feature/major-chemistry-product

Conversation

@jirhiker

Copy link
Copy Markdown
Member

What

New ogc_major_chemistry product — nm_major_chemistry. Produces one GeoJSON feature per well, with each major-ion analyte's latest value, units, and date plus well depth stored as feature properties.

Major-ion suite (classic 8): calcium, magnesium, sodium, potassium, bicarbonate, carbonate, chloride, sulfate.

How it fits the per-source asset graph

Same sources → combine → geoserver shape as other products, with two extensions:

  • Multi-analyte source assets. Products now unify over a list of parameters. Single-parameter products run once (unchanged); the major-chemistry product runs unification once per analyte in each source asset and accumulates the summary records (analyte identity lives in each record's parameter_name). Source keys for the product = the union of the analytes' agencies.
  • Pivot dumper. dump_major_chemistry_collection groups per-(well, analyte) SummaryRecords by (source, id) into one feature per well: <analyte>, <analyte>_units, <analyte>_date properties, plus well_depth/well_depth_units and point geometry.

Changes

  • backend/persisters/ogc_features.py: dump_major_chemistry_collection.
  • orchestration/assets/products.py: _MAJOR_CHEMISTRY, _product_params, union source-keys, multi-param source asset, output-type-based dumper selection.
  • orchestration/resources/die_config.py: optional parameter override; treat ogc_major_chemistry as summary mode.
  • orchestration/definitions.py: register ogc_major_chemistry (auto-gets its own job + schedule).
  • orchestration/config/products.yaml: nm_major_chemistry (all NM sources, daily 11:00).
  • tests/test_persisters/test_ogc_features.py: pivot + geometry/required-field coverage.

Notes for reviewer

  • Verified: dg check defs loads all defs; the product expands to 5 source assets (bor, nmbgmr_amp, nmed_dwb, nmose_isc_seven_rivers, wqp) → combine → geoserver, plus nm_major_chemistry_job. 11 persister tests pass.
  • A source that doesn't provide a given analyte is skipped (source_pair → None), so missing analytes simply don't appear in a well's properties.
  • Branched off main; independent of the open docs PR Improve in-code documentation for product asset graph #80 (no overlap beyond files both touch — this branch carries its own coherent versions).

🤖 Generated with Claude Code

New ogc_major_chemistry product: nm_major_chemistry. One GeoJSON feature
per well, with each major-ion analyte's latest value/units/date plus
well depth as properties.

- backend/persisters/ogc_features.py: dump_major_chemistry_collection
  pivots per-(well,analyte) SummaryRecords into one feature per well,
  keyed (source, id); carries well_depth and geometry.
- orchestration/assets/products.py: _MAJOR_CHEMISTRY (classic 8 major
  ions); products now unify over a list of parameters (single-parameter
  products run once, major-chemistry runs once per analyte and
  accumulates); source keys = union of the analytes' agencies; combine
  picks the dumper by output_type.
- die_config.get_config: optional parameter override; treat
  ogc_major_chemistry as summary mode.
- definitions.py: register ogc_major_chemistry as a supported output type
  (gets its own per-product job + schedule automatically).
- products.yaml: nm_major_chemistry entry (all NM sources).
- tests: pivot + geometry/required-field coverage for the new dumper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

Your pull request is automatically being deployed to Dagster Cloud.

Location Status Link Updated
die-orchestration View in Cloud Jun 26, 2026 at 03:22 PM (UTC)

@jirhiker
jirhiker merged commit 73eca0f into main Jun 26, 2026
3 checks passed
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