Skip to content

test: overhaul test suite with ~155 new tests and scripts_utils extraction#123

Merged
taddyb merged 5 commits intoDeepGroundwater:masterfrom
taddyb:tests-suite
Feb 8, 2026
Merged

test: overhaul test suite with ~155 new tests and scripts_utils extraction#123
taddyb merged 5 commits intoDeepGroundwater:masterfrom
taddyb:tests-suite

Conversation

@taddyb
Copy link
Collaborator

@taddyb taddyb commented Feb 8, 2026

Summary

  • Shed ~35 low-value tests: Removed mock-only (test_icechunk), empty (test_dataloader, test_attribute_reader), dead code (test_streamflow_reader), and trivial delegation/init tests from test_torch_mc and test_mmc
  • Added ~155 new tests across 9 priority areas: Metrics, Config, Dataclasses, routing utils (denormalize, PatternMapper, TriangularSparseSolver), I/O (downsample, readers), KAN, validation enums/utils, engine core converters/zarr_io, engine build (gauge adjacencies), and benchmark config/utils
  • Refactored setup_inputs() in mmc.py into builder pattern with 4 independently-testable sub-methods (_set_network_context, _denormalize_spatial_parameters, _init_discharge_state, _precompute_scatter_indices)
  • Extracted src/ddr/scripts_utils.py — shared utilities (compute_daily_runoff, load_checkpoint, resolve_learning_rate, safe_percentile, safe_mean) previously duplicated across test.py, train.py, router.py, and summed_q_prime.py

Final suite: 339 tests collected, 338 passed, 2 skipped (expected — benchmark CUDA tests + 1 scenario skip)

Test plan

  • uv run pytest tests/ -v --tb=short — 338 passed, 2 skipped
  • All pre-commit hooks pass (ruff, mypy, formatting)
  • No production behavior changes — setup_inputs() public API identical, scripts import from scripts_utils instead of inline code
  • CI pipeline validation on CUDA runners (benchmark tests)

🤖 Generated with Claude Code

taddyb and others added 5 commits February 7, 2026 21:57
…ct scripts_utils

- Phase 0: Delete mock-only, empty, and trivial tests (test_icechunk, test_streamflow_reader,
  test_dataloader, test_attribute_reader, delegation/init tests in test_torch_mc and test_mmc)
- Phase 1: Add comprehensive tests for Metrics, Config, Dataclasses, routing utils (denormalize,
  PatternMapper, TriangularSparseSolver), I/O (downsample, readers), KAN, validation enums/utils,
  engine core converters/zarr_io, engine build (gauge adjacencies), and benchmark config/utils
- Phase 2: Refactor setup_inputs() in mmc.py into builder pattern with 4 sub-methods
  (_set_network_context, _denormalize_spatial_parameters, _init_discharge_state,
  _precompute_scatter_indices) for independent testability
- Phase 3: Extract shared script utilities into src/ddr/scripts_utils.py (compute_daily_runoff,
  load_checkpoint, resolve_learning_rate, safe_percentile, safe_mean) and update all 4 scripts

Final: 339 tests collected, 338 passed, 2 skipped (expected)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@taddyb taddyb merged commit 4980032 into DeepGroundwater:master Feb 8, 2026
4 checks passed
@taddyb taddyb deleted the tests-suite branch February 8, 2026 03:42
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