Geometry predictor script with global KAN + slope floor fix#184
Merged
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
scripts/geometry_predictor.py— Hydra script that predicts KAN parameters (n, p, q) for all 2.9M global MERIT reaches and computes trapezoidal geometry statistics (min/max/median/mean for depth, top_width, bottom_width, side_slope, hydraulic_radius, discharge) for 346K CONUS reaches with streamflow data. Non-CONUS reaches get KAN params with NaN geometry stats.src/ddr/geometry/statistics.py— Purecompute_geometry_statistics()function (no I/O) that takes KAN params + daily accumulated discharge and returns per-reach temporal statistics.configs.py,predictor.py, and all test fixtures. Model will need retraining with the new floor.geometry_predictor.ipynbandplot_parameter_map.ipynbare now thin consumers that load the script's.ncoutput and plot. All inline routing code removed.config/merit_geometry_config.yaml— Hydra config for WY2000 (1999/10/01–2000/09/30) with 30-day batches.Files changed
scripts/geometry_predictor.pysrc/ddr/geometry/statistics.pysrc/ddr/geometry/__init__.pycompute_geometry_statisticssrc/ddr/validation/configs.pysrc/ddr/geometry/predictor.pyconfig/merit_geometry_config.yamlexamples/merit/geometry_predictor.ipynbexamples/merit/plot_parameter_map.ipynbtests/geometry/test_geometry_stats.pytests/geometry/test_predictor.pytests/routing/test_utils.pytests/validation/test_configs.pytests/benchmarks/conftest.pyTest plan
uv run pytest tests/geometry/test_geometry_stats.py— 4 passuv run pytest tests/geometry/ tests/validation/test_configs.py tests/routing/test_utils.py— 53 pass🤖 Generated with Claude Code