Skip to content

Add GeometryPredictor example notebook and fix NaN handling#183

Merged
taddyb merged 4 commits into
DeepGroundwater:masterfrom
taddyb:feat/notebook
Apr 2, 2026
Merged

Add GeometryPredictor example notebook and fix NaN handling#183
taddyb merged 4 commits into
DeepGroundwater:masterfrom
taddyb:feat/notebook

Conversation

@taddyb
Copy link
Copy Markdown
Collaborator

@taddyb taddyb commented Apr 1, 2026

Summary

  • Adds geometry_predictor.ipynb example notebook demonstrating standalone channel geometry prediction from a trained KAN — loads checkpoint, predicts on all 346K CONUS MERIT reaches, visualizes learned parameters (n, p, q), geometry scaling with discharge, and Leopold & Maddock power law
  • Bundles trained v0.5.2 weights with learned p_spatial and a geometry_config.yaml so the notebook is self-contained
  • Fixes three bugs in GeometryPredictor.from_checkpoint: mode enum typo ("route""routing"), checkpoint path not resolved before Pydantic validation, and NaN attributes propagating through the KAN instead of being filled with training mean
  • Updates plot_parameter_map.ipynb to write plots to a plots/ subdirectory

Test plan

  • 35 geometry unit tests pass
  • geometry_predictor.ipynb executes end-to-end via nbconvert with zero NaN outputs across all 346K reaches
  • All pre-commit hooks pass (ruff, mypy, nbstripout)
  • Verify plot_parameter_map.ipynb saves to plots/ when run interactively

🤖 Generated with Claude Code

taddyb added 4 commits March 31, 2026 21:22
- Add geometry_predictor.ipynb example notebook demonstrating
  GeometryPredictor with trained KAN on CONUS MERIT reaches
- Add v0.5.2 trained weights (n, q_spatial, p_spatial learned)
  and geometry_config.yaml for the notebook
- Fix GeometryPredictor.from_checkpoint: resolve checkpoint path
  before config validation, fix mode enum ("route" -> "routing")
- Fill NaN attributes with training mean in _prepare_attributes,
  matching the geodataset loader behavior
- Update plot_parameter_map.ipynb to save plots to plots/ directory
@taddyb taddyb merged commit 6fd0f74 into DeepGroundwater:master Apr 2, 2026
4 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