hydrodl2 1.3.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 (42) hide show
  1. hydrodl2-1.3.0/.github/ISSUE_TEMPLATE/bug_report.md +45 -0
  2. hydrodl2-1.3.0/.github/ISSUE_TEMPLATE/documentation.md +29 -0
  3. hydrodl2-1.3.0/.github/ISSUE_TEMPLATE/feature-request.md +34 -0
  4. hydrodl2-1.3.0/.github/PULL_REQUEST_TEMPLATE.md +31 -0
  5. hydrodl2-1.3.0/.github/workflows/build-wheels.yaml +56 -0
  6. hydrodl2-1.3.0/.github/workflows/lint.yaml +34 -0
  7. hydrodl2-1.3.0/.github/workflows/pytest.yaml +32 -0
  8. hydrodl2-1.3.0/.github/workflows/test-wheels.yaml +51 -0
  9. hydrodl2-1.3.0/.gitignore +169 -0
  10. hydrodl2-1.3.0/.pre-commit-config.yaml +27 -0
  11. hydrodl2-1.3.0/LICENSE +31 -0
  12. hydrodl2-1.3.0/PKG-INFO +184 -0
  13. hydrodl2-1.3.0/README.md +119 -0
  14. hydrodl2-1.3.0/docs/CHANGELOG.md +15 -0
  15. hydrodl2-1.3.0/docs/CONTRIBUTING.md +45 -0
  16. hydrodl2-1.3.0/docs/adding_models_and_modules.md +40 -0
  17. hydrodl2-1.3.0/docs/images/hydrodl2.png +0 -0
  18. hydrodl2-1.3.0/docs/setup.md +102 -0
  19. hydrodl2-1.3.0/pyproject.toml +151 -0
  20. hydrodl2-1.3.0/src/hydrodl2/__init__.py +122 -0
  21. hydrodl2-1.3.0/src/hydrodl2/_version.py +34 -0
  22. hydrodl2-1.3.0/src/hydrodl2/api/__init__.py +3 -0
  23. hydrodl2-1.3.0/src/hydrodl2/api/methods.py +144 -0
  24. hydrodl2-1.3.0/src/hydrodl2/core/calc/__init__.py +11 -0
  25. hydrodl2-1.3.0/src/hydrodl2/core/calc/batch_jacobian.pye +501 -0
  26. hydrodl2-1.3.0/src/hydrodl2/core/calc/fdj.py +92 -0
  27. hydrodl2-1.3.0/src/hydrodl2/core/calc/uh_routing.py +105 -0
  28. hydrodl2-1.3.0/src/hydrodl2/core/calc/utils.py +59 -0
  29. hydrodl2-1.3.0/src/hydrodl2/core/utils/__init__.py +7 -0
  30. hydrodl2-1.3.0/src/hydrodl2/core/utils/clean_temp.sh +8 -0
  31. hydrodl2-1.3.0/src/hydrodl2/core/utils/utils.py +63 -0
  32. hydrodl2-1.3.0/src/hydrodl2/models/hbv/hbv.py +596 -0
  33. hydrodl2-1.3.0/src/hydrodl2/models/hbv/hbv_1_1p.py +608 -0
  34. hydrodl2-1.3.0/src/hydrodl2/models/hbv/hbv_2.py +670 -0
  35. hydrodl2-1.3.0/src/hydrodl2/models/hbv/hbv_2_hourly.py +897 -0
  36. hydrodl2-1.3.0/src/hydrodl2/models/hbv/hbv_2_mts.py +377 -0
  37. hydrodl2-1.3.0/src/hydrodl2/models/hbv/hbv_adj.py +712 -0
  38. hydrodl2-1.3.0/src/hydrodl2/modules/__init__.py +2 -0
  39. hydrodl2-1.3.0/src/hydrodl2/modules/data_assimilation/variational_prcp_da.py +1 -0
  40. hydrodl2-1.3.0/tests/config.yaml +70 -0
  41. hydrodl2-1.3.0/tests/test_methods.py +47 -0
  42. hydrodl2-1.3.0/tests/test_models.py +7 -0
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: 🐛 Bug Report
3
+ about: Identify a bug or concern
4
+ labels: bug_report
5
+ assignees: leoglonz
6
+ ---
7
+
8
+ <!--
9
+ Welcome! Thanks for helping us improve HydroDL2.
10
+
11
+ Before creating a new bug report, please confirm one does not already exist for your issue.
12
+ -->
13
+
14
+ ## Problem
15
+
16
+ ### Actual Behavior
17
+
18
+ <!-- Provide a clear and concise description of the problem or bug that you encountered.
19
+
20
+ Is this a known issue?
21
+ -->
22
+
23
+ ### Expected Behavior
24
+
25
+ <!-- What was the expected behavior in this scenario? This will help us identify the source of the issue.
26
+ -->
27
+
28
+ ## Steps to Reproduce
29
+
30
+ <!-- Detail steps to recreate the issue as best you can. If we can replicate it on our end we can more readily address the core issue.
31
+
32
+ 1.
33
+ 2.
34
+ ...
35
+ -->
36
+
37
+ ## Proposed Solution (Optional)
38
+
39
+ <!-- We are certainly open to suggestions if you have ideas about root causes for the issue or bug, particularly if it is nuanced or more complex.
40
+ -->
41
+
42
+ ## Additional Context
43
+
44
+ <!-- Add any other context or screenshots related to the issue here.
45
+ -->
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: 📖 Documentation Issue/Suggestion
3
+ about: Report problems with the docs or suggest improvements
4
+ labels: documentation
5
+ assignees: leoglonz
6
+ ---
7
+
8
+ <!--To help us understand and resolve your issue, please fill out the form to the best of your ability.-->
9
+ <!--You can feel free to delete the sections that do not apply.-->
10
+
11
+ ### Problem
12
+
13
+ <!--
14
+ If you are referencing an existing piece of documentation or example please provide a link.
15
+
16
+ * I found [...] to be unclear because [...]
17
+ * [...] made me think that [...] when really it should be [...]
18
+ * There is no example showing how to do [...]
19
+ -->
20
+
21
+ ### Suggested Improvement
22
+
23
+ <!--
24
+ If you have an idea to improve the documentation please suggest it here
25
+
26
+ * This line should be be changed to say [...]
27
+ * Include a paragraph explaining [...]
28
+ * Add a figure showing [...]
29
+ -->
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: 🛠️ Enhancement/Feature Request
3
+ about: Suggest an improvement or new feature
4
+ labels: feature_request
5
+ assignees: leoglonz
6
+ ---
7
+
8
+ <!--
9
+ Welcome! Thanks considering a way to improve HydroDL2.
10
+
11
+ Before creating a new feature request please search the issues for relevant feature requests.
12
+ -->
13
+
14
+ ## Problem
15
+
16
+ <!-- Provide a clear and concise description of what problem this feature will solve. For example:
17
+
18
+ * I'm always frustrated when [...] because [...]
19
+ * I would like it if [...] happened when I [...] because [...]
20
+ -->
21
+
22
+ ## Proposed Solution
23
+
24
+ <!-- Provide a clear and concise description of a way to accomplish what you want. For example:
25
+
26
+ * Add an option so that when [...] [...] will happen
27
+ -->
28
+
29
+ ## Additional context
30
+
31
+ <!-- Add any other context or screenshots about the feature request here. You can also include links to examples of other programs that have something similar to your request. For example:
32
+
33
+ * Another project [...] solved this by [...]
34
+ -->
@@ -0,0 +1,31 @@
1
+ ## Issue Addressed
2
+
3
+ <!-- Give a brief ~1 sentence overview of the main addition proposed by this pull request.
4
+ -->
5
+
6
+ ## Description
7
+
8
+ <!-- Describe how you addressed the bug/feature request, what choices you made and why. Changes can be listed as bullet point;
9
+
10
+ - ...
11
+ - ...
12
+
13
+ -->
14
+
15
+ ## Type of Change
16
+
17
+ - [ ] Bug fix (non-breaking change which fixes an issue)
18
+ - [ ] New feature (non-breaking change which adds functionality)
19
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
20
+ - [ ] Code cleanup/refactor
21
+ - [ ] Documentation update
22
+
23
+ Other (please specify):
24
+
25
+ ## Checklist
26
+
27
+ - [ ] Branch is up to date with master
28
+ - [ ] Updated tests or added new tests
29
+ - [ ] Tests & pre-commit hooks pass
30
+ - [ ] Updated documentation (if applicable)
31
+ - [ ] Code follows established style and conventions
@@ -0,0 +1,56 @@
1
+ name: Build and Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch: # Allow manual triggering
7
+
8
+ jobs:
9
+ build:
10
+ name: Build wheel and sdist
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v6.0.2
14
+ with:
15
+ fetch-depth: 0 # Full history for version tags (hatch-vcs needs this)
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v6.2.0
19
+ with:
20
+ python-version: '3.12'
21
+
22
+ - name: Install build
23
+ run: pip install build
24
+
25
+ - name: Build wheel and sdist
26
+ run: python -m build
27
+
28
+ - name: Verify wheel
29
+ run: |
30
+ pip install --find-links dist hydrodl2
31
+ python -c "import hydrodl2; print(hydrodl2.__version__)"
32
+
33
+ - uses: actions/upload-artifact@v6.0.0
34
+ with:
35
+ name: dist
36
+ path: dist/
37
+ if-no-files-found: error
38
+
39
+ publish:
40
+ name: Publish to PyPI
41
+ needs: [build]
42
+ runs-on: ubuntu-latest
43
+ permissions:
44
+ id-token: write # Required for trusted publishing
45
+
46
+ steps:
47
+ - uses: actions/download-artifact@v7.0.0
48
+ with:
49
+ name: dist
50
+ path: dist
51
+
52
+ - name: Display artifacts
53
+ run: ls -lh dist/
54
+
55
+ - name: Publish to PyPI
56
+ uses: pypa/gh-action-pypi-publish@v1.13.0
@@ -0,0 +1,34 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest]
15
+ python-version: ['3.9', '3.12', '3.13']
16
+
17
+ steps:
18
+ - name: Checkout code
19
+ uses: actions/checkout@v6.0.2
20
+
21
+ - name: Install uv + Python
22
+ uses: astral-sh/setup-uv@v7.2.1
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+ enable-cache: true
26
+
27
+ - name: Install dependencies
28
+ run: uv sync --extra dev
29
+
30
+ - name: Run Ruff check
31
+ run: uv run ruff check . --config pyproject.toml --output-format=github
32
+
33
+ - name: Run Ruff format check
34
+ run: uv run ruff format . --config pyproject.toml --check
@@ -0,0 +1,32 @@
1
+ name: Pytests
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest]
15
+ python-version: ['3.9', '3.12', '3.13']
16
+
17
+ steps:
18
+ - name: Checkout code
19
+ uses: actions/checkout@v6.0.2
20
+
21
+ - name: Install uv + Python
22
+ uses: astral-sh/setup-uv@v7.2.1
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+ enable-cache: true
26
+
27
+ - name: Install dependencies
28
+ run: |
29
+ uv sync --extra dev
30
+
31
+ - name: Run tests
32
+ run: uv run pytest
@@ -0,0 +1,51 @@
1
+ name: Test Build
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ paths:
7
+ - 'pyproject.toml'
8
+ - '.github/workflows/build-wheels.yaml'
9
+ - '.github/workflows/test-wheels.yaml'
10
+ pull_request:
11
+ branches: [master]
12
+ paths:
13
+ - 'pyproject.toml'
14
+ - '.github/workflows/build-wheels.yaml'
15
+ - '.github/workflows/test-wheels.yaml'
16
+ workflow_dispatch:
17
+
18
+ jobs:
19
+ test_build:
20
+ name: Test build on ${{ matrix.os }}
21
+ runs-on: ${{ matrix.os }}
22
+ strategy:
23
+ matrix:
24
+ os: [ubuntu-latest, windows-latest, macos-latest]
25
+
26
+ steps:
27
+ - uses: actions/checkout@v6.0.2
28
+ with:
29
+ fetch-depth: 0
30
+
31
+ - name: Set up Python
32
+ uses: actions/setup-python@v6.2.0
33
+ with:
34
+ python-version: '3.12'
35
+
36
+ - name: Install build
37
+ run: pip install build
38
+
39
+ - name: Build wheel and sdist
40
+ run: python -m build
41
+
42
+ - name: Install and verify
43
+ run: |
44
+ pip install --find-links dist hydrodl2
45
+ python -c "import hydrodl2; print(hydrodl2.__version__)"
46
+
47
+ - uses: actions/upload-artifact@v6.0.0
48
+ with:
49
+ name: test-dist-${{ matrix.os }}
50
+ path: dist/
51
+ retention-days: 7
@@ -0,0 +1,169 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+ _version.py
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # poetry
99
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103
+ #poetry.lock
104
+
105
+ # pdm
106
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107
+ #pdm.lock
108
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109
+ # in version control.
110
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
111
+ .pdm.toml
112
+ .pdm-python
113
+ .pdm-build/
114
+
115
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
116
+ __pypackages__/
117
+
118
+ # Celery stuff
119
+ celerybeat-schedule
120
+ celerybeat.pid
121
+
122
+ # SageMath parsed files
123
+ *.sage.py
124
+
125
+ # Environments
126
+ .env
127
+ .venv
128
+ env/
129
+ venv/
130
+ ENV/
131
+ env.bak/
132
+ venv.bak/
133
+
134
+ # Spyder project settings
135
+ .spyderproject
136
+ .spyproject
137
+
138
+ # Rope project settings
139
+ .ropeproject
140
+
141
+ # mkdocs documentation
142
+ /site
143
+
144
+ # mypy
145
+ .mypy_cache/
146
+ .dmypy.json
147
+ dmypy.json
148
+
149
+ # Pyre type checker
150
+ .pyre/
151
+
152
+ # pytype static type analyzer
153
+ .pytype/
154
+
155
+ # Cython debug symbols
156
+ cython_debug/
157
+
158
+ # PyCharm
159
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
160
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
161
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
162
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
163
+ .idea/
164
+
165
+ # Archived files
166
+ archive/
167
+
168
+ # UV lock
169
+ uv.lock
@@ -0,0 +1,27 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v6.0.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ exclude: "mkdocs.*\\.yml$"
9
+ - id: debug-statements
10
+ - id: check-toml
11
+
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: v0.14.8
14
+ hooks:
15
+ - id: ruff-check
16
+ types_or: [python, pyi, jupyter]
17
+ args: [--fix, --config, pyproject.toml]
18
+ - id: ruff-format
19
+ types_or: [python, pyi, jupyter]
20
+ args: [--config, pyproject.toml]
21
+
22
+ - repo: https://github.com/kynan/nbstripout
23
+ rev: 0.8.2
24
+ hooks:
25
+ - id: nbstripout
26
+ types: [jupyter]
27
+ language_version: python3
hydrodl2-1.3.0/LICENSE ADDED
@@ -0,0 +1,31 @@
1
+ Non-Commercial Software License Agreement
2
+
3
+ By downloading the hydrodl2 software (the “Software”) you agree to
4
+ the following terms of use:
5
+ Copyright (c) 2020, The Pennsylvania State University (“PSU”). All rights reserved.
6
+
7
+ 1. PSU hereby grants to you a perpetual, nonexclusive and worldwide right, privilege and
8
+ license to use, reproduce, modify, display, and create derivative works of Software for all
9
+ non-commercial purposes only. You may not use Software for commercial purposes without
10
+ prior written consent from PSU. Queries regarding commercial licensing should be directed
11
+ to The Office of Technology Management at 814.865.6277 or otminfo@psu.edu.
12
+ 2. Neither the name of the copyright holder nor the names of its contributors may be used
13
+ to endorse or promote products derived from this software without specific prior written
14
+ permission.
15
+ 3. This software is provided for non-commercial use only.
16
+ 4. Redistribution and use in source and binary forms, with or without modification, are
17
+ permitted provided that redistributions must reproduce the above copyright notice, license,
18
+ list of conditions and the following disclaimer in the documentation and/or other materials
19
+ provided with the distribution.
20
+
21
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS";
22
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
+ POSSIBILITY OF SUCH DAMAGE.