test: overhaul test suite with ~155 new tests and scripts_utils extraction#123
Merged
taddyb merged 5 commits intoDeepGroundwater:masterfrom Feb 8, 2026
Merged
test: overhaul test suite with ~155 new tests and scripts_utils extraction#123taddyb merged 5 commits intoDeepGroundwater:masterfrom
taddyb merged 5 commits intoDeepGroundwater:masterfrom
Conversation
…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>
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
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)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.pyFinal 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 skippedsetup_inputs()public API identical, scripts import fromscripts_utilsinstead of inline code🤖 Generated with Claude Code