feat: drainage area validation with ABS_DIFF metric and gage filtering#124
Merged
taddyb merged 5 commits intoDeepGroundwater:masterfrom Feb 8, 2026
Merged
feat: drainage area validation with ABS_DIFF metric and gage filtering#124taddyb merged 5 commits intoDeepGroundwater:masterfrom
taddyb merged 5 commits intoDeepGroundwater:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ABS_DIFF) metric to gage reference files — scales correctly across basin sizes unlikePCT_DIFF/REL_ERR(e.g. 4 km² vs 8 km² is 100% relative error but only 4 km² absolute difference)COMID_UNITAREA_SQKMcolumn to all gage CSVs (preparation for future Q' scaling of mid-COMID gages)max_area_diff_sqkmconfig threshold (ExperimentConfig) to filter spatially misaligned gages from training/evaluationfilter_gages_by_area_threshold()pure function inreaders.py, integrated intoMeritandLynkerHydrofabricgeodataset initread_gage_info()to return optional columns (COMID,COMID_DRAIN_SQKM,ABS_DIFF,COMID_UNITAREA_SQKM) when present in CSVdhbv2_gages.csvcolumns to match GAGES-II format via newpatch_dhbv2_gages.pyscriptFiles changed
build_gage_references.pyunitareain spatial join,ABS_DIFFin error metrics, updatedOUTPUT_COLUMNSGAGES-II.csv,camels_670.csv,gages_3000.csv,dhbv2_gages.csvABS_DIFFandCOMID_UNITAREA_SQKMcolumnspatch_dhbv2_gages.pyreaders.pyread_gage_info(), newfilter_gages_by_area_threshold()configs.pymax_area_diff_sqkmfield onExperimentConfig(default 50 km²)merit.py,lynker_hydrofabric.py_init_training()and_init_inference()Test plan
pytest tests/io/test_readers.py— 14 tests (3 optional columns + 6 filter function + existing)pytest tests/validation/test_configs.py— 3 new threshold tests + existingpytest tests/references/test_build_gage_references.py— 4 tests forcompute_error_metrics()pytest tests/— full suite: 354 passed, 1 skipped, 0 failurespre-commit run --all-files— passes (remaining mypy errors are pre-existingMockGaugeSetissues)🤖 Generated with Claude Code