ngiab-data-preprocess 4.9.3__tar.gz → 5.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. ngiab_data_preprocess-5.0.0/.dockerignore +6 -0
  2. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/.github/workflows/build_only.yml +1 -2
  3. ngiab_data_preprocess-5.0.0/.github/workflows/ci.yml +86 -0
  4. ngiab_data_preprocess-5.0.0/.github/workflows/docker.yml +40 -0
  5. ngiab_data_preprocess-5.0.0/CONTRIBUTING.md +39 -0
  6. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/PKG-INFO +90 -52
  7. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/README.md +88 -50
  8. ngiab_data_preprocess-5.0.0/aws_tools/aws.dockerfile +28 -0
  9. ngiab_data_preprocess-4.9.3/modules/data_processing/create_realization.py → ngiab_data_preprocess-5.0.0/modules/data_processing/create_configs.py +261 -338
  10. ngiab_data_preprocess-5.0.0/modules/data_processing/create_realization.py +562 -0
  11. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_processing/dask_utils.py +34 -3
  12. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_processing/dataset_utils.py +20 -12
  13. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_processing/datasets.py +10 -6
  14. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_processing/file_paths.py +45 -29
  15. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_processing/forcings.py +96 -37
  16. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_processing/gpkg_utils.py +66 -57
  17. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_processing/graph_utils.py +68 -37
  18. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_processing/s3fs_utils.py +5 -3
  19. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_processing/subset.py +17 -10
  20. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/outputControl.txt +7 -7
  21. ngiab_data_preprocess-5.0.0/modules/data_sources/config/catchment/casam.txt +18 -0
  22. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/catchment/cfe.ini +10 -10
  23. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/catchment/dhbv2-daily.yaml +5 -7
  24. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/catchment/dhbv2.yaml +13 -12
  25. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/catchment/lstm.yml +5 -5
  26. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/catchment/noah-owp-modular-init.namelist.input +11 -11
  27. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/catchment/sac-init.namelist.input +1 -1
  28. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/catchment/snow17-init.namelist.input +1 -1
  29. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/catchment/snow17-params.txt +1 -1
  30. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/casam.json +15 -0
  31. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/cfe.json +16 -0
  32. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/dhbv2.json +14 -0
  33. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/dhbv2_daily.json +14 -0
  34. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/lstm.json +12 -0
  35. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/lstm_rust.json +13 -0
  36. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/multi-template.json +30 -0
  37. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/nom.json +15 -0
  38. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/sac-sma.json +14 -0
  39. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/sloth.json +19 -0
  40. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/snow17.json +15 -0
  41. ngiab_data_preprocess-5.0.0/modules/data_sources/config/modular_realization/summa.json +14 -0
  42. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/source_validation.py +35 -96
  43. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/__main__.py +3 -2
  44. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/views.py +32 -12
  45. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/ngiab_data_cli/__main__.py +100 -70
  46. ngiab_data_preprocess-5.0.0/modules/ngiab_data_cli/arguments.py +296 -0
  47. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/ngiab_data_cli/forcing_cli.py +20 -5
  48. ngiab_data_preprocess-5.0.0/modules/ngiab_data_cli/subset_cli.py +62 -0
  49. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/ngiab_data_preprocess.egg-info/PKG-INFO +90 -52
  50. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/ngiab_data_preprocess.egg-info/SOURCES.txt +50 -9
  51. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/ngiab_data_preprocess.egg-info/entry_points.txt +1 -0
  52. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/ngiab_data_preprocess.egg-info/requires.txt +1 -1
  53. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/pyproject.toml +6 -2
  54. ngiab_data_preprocess-5.0.0/stack.drawio.svg +4 -0
  55. ngiab_data_preprocess-5.0.0/tests/golden/config/cat-1555522-summa.json +14 -0
  56. ngiab_data_preprocess-5.0.0/tests/golden/config/cat-1555522.json +13 -0
  57. ngiab_data_preprocess-5.0.0/tests/golden/config/gage-10109001-summa.json +101 -0
  58. ngiab_data_preprocess-5.0.0/tests/golden/config/gage-10109001.json +883 -0
  59. ngiab_data_preprocess-5.0.0/tests/golden/geopackage/cat-1555522_subset.gpkg +0 -0
  60. ngiab_data_preprocess-5.0.0/tests/golden/geopackage/gage-10109001_subset.gpkg +0 -0
  61. ngiab_data_preprocess-5.0.0/tests/golden/netcdf/cat-1555522-attributes.json +124 -0
  62. ngiab_data_preprocess-5.0.0/tests/golden/netcdf/cat-1555522-coldState.json +272 -0
  63. ngiab_data_preprocess-5.0.0/tests/golden/netcdf/cat-1555522-trialParams.json +28 -0
  64. ngiab_data_preprocess-5.0.0/tests/golden/netcdf/gage-10109001-attributes.json +1342 -0
  65. ngiab_data_preprocess-5.0.0/tests/golden/netcdf/gage-10109001-coldState.json +3056 -0
  66. ngiab_data_preprocess-5.0.0/tests/golden/netcdf/gage-10109001-trialParams.json +202 -0
  67. {ngiab_data_preprocess-4.9.3/modules/data_sources/config → ngiab_data_preprocess-5.0.0/tests/golden}/realization/cfe-nom.json +2 -2
  68. {ngiab_data_preprocess-4.9.3/modules/data_sources/config → ngiab_data_preprocess-5.0.0/tests/golden}/realization/dhbv2-daily.json +22 -21
  69. {ngiab_data_preprocess-4.9.3/modules/data_sources/config → ngiab_data_preprocess-5.0.0/tests/golden}/realization/dhbv2.json +11 -8
  70. {ngiab_data_preprocess-4.9.3/modules/data_sources/config → ngiab_data_preprocess-5.0.0/tests/golden}/realization/lstm-py.json +8 -7
  71. {ngiab_data_preprocess-4.9.3/modules/data_sources/config → ngiab_data_preprocess-5.0.0/tests/golden}/realization/lstm-rs.json +8 -7
  72. ngiab_data_preprocess-5.0.0/tests/golden/realization/sacsma-nom.json +91 -0
  73. ngiab_data_preprocess-5.0.0/tests/golden/realization/snow17-nom-cfe.json +114 -0
  74. {ngiab_data_preprocess-4.9.3/modules/data_sources/config → ngiab_data_preprocess-5.0.0/tests/golden}/realization/summa.json +6 -5
  75. ngiab_data_preprocess-5.0.0/tests/golden_utils.py +227 -0
  76. ngiab_data_preprocess-5.0.0/tests/regen_goldens.py +170 -0
  77. ngiab_data_preprocess-5.0.0/tests/test_cell_weights.py +24 -0
  78. ngiab_data_preprocess-5.0.0/tests/test_cli_args.py +241 -0
  79. ngiab_data_preprocess-5.0.0/tests/test_forcings_regression.py +308 -0
  80. ngiab_data_preprocess-5.0.0/tests/test_modular_config.py +201 -0
  81. ngiab_data_preprocess-5.0.0/tests/test_modular_realization.py +431 -0
  82. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/tests/test_nan_impute.py +43 -0
  83. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/tests/test_ngiab_data_cli_regression.py +2 -0
  84. ngiab_data_preprocess-5.0.0/tests/test_summa_config_generation.py +417 -0
  85. ngiab_data_preprocess-4.9.3/modules/data_sources/config/realization/sacsma-nom.json +0 -74
  86. ngiab_data_preprocess-4.9.3/modules/data_sources/config/realization/snow17-nom-cfe.json +0 -114
  87. ngiab_data_preprocess-4.9.3/modules/ngiab_data_cli/arguments.py +0 -198
  88. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/.github/pull_request_template.md +0 -0
  89. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/.github/workflows/publish.yml +0 -0
  90. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/.gitignore +0 -0
  91. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/CITATION.cff +0 -0
  92. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/LICENSE +0 -0
  93. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/ciroh-bgsafe.png +0 -0
  94. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/README.md +0 -0
  95. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/TBL_GENPARM.TBL +0 -0
  96. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/TBL_MPTABLE.TBL +0 -0
  97. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/TBL_SOILPARM.TBL +0 -0
  98. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/TBL_VEGPARM.TBL +0 -0
  99. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/basinParamInfo.txt +0 -0
  100. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/fileManager.txt +0 -0
  101. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/forcingFileList.txt +0 -0
  102. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/localParamInfo.txt +0 -0
  103. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/SUMMA/modelDecisions.txt +0 -0
  104. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/catchment/sac-params.txt +0 -0
  105. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/config/catchment/summa.input +0 -0
  106. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/ngen-routing-template.yaml +0 -0
  107. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/template.sql +0 -0
  108. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/data_sources/triggers.sql +0 -0
  109. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/__init__.py +0 -0
  110. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/static/css/console.css +0 -0
  111. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/static/css/main.css +0 -0
  112. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/static/css/toggle.css +0 -0
  113. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/static/js/console.js +0 -0
  114. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/static/js/data_processing.js +0 -0
  115. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/static/js/main.js +0 -0
  116. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/static/resources/loading.gif +0 -0
  117. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/static/resources/screenshot.jpg +0 -0
  118. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/map_app/templates/index.html +0 -0
  119. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/ngiab_data_cli/custom_logging.py +0 -0
  120. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/ngiab_data_preprocess.egg-info/dependency_links.txt +0 -0
  121. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/modules/ngiab_data_preprocess.egg-info/top_level.txt +0 -0
  122. {ngiab_data_preprocess-4.9.3 → ngiab_data_preprocess-5.0.0}/setup.cfg +0 -0
@@ -0,0 +1,6 @@
1
+ .venv
2
+ .github
3
+ *.png
4
+ *.svg
5
+ *.md
6
+ *.cff
@@ -1,4 +1,4 @@
1
- name: Upload Python Package to PyPI when a Release is Created
1
+ name: Build Only
2
2
 
3
3
  on:
4
4
  pull_request:
@@ -24,4 +24,3 @@ jobs:
24
24
  - name: Build package
25
25
  run: |
26
26
  python -m build
27
-
@@ -0,0 +1,86 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+
7
+ concurrency:
8
+ group: ci-${{ github.ref }}
9
+ cancel-in-progress: true
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ lint:
16
+ name: Ruff (changed files only)
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0 # need history to diff this PR against its base branch
22
+
23
+ - uses: astral-sh/setup-uv@v6
24
+
25
+ - name: Lint & format-check the Python files this PR changed
26
+ run: |
27
+ base='${{ github.event.pull_request.base.sha }}'
28
+ head='${{ github.event.pull_request.head.sha }}'
29
+ mapfile -t files < <(git diff --name-only --diff-filter=ACMR "$base"..."$head" -- '*.py')
30
+ if [ ${#files[@]} -eq 0 ]; then
31
+ echo "No Python files changed -- nothing to lint."
32
+ exit 0
33
+ fi
34
+ printf 'Linting %s changed file(s):\n' "${#files[@]}"
35
+ printf ' %s\n' "${files[@]}"
36
+ # Keep this ruff version in sync with your pre-commit hook.
37
+ uvx ruff@0.11.9 check -- "${files[@]}"
38
+ uvx ruff@0.11.9 format --check -- "${files[@]}"
39
+
40
+ test:
41
+ name: pytest (unit · hermetic)
42
+ runs-on: ubuntu-latest
43
+ strategy:
44
+ fail-fast: false
45
+ matrix:
46
+ python-version: ["3.10", "3.11"]
47
+ steps:
48
+ - uses: actions/checkout@v4
49
+ with:
50
+ fetch-depth: 0 # setuptools-scm derives the version from git history/tags
51
+
52
+ - uses: astral-sh/setup-uv@v6
53
+ with:
54
+ python-version: ${{ matrix.python-version }}
55
+ enable-cache: true
56
+
57
+ - name: Install project + dev group
58
+ run: uv sync
59
+
60
+ - name: Run unit tests (hermetic; excludes integration)
61
+ run: uv run pytest -m "not integration"
62
+
63
+ integration:
64
+ name: pytest (integration · live S3)
65
+ runs-on: ubuntu-latest
66
+ continue-on-error: true
67
+ timeout-minutes: 15 # bound it in case S3 stalls (the test caps itself at 600s)
68
+ strategy:
69
+ fail-fast: false
70
+ matrix:
71
+ python-version: ["3.10", "3.11"]
72
+ steps:
73
+ - uses: actions/checkout@v4
74
+ with:
75
+ fetch-depth: 0
76
+
77
+ - uses: astral-sh/setup-uv@v6
78
+ with:
79
+ python-version: ${{ matrix.python-version }}
80
+ enable-cache: true
81
+
82
+ - name: Install project + dev group
83
+ run: uv sync
84
+
85
+ - name: Run end-to-end integration tests (hit live AORC/NWM data)
86
+ run: uv run pytest -m integration --ignore tests/test_ngiab_data_cli_regression.py
@@ -0,0 +1,40 @@
1
+ name: Build and Push Preprocessor Docker Image
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+ release:
7
+ types: [published]
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ build:
15
+ name: Build and Push
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - name: Checkout repository
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Set up Docker Buildx
23
+ uses: docker/setup-buildx-action@v3
24
+
25
+ - name: Log in to Docker Hub
26
+ if: github.event_name == 'release'
27
+ uses: docker/login-action@v3
28
+ with:
29
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
30
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
31
+
32
+ - name: Build (and push image on release)
33
+ uses: docker/build-push-action@v6
34
+ with:
35
+ context: .
36
+ file: ./aws_tools/aws.dockerfile
37
+ push: ${{ github.event_name == 'release' }}
38
+ tags: |
39
+ awiciroh/preprocessor:latest
40
+ awiciroh/preprocessor:${{ github.sha }}
@@ -0,0 +1,39 @@
1
+ # How to contribute
2
+
3
+ Anyone may contribute. You do not need to be affiliated with CIROH or any partner institution. The expectations below exist to keep the projects reproducible and reviewable, not to gatekeep.
4
+
5
+ ## Ways to contribute
6
+
7
+ File an issue (bugs, feature ideas, questions), open a pull request (code, configuration, tests, documentation), participate in GitHub Discussions, or improve the training and product docs.
8
+
9
+ ## Standard pull request workflow
10
+
11
+ - Open or comment on an issue describing the change, so effort is not duplicated.
12
+ - Fork the repository (or branch, if you have write access). Name branches descriptively.
13
+ - Make focused changes; keep pull requests as small as practical. Signed commits are recommended.
14
+ - Add or update tests where applicable, and update documentation and any changelog the repository maintains.
15
+ - State whether the change affects model behavior, input-data assumptions, configuration, calibration, reproducibility, performance, or output interpretation, so the right reviewer is engaged.
16
+ - Open a pull request against the default branch, complete the PR template if present, and reference the related issue.
17
+ - Pass automated checks (CI, linting, tests). A maintainer reviews; address feedback.
18
+
19
+ ## Contribution standards
20
+
21
+ Contributions are expected to be your own work (or properly attributed and compatibly licensed), to build and pass tests, to follow each repository's coding conventions, to include reasonable documentation, and to respect the Code of Conduct. Maintainers may request changes or, with explanation, decline contributions that fall outside project scope or that introduce incompatible licenses or unverifiable model artifacts.
22
+
23
+ ## Recognition
24
+
25
+ Contributions are recognized through Git history, release notes, and citation metadata. The project values non-code contributions — documentation, evaluation, issue triage, mentoring — as first-class.
26
+
27
+ ## Maintaining contributed models and components
28
+
29
+ Contributing a model, model configuration, or other substantial, separately identifiable component to NGIAB carries an ongoing responsibility: the contributor — or the institution or owner on whose behalf it was contributed — is expected to maintain it after integration. Maintenance means keeping the contribution working as the ecosystem evolves: updating it for changes in the NextGen framework, the hydrofabric, forcing formats, and the surrounding NGIAB/NRDS tooling; fixing defects attributable to the contribution; and responding to issues filed against it within a reasonable time. This responsibility attaches to substantial contributions (a BMI model, a standing NRDS configuration), not to one-off fixes to code that others maintain.
30
+
31
+ Because everything here is open source, maintenance can move: an owner who can no longer maintain a contribution may hand it off to another willing maintainer, the community may adopt it, or — if no one steps forward — it may be deprecated. The project does not guarantee to maintain contributed models on an owner's behalf.
32
+
33
+ **Unmaintained contributions.** If a contributed model or configuration breaks (for instance, after a framework or hydrofabric update) and the responsible owner is unresponsive for 30 days after a good-faith attempt to reach them, the maintainers may deprecate it or remove it from NGIAB, with notice and preservation of the public record.
34
+
35
+ ## Software stack
36
+
37
+ Most contributions will improve our subsetting/forcing/realization modules or our user interfaces. For our full software stack, see below.
38
+
39
+ ![software stack](./stack.drawio.svg)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngiab_data_preprocess
3
- Version: 4.9.3
3
+ Version: 5.0.0
4
4
  Summary: Graphical Tools for creating Next Gen Water model input data.
5
5
  Author-email: Josh Cunningham <jcunningham8@ua.edu>
6
6
  Project-URL: Homepage, https://github.com/CIROH-UA/NGIAB_data_preprocess
@@ -33,7 +33,7 @@ Requires-Dist: bokeh==3.8.2
33
33
  Requires-Dist: boto3
34
34
  Requires-Dist: numcodecs<0.16.0
35
35
  Requires-Dist: scipy>=1.15.3
36
- Requires-Dist: pyarrow
36
+ Requires-Dist: duckdb>=1.5.2
37
37
  Provides-Extra: eval
38
38
  Requires-Dist: ngiab_eval; extra == "eval"
39
39
  Provides-Extra: plot
@@ -52,33 +52,39 @@ This repository contains tools for preparing data to run a [NextGen](https://git
52
52
 
53
53
  ## Table of Contents
54
54
 
55
- 1. [What does this tool do?](#what-does-this-tool-do)
56
- 2. [Limitations](#limitations)
57
- - [Custom realizations](#custom-realizations)
58
- - [Calibration](#calibration)
59
- - [Evaluation](#evaluation)
60
- - [Visualisation](#visualisation)
61
- 3. [Requirements](#requirements)
62
- 4. [Installation and running](#installation-and-running)
63
- - [Running without install](#running-without-install)
64
- - [For uv installation](#for-uv-installation)
65
- - [For legacy pip installation](#for-legacy-pip-installation)
66
- - [Development installation](#development-installation)
67
- 5. [Map interface documentation](#map-interface-documentation)
68
- - [Running the map interface app](#running-the-map-interface-app)
69
- - [Using the map interace](#using-the-map-interface)
70
- 6. [CLI documentation](#cli-documentation)
71
- - [Running the CLI](#running-the-cli)
72
- - [Arguments](#arguments)
73
- - [Usage notes](#usage-notes)
74
- - [Examples](#examples)
75
- 7. [Realization information](#realization-information)
76
- - [NOAH + CFE](#noah--cfe-default)
77
- - [LSTM (Python)](#lstm-python)
78
- - [LSTM (Rust)](#lstm-rust)
79
- - [dHBV2.0 (hourly)](#dhbv20-hourly-mts)
80
- - [dHBV2.0 (daily)](#dhbv20-daily)
81
- - [SUMMA](#summa)
55
+ - [NGIAB Data Preprocess](#ngiab-data-preprocess)
56
+ - [Table of Contents](#table-of-contents)
57
+ - [What does this tool do?](#what-does-this-tool-do)
58
+ - [Limitations](#limitations)
59
+ - [Calibration](#calibration)
60
+ - [Evaluation](#evaluation)
61
+ - [Visualisation](#visualisation)
62
+ - [Requirements](#requirements)
63
+ - [Installation and running](#installation-and-running)
64
+ - [Running without install](#running-without-install)
65
+ - [For uv installation](#for-uv-installation)
66
+ - [For legacy pip installation](#for-legacy-pip-installation)
67
+ - [Development installation](#development-installation)
68
+ - [Map interface documentation](#map-interface-documentation)
69
+ - [Running the map interface app](#running-the-map-interface-app)
70
+ - [Using the map interface](#using-the-map-interface)
71
+ - [CLI documentation](#cli-documentation)
72
+ - [Running the CLI](#running-the-cli)
73
+ - [Arguments](#arguments)
74
+ - [Usage notes](#usage-notes)
75
+ - [Examples](#examples)
76
+ - [Realization information](#realization-information)
77
+ - [Defaults](#defaults)
78
+ - [NOAH + CFE (Default)](#noah--cfe-default)
79
+ - [LSTM (Python)](#lstm-python)
80
+ - [LSTM (Rust)](#lstm-rust)
81
+ - [dHBV2.1-MTS (Hourly)](#dhbv21-mts-hourly)
82
+ - [dHBV2.0 (Daily)](#dhbv20-daily)
83
+ - [SUMMA](#summa)
84
+ - [SNOW17](#snow17)
85
+ - [SAC-SMA](#sac-sma)
86
+ - [Custom](#custom)
87
+ - [Citing this software](#citing-this-software)
82
88
 
83
89
  ## What does this tool do?
84
90
 
@@ -97,9 +103,6 @@ The raw forcing data is [nwm retrospective v3 forcing](https://noaa-nwm-retrospe
97
103
  ## Limitations
98
104
  This tool cannot do the following:
99
105
 
100
- ### Custom realizations
101
- This tool currently only outputs a single, default realization, which is described in "[Realization information](#realization-information)". Support for additional model configurations is planned, but not currently available.
102
-
103
106
  ### Calibration
104
107
  If available, this repository will download [calibrated parameters](https://communityhydrofabric.s3.us-east-1.amazonaws.com/index.html#hydrofabrics/community/gage_parameters/) from the [Community Hydrofabric](https://github.com/CIROH-UA/community_hf_patcher) AWS S3 bucket.
105
108
  However, many gages and catchments will not have such parameters available. In these cases, Data Preprocess will output realizations with default values.
@@ -248,11 +251,9 @@ Installed with uv: `uv run cli`
248
251
  - `--subset_type`: Specify the subset type. `nexus`: get everything flowing into the downstream nexus of the selected catchment. `catchment`: get everything flowing into the selected catchment.
249
252
  - `-f`, `--forcings`: Generate forcings for the given feature.
250
253
  - `-r`, `--realization`: Create a realization for the given feature.
251
- - `--lstm`: Configures the data for the [python lstm](https://github.com/ciroh-ua/lstm/).
252
- - `--lstm_rust`: Configures the data for the [rust lstm](https://github.com/ciroh-ua/rust-lstm-1025/).
253
- - `--dhbv2`: Configures the data for the hourly [dHBV2](https://github.com/mhpi/dhbv2).
254
- - `--dhbv2_daily`: Configures the data for the daily [dHBV2](https://github.com/mhpi/dhbv2).
255
- - `--summa`: Configures the data for the SUMMA model.
254
+ - `--models`: Configures the data for a user-specified model coupling, e.g., `--models sloth nom cfe`. See [Custom](#custom) for the full list of supported models and examples.
255
+ - `--no-routing`: Disables t-route. Routing is on by default. The t-route config (`troute.yaml`) is still generated, and the realization's `"routing"` key is written as `"no_routing"`, so ngen skips it; rename the key back to `"routing"` to turn routing on again.
256
+ - `--lstm`, `--lstm_rust`, `--dhbv2`, `--dhbv2_daily`, `--summa`, `--snow17`, `--sacsma` (deprecated): Older single-model flags. Each is converted to the equivalent `--models ...` (e.g. `--snow17` becomes `--models sloth snow17 nom cfe`) with a warning. Use `--models` instead.
256
257
  - `--start_date START_DATE`, `--start START_DATE`: Start date for forcings/realization (format YYYY-MM-DD).
257
258
  - `--end_date END_DATE`, `--end END_DATE`: End date for forcings/realization (format YYYY-MM-DD).
258
259
  - `-o OUTPUT_NAME`, `--output_name OUTPUT_NAME`: Name of the output folder.
@@ -313,32 +314,69 @@ Installed with uv: `uv run cli`
313
314
 
314
315
  8. Prepare everything for an NGIAB LSTM run at a given gage:
315
316
  ```bash
316
- uvx ngiab-prep -i gage-10154200 -sfr --start 2022-01-01 --end 2022-02-28 --lstm
317
- # you can replace --lstm with any other model, like --lstm_rust, --dhbv2, --dhbv2_daily, --summa
317
+ uvx ngiab-prep -i gage-10154200 -sfr --start 2022-01-01 --end 2022-02-28 --models lstm
318
+ # you can replace lstm with any other model in MODEL_REGISTRY, e.g. lstm_rust, dhbv2, dhbv2_daily, summa
319
+ ```
320
+
321
+ 9. Prepare everything for a custom NGIAB SLoTH + SNOW17 + CASAM + t-route run at a given gage:
322
+
323
+ ```bash
324
+ uvx ngiab-prep -i gage-10154200 -sfr --start 2022-01-01 --end 2022-02-28 --models sloth snow17 casam
318
325
  ```
319
326
 
320
327
  # Realization information
321
328
 
322
- This tool currently offers three realizations.
329
+ This tool comes with the realizations below, each built from a `--models` list, and you can also create custom realizations from any supported combination of models (see [Custom](#custom)).
330
+
331
+ ## Defaults
323
332
 
324
- ## NOAH + CFE (Default)
333
+ ### NOAH + CFE (Default)
325
334
 
326
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/cfe-nom.json) is intended to be roughly comparable to earlier versions of the National Water Model.
335
+ This realization is what you get when `--models` isn't passed (equivalent to `--models sloth nom cfe`). It is intended to be roughly comparable to earlier versions of the National Water Model.
327
336
  - [NOAH-OWP-Modular](https://github.com/NOAA-OWP/NOAH-OWP-Modular): A refactoring of Noah-MP, a land-surface model. Used to model groundwater properties.
328
337
  - [Conceptual Functional Equivalent (CFE)](https://github.com/NOAA-OWP/CFE): A simplified conceptual approximation of versions 1.2, 2.0, and 2.1 of the National Water Model. Used to model precipitation and evaporation.
329
338
  - [SLoTH](https://github.com/NOAA-OWP/SLoTH): A module used to feed through unchanged values. In this default configuration, it simply forces certain soil moisture and ice fraction properties to zero.
330
339
 
331
- ## LSTM (Python)
332
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/lstm-py.json) will run the [python lstm](https://github.com/ciroh-ua/lstm/). It's designed to work with ngiab using [these example weights](https://github.com/CIROH-UA/lstm/tree/example_weights/trained_neuralhydrology_models) generously contributed by [jmframe/lstm](https://github.com/jmframe/lstm)
340
+ ### LSTM (Python)
341
+ This realization (`--models lstm`) will run the [python lstm](https://github.com/ciroh-ua/lstm/). It's designed to work with ngiab using [these example weights](https://github.com/CIROH-UA/lstm/tree/example_weights/trained_neuralhydrology_models) generously contributed by [jmframe/lstm](https://github.com/jmframe/lstm)
342
+
343
+ ### LSTM (Rust)
344
+ This realization (`--models lstm_rust`) will run the [rust port](https://github.com/CIROH-UA/rust-lstm-1025/tree/main) of the python lstm above. It's an experimental drop in replacement that should produce identical results with a ~2-5x speedup depending on your setup.
345
+
346
+ ### dHBV2.1-MTS (Hourly)
347
+ This realization (`--models dhbv2`) will run the [multi-timescale dHBV2.1 model](https://github.com/mhpi/dhbv2/tree/v0.6.2) ([Yang et al., 2026](https://arxiv.org/abs/2609.06794)). Weights and model attributes developed by Penn State's MHPI group.
348
+
349
+ ### dHBV2.0 (Daily)
350
+ This realization (`--models dhbv2_daily`) will run the [daily dHBV2.0 model](https://github.com/mhpi/dhbv2/tree/v0.6.2) ([Song et al., 2025](https://doi.org/10.1029/2024WR038928)). Weights and model attributes developed by Penn State's MHPI group. The daily model returns zero runoff for the first 365 days while it fills its warmup buffer, so start the simulation at least one year before the period of interest.
351
+
352
+ ### SUMMA
353
+ This realization (`--models summa`) will run the [SUMMA](https://github.com/CIROH-UA/ngen/tree/ngiab/extern/summa) model (version linked is what's currently in nextgen in a box).
354
+
355
+ ### SNOW17
356
+
357
+ This realization (`--models sloth snow17 nom cfe`) will run the [SNOW17](https://github.com/CIROH-UA/ngen/tree/ngiab/extern/snow17) model in conjunction with SLoTH, Noah-OWP-Modular, CFE, and t-route. CFE takes SNOW17's rain plus snowmelt (`raim`) as its precipitation input.
358
+
359
+ ### SAC-SMA
360
+
361
+ This realization (`--models snow17 nom sac-sma`) will run the [SAC-SMA](https://github.com/CIROH-UA/ngen/tree/ngiab/extern/sac-sma) model in conjunction with Noah-OWP-Modular, SNOW17, and t-route. SAC-SMA takes SNOW17's rain plus snowmelt (`raim`) as its precipitation input. SAC-SMA starts with empty soil moisture storages, so start the run several months before the period you want to look at; the first weeks can have little or no streamflow.
362
+
363
+ ## Custom
364
+
365
+ Users can now mix and match models to create custom realizations. Models supported by this capability are `sloth`, `nom`, `cfe`, `lstm`, `lstm_rust`, `dhbv2`, `dhbv2_daily`, `snow17`, `sac-sma`, `casam`, and `summa`. Note that `summa` derives its HRU ordering from the already-generated forcings file, so forcings must be created (`-f`) before running `--models summa`. This feature includes automated validation (i.e., a warning will appear if the preprocessor thinks a user has submitted an invalid list of models to couple).
333
366
 
334
- ## LSTM (Rust)
335
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/lstm-rs.json) will run the [rust port](https://github.com/CIROH-UA/rust-lstm-1025/tree/main) of the python lstm above. It's an experimental drop in replacement that should produce identical results with a ~2-5x speedup depending on your setup.
367
+ To use this functionality, add the `--models` flag with the list of models you would like to couple together in the order that they should be run. Routing through t-route is on by default; add `--no-routing` to turn it off. Some examples include:
336
368
 
337
- ## dHBV2.0 (Hourly MTS)
338
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/dhbv2.json) will run the [multi-timescale dHBV2.0 model](https://github.com/mhpi/dhbv2/tree/39379fd435747a3f765d1a2201d613f9f0087448). Weights and model attributes developed by Penn State's MHPI group.
369
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models sloth nom cfe --run` (Run SLoTH, Noah-OWP-Modular, CFE, and t-route)
370
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models sloth nom casam --run` (Run SLotH, Noah-OWP-Modular, CASAM, and t-route)
371
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models dhbv2 --run` (Run dHBV2 and t-route)
372
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models lstm --run` (Run LSTM and t-route)
373
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models lstm_rust --run` (Run Rust LSTM and t-route)
374
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models nom --no-routing --run` (Run Noah-OWP-Modular standalone)
375
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models nom snow17 sac-sma --run` (Run Noah-OWP-Modular, SNOW17, SAC-SMA, and t-route)
376
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models sloth snow17 casam --run` (Run SLoTH, SNOW17, CASAM, and t-route)
377
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models snow17 --no-routing --run` (Run SNOW17 standalone)
339
378
 
340
- ## dHBV2.0 (Daily)
341
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/dhbv2-daily.json) will run the [daily dHBV2.0 model](https://github.com/mhpi/dhbv2/tree/39379fd435747a3f765d1a2201d613f9f0087448). Weights and model attributes developed by Penn State's MHPI group.
379
+ `--no-routing` works with the default realization as well as with `--models`.
342
380
 
343
- ## SUMMA
344
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/summa.json) will run the [SUMMA](https://github.com/CIROH-UA/ngen/tree/ngiab/extern/summa) model (version linked is what's currently in nextgen in a box).
381
+ # Citing this software
382
+ Arpita Patel, James Halgren, Zach Wills, et al. NextGen In A Box (NGIAB): Open-Source Containerization of the NextGen Framework to Enable Community-Driven Hydrology Modeling. Environmental Modelling & Software, page 106666, August 2025. ISSN 1364-8152. doi: 10.1016/j.envsoft.2025.106666. URL https://www.sciencedirect.com/science/article/pii/S1364815225003500.
@@ -10,33 +10,39 @@ This repository contains tools for preparing data to run a [NextGen](https://git
10
10
 
11
11
  ## Table of Contents
12
12
 
13
- 1. [What does this tool do?](#what-does-this-tool-do)
14
- 2. [Limitations](#limitations)
15
- - [Custom realizations](#custom-realizations)
16
- - [Calibration](#calibration)
17
- - [Evaluation](#evaluation)
18
- - [Visualisation](#visualisation)
19
- 3. [Requirements](#requirements)
20
- 4. [Installation and running](#installation-and-running)
21
- - [Running without install](#running-without-install)
22
- - [For uv installation](#for-uv-installation)
23
- - [For legacy pip installation](#for-legacy-pip-installation)
24
- - [Development installation](#development-installation)
25
- 5. [Map interface documentation](#map-interface-documentation)
26
- - [Running the map interface app](#running-the-map-interface-app)
27
- - [Using the map interace](#using-the-map-interface)
28
- 6. [CLI documentation](#cli-documentation)
29
- - [Running the CLI](#running-the-cli)
30
- - [Arguments](#arguments)
31
- - [Usage notes](#usage-notes)
32
- - [Examples](#examples)
33
- 7. [Realization information](#realization-information)
34
- - [NOAH + CFE](#noah--cfe-default)
35
- - [LSTM (Python)](#lstm-python)
36
- - [LSTM (Rust)](#lstm-rust)
37
- - [dHBV2.0 (hourly)](#dhbv20-hourly-mts)
38
- - [dHBV2.0 (daily)](#dhbv20-daily)
39
- - [SUMMA](#summa)
13
+ - [NGIAB Data Preprocess](#ngiab-data-preprocess)
14
+ - [Table of Contents](#table-of-contents)
15
+ - [What does this tool do?](#what-does-this-tool-do)
16
+ - [Limitations](#limitations)
17
+ - [Calibration](#calibration)
18
+ - [Evaluation](#evaluation)
19
+ - [Visualisation](#visualisation)
20
+ - [Requirements](#requirements)
21
+ - [Installation and running](#installation-and-running)
22
+ - [Running without install](#running-without-install)
23
+ - [For uv installation](#for-uv-installation)
24
+ - [For legacy pip installation](#for-legacy-pip-installation)
25
+ - [Development installation](#development-installation)
26
+ - [Map interface documentation](#map-interface-documentation)
27
+ - [Running the map interface app](#running-the-map-interface-app)
28
+ - [Using the map interface](#using-the-map-interface)
29
+ - [CLI documentation](#cli-documentation)
30
+ - [Running the CLI](#running-the-cli)
31
+ - [Arguments](#arguments)
32
+ - [Usage notes](#usage-notes)
33
+ - [Examples](#examples)
34
+ - [Realization information](#realization-information)
35
+ - [Defaults](#defaults)
36
+ - [NOAH + CFE (Default)](#noah--cfe-default)
37
+ - [LSTM (Python)](#lstm-python)
38
+ - [LSTM (Rust)](#lstm-rust)
39
+ - [dHBV2.1-MTS (Hourly)](#dhbv21-mts-hourly)
40
+ - [dHBV2.0 (Daily)](#dhbv20-daily)
41
+ - [SUMMA](#summa)
42
+ - [SNOW17](#snow17)
43
+ - [SAC-SMA](#sac-sma)
44
+ - [Custom](#custom)
45
+ - [Citing this software](#citing-this-software)
40
46
 
41
47
  ## What does this tool do?
42
48
 
@@ -55,9 +61,6 @@ The raw forcing data is [nwm retrospective v3 forcing](https://noaa-nwm-retrospe
55
61
  ## Limitations
56
62
  This tool cannot do the following:
57
63
 
58
- ### Custom realizations
59
- This tool currently only outputs a single, default realization, which is described in "[Realization information](#realization-information)". Support for additional model configurations is planned, but not currently available.
60
-
61
64
  ### Calibration
62
65
  If available, this repository will download [calibrated parameters](https://communityhydrofabric.s3.us-east-1.amazonaws.com/index.html#hydrofabrics/community/gage_parameters/) from the [Community Hydrofabric](https://github.com/CIROH-UA/community_hf_patcher) AWS S3 bucket.
63
66
  However, many gages and catchments will not have such parameters available. In these cases, Data Preprocess will output realizations with default values.
@@ -206,11 +209,9 @@ Installed with uv: `uv run cli`
206
209
  - `--subset_type`: Specify the subset type. `nexus`: get everything flowing into the downstream nexus of the selected catchment. `catchment`: get everything flowing into the selected catchment.
207
210
  - `-f`, `--forcings`: Generate forcings for the given feature.
208
211
  - `-r`, `--realization`: Create a realization for the given feature.
209
- - `--lstm`: Configures the data for the [python lstm](https://github.com/ciroh-ua/lstm/).
210
- - `--lstm_rust`: Configures the data for the [rust lstm](https://github.com/ciroh-ua/rust-lstm-1025/).
211
- - `--dhbv2`: Configures the data for the hourly [dHBV2](https://github.com/mhpi/dhbv2).
212
- - `--dhbv2_daily`: Configures the data for the daily [dHBV2](https://github.com/mhpi/dhbv2).
213
- - `--summa`: Configures the data for the SUMMA model.
212
+ - `--models`: Configures the data for a user-specified model coupling, e.g., `--models sloth nom cfe`. See [Custom](#custom) for the full list of supported models and examples.
213
+ - `--no-routing`: Disables t-route. Routing is on by default. The t-route config (`troute.yaml`) is still generated, and the realization's `"routing"` key is written as `"no_routing"`, so ngen skips it; rename the key back to `"routing"` to turn routing on again.
214
+ - `--lstm`, `--lstm_rust`, `--dhbv2`, `--dhbv2_daily`, `--summa`, `--snow17`, `--sacsma` (deprecated): Older single-model flags. Each is converted to the equivalent `--models ...` (e.g. `--snow17` becomes `--models sloth snow17 nom cfe`) with a warning. Use `--models` instead.
214
215
  - `--start_date START_DATE`, `--start START_DATE`: Start date for forcings/realization (format YYYY-MM-DD).
215
216
  - `--end_date END_DATE`, `--end END_DATE`: End date for forcings/realization (format YYYY-MM-DD).
216
217
  - `-o OUTPUT_NAME`, `--output_name OUTPUT_NAME`: Name of the output folder.
@@ -271,32 +272,69 @@ Installed with uv: `uv run cli`
271
272
 
272
273
  8. Prepare everything for an NGIAB LSTM run at a given gage:
273
274
  ```bash
274
- uvx ngiab-prep -i gage-10154200 -sfr --start 2022-01-01 --end 2022-02-28 --lstm
275
- # you can replace --lstm with any other model, like --lstm_rust, --dhbv2, --dhbv2_daily, --summa
275
+ uvx ngiab-prep -i gage-10154200 -sfr --start 2022-01-01 --end 2022-02-28 --models lstm
276
+ # you can replace lstm with any other model in MODEL_REGISTRY, e.g. lstm_rust, dhbv2, dhbv2_daily, summa
277
+ ```
278
+
279
+ 9. Prepare everything for a custom NGIAB SLoTH + SNOW17 + CASAM + t-route run at a given gage:
280
+
281
+ ```bash
282
+ uvx ngiab-prep -i gage-10154200 -sfr --start 2022-01-01 --end 2022-02-28 --models sloth snow17 casam
276
283
  ```
277
284
 
278
285
  # Realization information
279
286
 
280
- This tool currently offers three realizations.
287
+ This tool comes with the realizations below, each built from a `--models` list, and you can also create custom realizations from any supported combination of models (see [Custom](#custom)).
288
+
289
+ ## Defaults
281
290
 
282
- ## NOAH + CFE (Default)
291
+ ### NOAH + CFE (Default)
283
292
 
284
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/cfe-nom.json) is intended to be roughly comparable to earlier versions of the National Water Model.
293
+ This realization is what you get when `--models` isn't passed (equivalent to `--models sloth nom cfe`). It is intended to be roughly comparable to earlier versions of the National Water Model.
285
294
  - [NOAH-OWP-Modular](https://github.com/NOAA-OWP/NOAH-OWP-Modular): A refactoring of Noah-MP, a land-surface model. Used to model groundwater properties.
286
295
  - [Conceptual Functional Equivalent (CFE)](https://github.com/NOAA-OWP/CFE): A simplified conceptual approximation of versions 1.2, 2.0, and 2.1 of the National Water Model. Used to model precipitation and evaporation.
287
296
  - [SLoTH](https://github.com/NOAA-OWP/SLoTH): A module used to feed through unchanged values. In this default configuration, it simply forces certain soil moisture and ice fraction properties to zero.
288
297
 
289
- ## LSTM (Python)
290
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/lstm-py.json) will run the [python lstm](https://github.com/ciroh-ua/lstm/). It's designed to work with ngiab using [these example weights](https://github.com/CIROH-UA/lstm/tree/example_weights/trained_neuralhydrology_models) generously contributed by [jmframe/lstm](https://github.com/jmframe/lstm)
298
+ ### LSTM (Python)
299
+ This realization (`--models lstm`) will run the [python lstm](https://github.com/ciroh-ua/lstm/). It's designed to work with ngiab using [these example weights](https://github.com/CIROH-UA/lstm/tree/example_weights/trained_neuralhydrology_models) generously contributed by [jmframe/lstm](https://github.com/jmframe/lstm)
300
+
301
+ ### LSTM (Rust)
302
+ This realization (`--models lstm_rust`) will run the [rust port](https://github.com/CIROH-UA/rust-lstm-1025/tree/main) of the python lstm above. It's an experimental drop in replacement that should produce identical results with a ~2-5x speedup depending on your setup.
303
+
304
+ ### dHBV2.1-MTS (Hourly)
305
+ This realization (`--models dhbv2`) will run the [multi-timescale dHBV2.1 model](https://github.com/mhpi/dhbv2/tree/v0.6.2) ([Yang et al., 2026](https://arxiv.org/abs/2609.06794)). Weights and model attributes developed by Penn State's MHPI group.
306
+
307
+ ### dHBV2.0 (Daily)
308
+ This realization (`--models dhbv2_daily`) will run the [daily dHBV2.0 model](https://github.com/mhpi/dhbv2/tree/v0.6.2) ([Song et al., 2025](https://doi.org/10.1029/2024WR038928)). Weights and model attributes developed by Penn State's MHPI group. The daily model returns zero runoff for the first 365 days while it fills its warmup buffer, so start the simulation at least one year before the period of interest.
309
+
310
+ ### SUMMA
311
+ This realization (`--models summa`) will run the [SUMMA](https://github.com/CIROH-UA/ngen/tree/ngiab/extern/summa) model (version linked is what's currently in nextgen in a box).
312
+
313
+ ### SNOW17
314
+
315
+ This realization (`--models sloth snow17 nom cfe`) will run the [SNOW17](https://github.com/CIROH-UA/ngen/tree/ngiab/extern/snow17) model in conjunction with SLoTH, Noah-OWP-Modular, CFE, and t-route. CFE takes SNOW17's rain plus snowmelt (`raim`) as its precipitation input.
316
+
317
+ ### SAC-SMA
318
+
319
+ This realization (`--models snow17 nom sac-sma`) will run the [SAC-SMA](https://github.com/CIROH-UA/ngen/tree/ngiab/extern/sac-sma) model in conjunction with Noah-OWP-Modular, SNOW17, and t-route. SAC-SMA takes SNOW17's rain plus snowmelt (`raim`) as its precipitation input. SAC-SMA starts with empty soil moisture storages, so start the run several months before the period you want to look at; the first weeks can have little or no streamflow.
320
+
321
+ ## Custom
322
+
323
+ Users can now mix and match models to create custom realizations. Models supported by this capability are `sloth`, `nom`, `cfe`, `lstm`, `lstm_rust`, `dhbv2`, `dhbv2_daily`, `snow17`, `sac-sma`, `casam`, and `summa`. Note that `summa` derives its HRU ordering from the already-generated forcings file, so forcings must be created (`-f`) before running `--models summa`. This feature includes automated validation (i.e., a warning will appear if the preprocessor thinks a user has submitted an invalid list of models to couple).
291
324
 
292
- ## LSTM (Rust)
293
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/lstm-rs.json) will run the [rust port](https://github.com/CIROH-UA/rust-lstm-1025/tree/main) of the python lstm above. It's an experimental drop in replacement that should produce identical results with a ~2-5x speedup depending on your setup.
325
+ To use this functionality, add the `--models` flag with the list of models you would like to couple together in the order that they should be run. Routing through t-route is on by default; add `--no-routing` to turn it off. Some examples include:
294
326
 
295
- ## dHBV2.0 (Hourly MTS)
296
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/dhbv2.json) will run the [multi-timescale dHBV2.0 model](https://github.com/mhpi/dhbv2/tree/39379fd435747a3f765d1a2201d613f9f0087448). Weights and model attributes developed by Penn State's MHPI group.
327
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models sloth nom cfe --run` (Run SLoTH, Noah-OWP-Modular, CFE, and t-route)
328
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models sloth nom casam --run` (Run SLotH, Noah-OWP-Modular, CASAM, and t-route)
329
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models dhbv2 --run` (Run dHBV2 and t-route)
330
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models lstm --run` (Run LSTM and t-route)
331
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models lstm_rust --run` (Run Rust LSTM and t-route)
332
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models nom --no-routing --run` (Run Noah-OWP-Modular standalone)
333
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models nom snow17 sac-sma --run` (Run Noah-OWP-Modular, SNOW17, SAC-SMA, and t-route)
334
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models sloth snow17 casam --run` (Run SLoTH, SNOW17, CASAM, and t-route)
335
+ - `uv run cli -i cat-1555522 -sfr --start 2020-01-01 --end 2020-01-02 --source aorc --models snow17 --no-routing --run` (Run SNOW17 standalone)
297
336
 
298
- ## dHBV2.0 (Daily)
299
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/dhbv2-daily.json) will run the [daily dHBV2.0 model](https://github.com/mhpi/dhbv2/tree/39379fd435747a3f765d1a2201d613f9f0087448). Weights and model attributes developed by Penn State's MHPI group.
337
+ `--no-routing` works with the default realization as well as with `--models`.
300
338
 
301
- ## SUMMA
302
- [This realization](https://github.com/CIROH-UA/NGIAB_data_preprocess/blob/main/modules/data_sources/config/realization/summa.json) will run the [SUMMA](https://github.com/CIROH-UA/ngen/tree/ngiab/extern/summa) model (version linked is what's currently in nextgen in a box).
339
+ # Citing this software
340
+ Arpita Patel, James Halgren, Zach Wills, et al. NextGen In A Box (NGIAB): Open-Source Containerization of the NextGen Framework to Enable Community-Driven Hydrology Modeling. Environmental Modelling & Software, page 106666, August 2025. ISSN 1364-8152. doi: 10.1016/j.envsoft.2025.106666. URL https://www.sciencedirect.com/science/article/pii/S1364815225003500.
@@ -0,0 +1,28 @@
1
+ FROM amazonlinux:2023 AS base
2
+ COPY --from=ghcr.io/astral-sh/uv:0.12.3 /uv /uvx /bin/
3
+ ENV UV_COMPILE_BYTECODE=1
4
+
5
+ RUN dnf -y install python3.11 python3.11-devel cmake gcc gcc-c++ make geos geos-devel git
6
+ RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 \
7
+ && ln -sf /usr/bin/python3.11 /usr/bin/python
8
+
9
+ FROM base AS build
10
+
11
+ RUN mkdir /app
12
+ WORKDIR /app/
13
+ RUN uv venv -p 3.11
14
+ ENV PATH="/app/.venv/bin:$PATH"
15
+ # appease exact-extract with the special scikit-build-core version
16
+ COPY . .
17
+ RUN uv build \
18
+ && echo "scikit-build-core<0.10" > /tmp/build-constraints.txt \
19
+ && uv pip install dist/ngiab_data_preprocess-*.whl --build-constraint /tmp/build-constraints.txt
20
+
21
+ FROM amazonlinux:2023 AS runtime
22
+
23
+ RUN dnf -y install python3.11 \
24
+ && dnf clean all \
25
+ && rm -rf /var/cache/dnf
26
+
27
+ COPY --from=build /app/.venv /app/.venv
28
+ ENV PATH="/app/.venv/bin:$PATH"