hydrotoolbox 2.0.13__tar.gz → 2.1.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.
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/.github/workflows/clean-workflow-runs.yml +7 -3
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/.github/workflows/pypi-package.yml +2 -2
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/.github/workflows/tests.yml +22 -32
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/.pre-commit-config.yaml +9 -11
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/CHANGELOG.md +12 -0
- {hydrotoolbox-2.0.13/src/hydrotoolbox.egg-info → hydrotoolbox-2.1.0}/PKG-INFO +9 -9
- hydrotoolbox-2.1.0/VERSION +1 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/docs/command_line.rst +4 -9
- hydrotoolbox-2.1.0/docs/function_summary.rst +28 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/pyproject.toml +29 -33
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/__init__.py +4 -4
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/methods/__init__.py +4 -4
- hydrotoolbox-2.1.0/src/hydrotoolbox/baseflow/methods/boughton.py +17 -0
- hydrotoolbox-2.1.0/src/hydrotoolbox/baseflow/methods/chapman.py +10 -0
- hydrotoolbox-2.1.0/src/hydrotoolbox/baseflow/methods/chapman_maxwell.py +10 -0
- hydrotoolbox-2.1.0/src/hydrotoolbox/baseflow/methods/furey.py +24 -0
- hydrotoolbox-2.1.0/src/hydrotoolbox/baseflow/methods/general_form.py +56 -0
- hydrotoolbox-2.1.0/src/hydrotoolbox/baseflow/methods/lyne_hollick.py +10 -0
- hydrotoolbox-2.1.0/src/hydrotoolbox/baseflow/methods/willems.py +18 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/separation.py +17 -21
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow_sep.py +7 -9
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/hydrotoolbox.py +11 -11
- hydrotoolbox-2.1.0/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/plotgen.py +43 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/wdm.py +9 -7
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/tsutils.py +165 -185
- hydrotoolbox-2.1.0/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/utils.py +170 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_asbestfreq.py +12 -4
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_period_timestamp.py +46 -27
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_read.py +4 -3
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_wdm.py +21 -3
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0/src/hydrotoolbox.egg-info}/PKG-INFO +9 -9
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox.egg-info/SOURCES.txt +6 -4
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox.egg-info/requires.txt +1 -3
- hydrotoolbox-2.1.0/tests/data_baseflow_chapman.csv +7496 -0
- hydrotoolbox-2.1.0/tests/data_baseflow_chapman_maxwell.csv +7496 -0
- hydrotoolbox-2.1.0/tests/data_baseflow_eckhardt.csv +7496 -0
- hydrotoolbox-2.1.0/tests/data_baseflow_ewma.csv +7496 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_baseflow_furey.csv +10 -10
- hydrotoolbox-2.1.0/tests/data_baseflow_lyne_hollick.csv +7496 -0
- hydrotoolbox-2.1.0/tests/data_baseflow_ukih.csv +7496 -0
- hydrotoolbox-2.1.0/tests/data_baseflow_usgs_hysep_local.csv +7496 -0
- hydrotoolbox-2.1.0/tests/data_baseflow_willems.csv +7496 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/run_test.sh +7 -7
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/test_baseflow_sep.py +7 -8
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/test_exceedance_time.py +7 -2
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/test_flow_duration.py +0 -2
- hydrotoolbox-2.0.13/VERSION +0 -1
- hydrotoolbox-2.0.13/docs/function_summary.rst +0 -29
- hydrotoolbox-2.0.13/src/hydrotoolbox/baseflow/methods/boughton.py +0 -26
- hydrotoolbox-2.0.13/src/hydrotoolbox/baseflow/methods/chapman.py +0 -19
- hydrotoolbox-2.0.13/src/hydrotoolbox/baseflow/methods/cm.py +0 -24
- hydrotoolbox-2.0.13/src/hydrotoolbox/baseflow/methods/furey.py +0 -32
- hydrotoolbox-2.0.13/src/hydrotoolbox/baseflow/methods/lh.py +0 -27
- hydrotoolbox-2.0.13/src/hydrotoolbox/baseflow/methods/willems.py +0 -27
- hydrotoolbox-2.0.13/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/plotgen.py +0 -55
- hydrotoolbox-2.0.13/tests/data_baseflow_chapman.csv +0 -7496
- hydrotoolbox-2.0.13/tests/data_baseflow_cm.csv +0 -7497
- hydrotoolbox-2.0.13/tests/data_baseflow_eckhardt.csv +0 -7496
- hydrotoolbox-2.0.13/tests/data_baseflow_ewma.csv +0 -7496
- hydrotoolbox-2.0.13/tests/data_baseflow_lh.csv +0 -7496
- hydrotoolbox-2.0.13/tests/data_baseflow_ukih.csv +0 -7496
- hydrotoolbox-2.0.13/tests/data_baseflow_usgs_hysep_local.csv +0 -7496
- hydrotoolbox-2.0.13/tests/data_baseflow_willems.csv +0 -7496
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/.deepsource.toml +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/.github/dependabot.yml +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/.gitignore +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/.gitmodules +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/.sourcery.yaml +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/AUTHORS.rst +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/BADGES.rst +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/CONTRIBUTING.rst +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/LICENSE.txt +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/README.rst +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/docs/Makefile +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/docs/authors.rst +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/docs/conf.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/docs/contributing.rst +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/docs/index.rst +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/docs/license.rst +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/docs/make.bat +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/docs/readme.rst +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/pytest.ini +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/setup.cfg +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/__init__.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/comparison.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/example.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/methods/eckhardt.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/methods/ewma.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/methods/five_day.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/methods/fixed.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/methods/ihacres.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/methods/local.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/methods/slide.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/methods/strict.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/methods/ukih.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/param_estimate.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/baseflow/utils.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/indices/indices.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/docs/conf.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/__init__.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/__init__.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/hbn.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_date_slice.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_dateparse.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_extract.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_hbn.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_make_list.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_plotgen.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/toolbox_utils/tests/test_range_to_numlist.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox/utils.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox.egg-info/dependency_links.txt +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox.egg-info/entry_points.txt +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/src/hydrotoolbox.egg-info/top_level.txt +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/BEC_test.sh +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/Q_BEC_BE_6500.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/Q_BEC_BE_6500.ssf +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/black_earth_creek_05406500_flow.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/black_earth_creek_05406500_test.sh +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_02239501.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_baseflow_boughton.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_baseflow_five_day.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_baseflow_ihacres.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_baseflow_strict.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_baseflow_usgs_hysep_fixed.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_baseflow_usgs_hysep_slide.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_percentile_test.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_short.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/data_test_storm_events.csv +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/gtable.out +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/gtable_1955.out +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/hydrotoolbox_indices.txt +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/test_indices.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/test_recession.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/test_storm_events.py +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/tsproc_hydrologic_indices.inp +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/tsproc_hydrologic_indices.rec +0 -0
- {hydrotoolbox-2.0.13 → hydrotoolbox-2.1.0}/tests/tsproc_hydrologic_indices_percentile_test.inp +0 -0
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
|
|
29
29
|
steps:
|
|
30
30
|
- name: Checkout source
|
|
31
|
-
uses: actions/checkout@
|
|
31
|
+
uses: actions/checkout@v6
|
|
32
32
|
with:
|
|
33
33
|
submodules: recursive
|
|
34
34
|
|
|
@@ -38,7 +38,7 @@ jobs:
|
|
|
38
38
|
python -m build
|
|
39
39
|
|
|
40
40
|
- name: Download artifact
|
|
41
|
-
uses: actions/download-artifact@
|
|
41
|
+
uses: actions/download-artifact@v8
|
|
42
42
|
with:
|
|
43
43
|
path: dist
|
|
44
44
|
merge-multiple: true
|
|
@@ -21,46 +21,34 @@ jobs:
|
|
|
21
21
|
fail-fast: false
|
|
22
22
|
matrix:
|
|
23
23
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
24
|
-
python-versions: ['3.
|
|
25
|
-
pandas-versions: [
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
python-versions: ['3.10', '3.11', '3.12', '3.13', '3.14']
|
|
25
|
+
pandas-versions: [pandas<2.0.0, pandas>=2.0.0]
|
|
26
|
+
numpy-versions: [numpy<2.0.0, numpy>=2.0.0]
|
|
27
|
+
|
|
28
28
|
exclude:
|
|
29
|
+
- python-versions: '3.12'
|
|
30
|
+
pandas-versions: pandas<2.0.0
|
|
29
31
|
- python-versions: '3.13'
|
|
30
|
-
pandas-versions:
|
|
31
|
-
- python-versions: '3.
|
|
32
|
-
pandas-versions: 2.0.0
|
|
32
|
+
pandas-versions: pandas<2.0.0
|
|
33
|
+
- python-versions: '3.14'
|
|
34
|
+
pandas-versions: pandas<2.0.0
|
|
35
|
+
- python-versions: '3.12'
|
|
36
|
+
numpy-versions: numpy<2.0.0
|
|
33
37
|
- python-versions: '3.13'
|
|
34
|
-
|
|
35
|
-
- python-versions: '3.
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
- os: windows-latest
|
|
40
|
-
python-versions: '3.8'
|
|
41
|
-
- os: windows-latest
|
|
42
|
-
python-versions: '3.9'
|
|
43
|
-
pandas-versions: 2.2.0
|
|
44
|
-
- os: windows-latest
|
|
45
|
-
python-versions: '3.10'
|
|
46
|
-
pandas-versions: 2.2.0
|
|
47
|
-
- os: windows-latest
|
|
48
|
-
python-versions: '3.11'
|
|
49
|
-
pandas-versions: 2.2.0
|
|
50
|
-
- os: windows-latest
|
|
51
|
-
python-versions: '3.12'
|
|
52
|
-
pandas-versions: 2.2.0
|
|
53
|
-
- os: windows-latest
|
|
54
|
-
python-versions: '3.13'
|
|
38
|
+
numpy-versions: numpy<2.0.0
|
|
39
|
+
- python-versions: '3.14'
|
|
40
|
+
numpy-versions: numpy<2.0.0
|
|
41
|
+
- pandas-versions: pandas<2.0.0
|
|
42
|
+
numpy-versions: numpy>=2.0.0
|
|
55
43
|
|
|
56
44
|
steps:
|
|
57
45
|
- name: Checkout repository
|
|
58
|
-
uses: actions/checkout@
|
|
46
|
+
uses: actions/checkout@v6
|
|
59
47
|
with:
|
|
60
48
|
submodules: recursive
|
|
61
49
|
|
|
62
50
|
- name: Set up Python ${{ matrix.python-versions }}
|
|
63
|
-
uses: actions/setup-python@
|
|
51
|
+
uses: actions/setup-python@v6
|
|
64
52
|
with:
|
|
65
53
|
python-version: ${{ matrix.python-versions }}
|
|
66
54
|
|
|
@@ -74,10 +62,12 @@ jobs:
|
|
|
74
62
|
version ${{ matrix.pandas-versions }}
|
|
75
63
|
run: >
|
|
76
64
|
python -m pip install
|
|
77
|
-
|
|
65
|
+
'${{ matrix.pandas-versions }}'
|
|
66
|
+
'${{ matrix.numpy-versions }}' .
|
|
78
67
|
|
|
79
68
|
- name: Test with pytest
|
|
80
|
-
run:
|
|
69
|
+
run: |
|
|
70
|
+
python -m pytest --cov
|
|
81
71
|
|
|
82
72
|
- name: Upload coverage data to coveralls.io
|
|
83
73
|
uses: coverallsapp/github-action@v2
|
|
@@ -11,7 +11,7 @@ exclude: |
|
|
|
11
11
|
|
|
12
12
|
repos:
|
|
13
13
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
14
|
-
rev:
|
|
14
|
+
rev: v6.0.0
|
|
15
15
|
hooks:
|
|
16
16
|
- id: check-case-conflict
|
|
17
17
|
- id: check-docstring-first
|
|
@@ -23,15 +23,13 @@ repos:
|
|
|
23
23
|
- id: check-xml
|
|
24
24
|
- id: end-of-file-fixer
|
|
25
25
|
exclude: notebooks/tstoolbox_plot_bash.sh
|
|
26
|
-
- id: fix-encoding-pragma
|
|
27
|
-
args: [--remove]
|
|
28
26
|
- id: mixed-line-ending
|
|
29
27
|
- id: trailing-whitespace
|
|
30
28
|
exclude: notebooks/tstoolbox_plot_bash.sh
|
|
31
29
|
|
|
32
30
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
33
31
|
# Ruff version.
|
|
34
|
-
rev: v0.
|
|
32
|
+
rev: v0.15.6
|
|
35
33
|
hooks:
|
|
36
34
|
# Run the linter.
|
|
37
35
|
- id: ruff
|
|
@@ -42,7 +40,7 @@ repos:
|
|
|
42
40
|
types_or: [python, pyi, jupyter]
|
|
43
41
|
|
|
44
42
|
- repo: https://github.com/pycqa/isort
|
|
45
|
-
rev:
|
|
43
|
+
rev: 8.0.1
|
|
46
44
|
hooks:
|
|
47
45
|
- id: isort
|
|
48
46
|
name: isort (python)
|
|
@@ -54,13 +52,13 @@ repos:
|
|
|
54
52
|
types: [pyi]
|
|
55
53
|
|
|
56
54
|
- repo: https://github.com/pappasam/toml-sort
|
|
57
|
-
rev: v0.24.
|
|
55
|
+
rev: v0.24.3
|
|
58
56
|
hooks:
|
|
59
57
|
- id: toml-sort-fix
|
|
60
58
|
args: [--in-place, --spaces-indent-inline-array, '4']
|
|
61
59
|
|
|
62
60
|
- repo: https://github.com/adrienverge/yamllint.git
|
|
63
|
-
rev: v1.
|
|
61
|
+
rev: v1.38.0
|
|
64
62
|
hooks:
|
|
65
63
|
- id: yamllint
|
|
66
64
|
args: [--format, parsable, --strict]
|
|
@@ -77,23 +75,23 @@ repos:
|
|
|
77
75
|
args: [-s, bash]
|
|
78
76
|
|
|
79
77
|
- repo: https://github.com/lovesegfault/beautysh
|
|
80
|
-
rev: v6.
|
|
78
|
+
rev: v6.4.3
|
|
81
79
|
hooks:
|
|
82
80
|
- id: beautysh
|
|
83
81
|
args: [--indent-size, '4']
|
|
84
82
|
|
|
85
83
|
- repo: https://github.com/asottile/blacken-docs
|
|
86
|
-
rev: 1.
|
|
84
|
+
rev: 1.20.0
|
|
87
85
|
hooks:
|
|
88
86
|
- id: blacken-docs
|
|
89
87
|
|
|
90
88
|
- repo: https://github.com/asottile/pyupgrade
|
|
91
|
-
rev: v3.
|
|
89
|
+
rev: v3.21.2
|
|
92
90
|
hooks:
|
|
93
91
|
- id: pyupgrade
|
|
94
92
|
|
|
95
93
|
- repo: https://github.com/commitizen-tools/commitizen
|
|
96
|
-
rev: v4.
|
|
94
|
+
rev: v4.13.9
|
|
97
95
|
hooks:
|
|
98
96
|
- id: commitizen
|
|
99
97
|
stages: [commit-msg]
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hydrotoolbox
|
|
3
|
-
Version: 2.0
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: Command line script and Python library for analysis of flow time-series.
|
|
5
5
|
Author-email: Tim Cera <tim@cerazone.net>
|
|
6
6
|
License: BSD-3-Clause
|
|
7
|
+
Project-URL: bitbucket, https://bitbucket.org/timcera/hydrotoolbox/src/main/
|
|
7
8
|
Project-URL: documentation, https://timcera.bitbucket.io/hydrotoolbox/docs/index.html#hydrotoolbox-documentation
|
|
8
9
|
Project-URL: github, https://github.com/timcera/hydrotoolbox
|
|
9
|
-
|
|
10
|
-
Keywords: time-series,cli-app,hydrology,baseflow,hydrograph-recession,hydrographic
|
|
10
|
+
Keywords: baseflow,cli-app,hydrograph-recession,hydrographic,hydrology,time-series
|
|
11
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
-
Classifier: Intended Audience :: Science/Research
|
|
13
|
-
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
12
|
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
16
|
Classifier: License :: OSI Approved :: BSD License
|
|
17
17
|
Classifier: Natural Language :: English
|
|
18
18
|
Classifier: Operating System :: OS Independent
|
|
19
19
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
23
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
25
|
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
26
26
|
Classifier: Topic :: Scientific/Engineering
|
|
27
27
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
|
-
Requires-Python: >=3.
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
29
|
Description-Content-Type: text/x-rst
|
|
30
30
|
License-File: LICENSE.txt
|
|
31
31
|
Requires-Dist: cltoolbox>=1.0.0
|
|
32
32
|
Requires-Dist: dateparser
|
|
33
|
-
Requires-Dist: numpy
|
|
33
|
+
Requires-Dist: numpy
|
|
34
34
|
Requires-Dist: pandas[excel]
|
|
35
35
|
Requires-Dist: pint!=0.21.*
|
|
36
36
|
Requires-Dist: pint-pandas
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.1.0
|
|
@@ -27,9 +27,9 @@ baseflow_sep chapman
|
|
|
27
27
|
.. program-output:: hydrotoolbox baseflow_sep chapman --help
|
|
28
28
|
:prompt:
|
|
29
29
|
|
|
30
|
-
baseflow_sep
|
|
30
|
+
baseflow_sep chapman_maxwell
|
|
31
31
|
---------------
|
|
32
|
-
.. program-output:: hydrotoolbox baseflow_sep
|
|
32
|
+
.. program-output:: hydrotoolbox baseflow_sep chapman_maxwell --help
|
|
33
33
|
:prompt:
|
|
34
34
|
|
|
35
35
|
baseflow_sep eckhardt
|
|
@@ -57,14 +57,9 @@ baseflow_sep ihacres
|
|
|
57
57
|
.. program-output:: hydrotoolbox baseflow_sep ihacres --help
|
|
58
58
|
:prompt:
|
|
59
59
|
|
|
60
|
-
baseflow_sep
|
|
60
|
+
baseflow_sep lyne_hollick
|
|
61
61
|
---------------
|
|
62
|
-
.. program-output:: hydrotoolbox baseflow_sep
|
|
63
|
-
:prompt:
|
|
64
|
-
|
|
65
|
-
baseflow_sep strict
|
|
66
|
-
-------------------
|
|
67
|
-
.. program-output:: hydrotoolbox baseflow_sep strict --help
|
|
62
|
+
.. program-output:: hydrotoolbox baseflow_sep lyne_hollick --help
|
|
68
63
|
:prompt:
|
|
69
64
|
|
|
70
65
|
baseflow_sep ukih
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.. include:: ../BADGES.rst
|
|
2
|
+
|
|
3
|
+
Python API Function Summary
|
|
4
|
+
===========================
|
|
5
|
+
|
|
6
|
+
.. autosummary::
|
|
7
|
+
:toctree: _function_autosummary
|
|
8
|
+
|
|
9
|
+
hydrotoolbox.hydrotoolbox.about
|
|
10
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.boughton
|
|
11
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.chapman
|
|
12
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.chapman_maxwell
|
|
13
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.eckhardt
|
|
14
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.ewma
|
|
15
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.five_day
|
|
16
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.furey
|
|
17
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.ihacres
|
|
18
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.lyne_hollick
|
|
19
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.ukih
|
|
20
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.usgs_hysep_fixed
|
|
21
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.usgs_hysep_local
|
|
22
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.usgs_hysep_slide
|
|
23
|
+
hydrotoolbox.hydrotoolbox.baseflow_sep.willems
|
|
24
|
+
hydrotoolbox.hydrotoolbox.exceedance_time
|
|
25
|
+
hydrotoolbox.hydrotoolbox.flow_duration
|
|
26
|
+
hydrotoolbox.hydrotoolbox.indices
|
|
27
|
+
hydrotoolbox.hydrotoolbox.recession
|
|
28
|
+
hydrotoolbox.hydrotoolbox.storm_events
|
|
@@ -1,73 +1,71 @@
|
|
|
1
1
|
[build-system]
|
|
2
2
|
build-backend = "setuptools.build_meta"
|
|
3
3
|
requires = [
|
|
4
|
-
"setuptools>=
|
|
5
|
-
"
|
|
6
|
-
"wheel"
|
|
4
|
+
"setuptools-scm[simple]>=8",
|
|
5
|
+
"setuptools>=80"
|
|
7
6
|
]
|
|
8
7
|
|
|
9
8
|
[project]
|
|
10
|
-
name = "hydrotoolbox"
|
|
11
|
-
dynamic = ["version"]
|
|
12
|
-
readme = "README.rst"
|
|
13
|
-
description = "Command line script and Python library for analysis of flow time-series."
|
|
14
|
-
dependencies = [
|
|
15
|
-
"cltoolbox >= 1.0.0",
|
|
16
|
-
"dateparser",
|
|
17
|
-
"numpy <2.0; python_version == '3.9'",
|
|
18
|
-
"pandas[excel]",
|
|
19
|
-
"pint!=0.21.*",
|
|
20
|
-
"pint-pandas",
|
|
21
|
-
"pydantic",
|
|
22
|
-
"scipy",
|
|
23
|
-
"tabulate"
|
|
24
|
-
]
|
|
25
9
|
authors = [
|
|
26
|
-
{
|
|
10
|
+
{email = "tim@cerazone.net", name = "Tim Cera"}
|
|
27
11
|
]
|
|
28
12
|
classifiers = [
|
|
29
13
|
"Development Status :: 5 - Production/Stable",
|
|
30
|
-
"Intended Audience :: Science/Research",
|
|
31
|
-
"Intended Audience :: End Users/Desktop",
|
|
32
|
-
"Intended Audience :: Developers",
|
|
33
14
|
"Environment :: Console",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Intended Audience :: End Users/Desktop",
|
|
17
|
+
"Intended Audience :: Science/Research",
|
|
34
18
|
"License :: OSI Approved :: BSD License",
|
|
35
19
|
"Natural Language :: English",
|
|
36
20
|
"Operating System :: OS Independent",
|
|
37
21
|
"Programming Language :: Python :: 3 :: Only",
|
|
38
|
-
"Programming Language :: Python :: 3.9",
|
|
39
22
|
"Programming Language :: Python :: 3.10",
|
|
40
23
|
"Programming Language :: Python :: 3.11",
|
|
41
24
|
"Programming Language :: Python :: 3.12",
|
|
42
25
|
"Programming Language :: Python :: 3.13",
|
|
26
|
+
"Programming Language :: Python :: 3.14",
|
|
43
27
|
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
44
28
|
"Topic :: Scientific/Engineering",
|
|
45
29
|
"Topic :: Software Development :: Libraries :: Python Modules"
|
|
30
|
+
] # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
|
|
31
|
+
dependencies = [
|
|
32
|
+
"cltoolbox >= 1.0.0",
|
|
33
|
+
"dateparser",
|
|
34
|
+
"numpy",
|
|
35
|
+
"pandas[excel]",
|
|
36
|
+
"pint!=0.21.*",
|
|
37
|
+
"pint-pandas",
|
|
38
|
+
"pydantic",
|
|
39
|
+
"scipy",
|
|
40
|
+
"tabulate"
|
|
46
41
|
]
|
|
42
|
+
description = "Command line script and Python library for analysis of flow time-series."
|
|
43
|
+
dynamic = ["readme", "version"]
|
|
47
44
|
keywords = [
|
|
48
|
-
"time-series",
|
|
49
|
-
"cli-app",
|
|
50
|
-
"hydrology",
|
|
51
45
|
"baseflow",
|
|
46
|
+
"cli-app",
|
|
52
47
|
"hydrograph-recession",
|
|
53
|
-
"hydrographic"
|
|
48
|
+
"hydrographic",
|
|
49
|
+
"hydrology",
|
|
50
|
+
"time-series"
|
|
54
51
|
]
|
|
55
52
|
license = {text = "BSD-3-Clause"}
|
|
56
|
-
|
|
53
|
+
name = "hydrotoolbox"
|
|
54
|
+
requires-python = ">=3.10"
|
|
57
55
|
|
|
58
56
|
[project.scripts]
|
|
59
57
|
hydrotoolbox = "hydrotoolbox.hydrotoolbox:main"
|
|
60
58
|
|
|
61
59
|
[project.urls]
|
|
60
|
+
bitbucket = "https://bitbucket.org/timcera/hydrotoolbox/src/main/"
|
|
62
61
|
documentation = "https://timcera.bitbucket.io/hydrotoolbox/docs/index.html#hydrotoolbox-documentation"
|
|
63
62
|
github = "https://github.com/timcera/hydrotoolbox"
|
|
64
|
-
bitbucket = "https://bitbucket.org/timcera/hydrotoolbox/src/main/"
|
|
65
63
|
|
|
66
64
|
[tool.commitizen]
|
|
67
65
|
name = "cz_conventional_commits"
|
|
68
66
|
tag_format = "v$version"
|
|
69
67
|
update_changelog_on_bump = true
|
|
70
|
-
version = "2.0
|
|
68
|
+
version = "2.1.0"
|
|
71
69
|
version_files = ["VERSION"]
|
|
72
70
|
|
|
73
71
|
[tool.isort]
|
|
@@ -77,8 +75,8 @@ profile = "black"
|
|
|
77
75
|
testpaths = ["tests"]
|
|
78
76
|
|
|
79
77
|
[tool.setuptools]
|
|
80
|
-
license-files = ["LICENSE.txt"]
|
|
81
78
|
include-package-data = true
|
|
79
|
+
license-files = ["LICENSE.txt"]
|
|
82
80
|
|
|
83
81
|
[tool.setuptools.dynamic]
|
|
84
82
|
readme = {file = "README.rst"}
|
|
@@ -86,5 +84,3 @@ version = {file = "VERSION"}
|
|
|
86
84
|
|
|
87
85
|
[tool.setuptools.packages.find]
|
|
88
86
|
where = ["src"]
|
|
89
|
-
|
|
90
|
-
[tool.setuptools_scm]
|
|
@@ -3,14 +3,14 @@ import os
|
|
|
3
3
|
__all__ = [
|
|
4
4
|
"boughton",
|
|
5
5
|
"chapman",
|
|
6
|
-
"
|
|
6
|
+
"chapman_maxwell",
|
|
7
7
|
"eckhardt",
|
|
8
8
|
"ewma",
|
|
9
9
|
"five_day",
|
|
10
10
|
"fixed",
|
|
11
11
|
"furey",
|
|
12
12
|
"ihacres",
|
|
13
|
-
"
|
|
13
|
+
"lyne_hollick",
|
|
14
14
|
"local",
|
|
15
15
|
"slide",
|
|
16
16
|
"strict",
|
|
@@ -29,15 +29,15 @@ from .comparison import KGE, strict_baseflow
|
|
|
29
29
|
from .methods import (
|
|
30
30
|
boughton,
|
|
31
31
|
chapman,
|
|
32
|
-
|
|
32
|
+
chapman_maxwell,
|
|
33
33
|
eckhardt,
|
|
34
34
|
ewma,
|
|
35
35
|
five_day,
|
|
36
36
|
fixed,
|
|
37
37
|
furey,
|
|
38
38
|
ihacres,
|
|
39
|
-
lh,
|
|
40
39
|
local,
|
|
40
|
+
lyne_hollick,
|
|
41
41
|
slide,
|
|
42
42
|
strict,
|
|
43
43
|
ukih,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
__all__ = [
|
|
2
2
|
"boughton",
|
|
3
3
|
"chapman",
|
|
4
|
-
"
|
|
4
|
+
"chapman_maxwell",
|
|
5
5
|
"eckhardt",
|
|
6
6
|
"ewma",
|
|
7
7
|
"five_day",
|
|
8
8
|
"fixed",
|
|
9
9
|
"furey",
|
|
10
10
|
"ihacres",
|
|
11
|
-
"
|
|
11
|
+
"lyne_hollick",
|
|
12
12
|
"local",
|
|
13
13
|
"slide",
|
|
14
14
|
"strict",
|
|
@@ -22,15 +22,15 @@ __all__ = [
|
|
|
22
22
|
|
|
23
23
|
from .boughton import boughton, f_Boughton
|
|
24
24
|
from .chapman import chapman
|
|
25
|
-
from .
|
|
25
|
+
from .chapman_maxwell import chapman_maxwell
|
|
26
26
|
from .eckhardt import eckhardt, f_Eckhardt
|
|
27
27
|
from .ewma import ewma
|
|
28
28
|
from .five_day import five_day
|
|
29
29
|
from .fixed import fixed
|
|
30
30
|
from .furey import f_Furey, furey
|
|
31
31
|
from .ihacres import ihacres
|
|
32
|
-
from .lh import lh
|
|
33
32
|
from .local import local
|
|
33
|
+
from .lyne_hollick import lyne_hollick
|
|
34
34
|
from .slide import slide
|
|
35
35
|
from .strict import strict
|
|
36
36
|
from .ukih import ukih
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from hydrotoolbox.baseflow.methods.general_form import general_form_digital_filter
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def boughton(flow, k, C):
|
|
5
|
+
"""Boughton double-parameter filter (Boughton, 2004)"""
|
|
6
|
+
alpha = k / (1 + C)
|
|
7
|
+
beta = C / (1 + C)
|
|
8
|
+
gamma = 0.0
|
|
9
|
+
|
|
10
|
+
return general_form_digital_filter(flow, alpha, beta, gamma)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def f_Boughton(k):
|
|
14
|
+
def _Boughton(Q, C):
|
|
15
|
+
return boughton(Q, k, C)
|
|
16
|
+
|
|
17
|
+
return _Boughton
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from hydrotoolbox.baseflow.methods.general_form import general_form_digital_filter
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def chapman(flow, k):
|
|
5
|
+
"""Chapman filter (Chapman, 1991)"""
|
|
6
|
+
alpha = (3 * k - 1) / (3 - k)
|
|
7
|
+
beta = (1 - k) / (3 - k)
|
|
8
|
+
gamma = 1.0
|
|
9
|
+
|
|
10
|
+
return general_form_digital_filter(flow, alpha, beta, gamma)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from hydrotoolbox.baseflow.methods.general_form import general_form_digital_filter
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def chapman_maxwell(flow, k):
|
|
5
|
+
"""CM filter (Chapman & Maxwell, 1996)"""
|
|
6
|
+
alpha = k / (2 - k)
|
|
7
|
+
beta = (1 - k) / (2 - k)
|
|
8
|
+
gamma = 0
|
|
9
|
+
|
|
10
|
+
return general_form_digital_filter(flow, alpha, beta, gamma)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def furey(flow, b_LH, k, c3c1):
|
|
5
|
+
"""Furey digital filter (Furey & Gupta, 2001, 2003)"""
|
|
6
|
+
b = np.zeros(flow.shape[0])
|
|
7
|
+
|
|
8
|
+
b[0] = b_LH[0]
|
|
9
|
+
|
|
10
|
+
num_exceed = 0
|
|
11
|
+
for i in range(1, flow.shape[0]):
|
|
12
|
+
b[i] = k * b[i - 1] + (1 - k) * c3c1 * (flow[i - 1] - b[i - 1])
|
|
13
|
+
if b[i] > flow[i]:
|
|
14
|
+
b[i] = flow[i]
|
|
15
|
+
num_exceed += 1
|
|
16
|
+
|
|
17
|
+
return b, num_exceed
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def f_Furey(a):
|
|
21
|
+
def _Furey(Q, b_LH, A):
|
|
22
|
+
return furey(Q, b_LH, a, A)
|
|
23
|
+
|
|
24
|
+
return _Furey
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
from scipy.signal import lfilter, lfilter_zi
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def general_form_digital_filter(flow, alpha, beta, gamma, delta=1):
|
|
6
|
+
"""
|
|
7
|
+
Use a general form digital filter given coefficients alpha, beta, and gamma.
|
|
8
|
+
|
|
9
|
+
The filter is defined by the difference equation::
|
|
10
|
+
|
|
11
|
+
bf[t] = alpha * bf[t-1] + beta * (flow[t] + gamma * flow[t-1])
|
|
12
|
+
|
|
13
|
+
group baseflow terms on left side...
|
|
14
|
+
|
|
15
|
+
bf[t] - alpha * bf[t-1] = beta * flow[t] + beta * gamma * flow[t-1]
|
|
16
|
+
|
|
17
|
+
The scipy filtfilt takes "b" and "a" using the equation::
|
|
18
|
+
|
|
19
|
+
sum for k=0 to N (a[k]*bf[t-k]) = sum for k=0 to M (b[k]*flow[t-k])
|
|
20
|
+
|
|
21
|
+
Since N and M are both 1, expands to...
|
|
22
|
+
|
|
23
|
+
a[0]*bf[t] - a[1]*bf[t-1] = b[0]*flow[t] + b[1]*flow[t-1]
|
|
24
|
+
|
|
25
|
+
Comparing reshaped equations give::
|
|
26
|
+
|
|
27
|
+
b = [beta, beta*gamma]
|
|
28
|
+
a = [1, -alpha]
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
flow : array_like
|
|
33
|
+
Input signal (e.g., streamflow time series).
|
|
34
|
+
alpha
|
|
35
|
+
Parameter for the previous baseflow value.
|
|
36
|
+
beta
|
|
37
|
+
Parameter for the current and previous total flow values.
|
|
38
|
+
gamma
|
|
39
|
+
Parameter for the previous total flow value.
|
|
40
|
+
|
|
41
|
+
Returns
|
|
42
|
+
-------
|
|
43
|
+
baseflow
|
|
44
|
+
The filtered baseflow signal.
|
|
45
|
+
num_exceeds
|
|
46
|
+
The count of baseflow values that exceed the input flow.
|
|
47
|
+
"""
|
|
48
|
+
b = [beta * delta, gamma * beta]
|
|
49
|
+
a = [1.0, -alpha]
|
|
50
|
+
|
|
51
|
+
zi = lfilter_zi(b, a)
|
|
52
|
+
bf = lfilter(b, a, flow, axis=0, zi=zi)[0]
|
|
53
|
+
|
|
54
|
+
num_exceeds = np.count_nonzero(bf > flow)
|
|
55
|
+
bf = np.clip(bf, a_min=0, a_max=flow)
|
|
56
|
+
return bf, num_exceeds
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from hydrotoolbox.baseflow.methods.general_form import general_form_digital_filter
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def lyne_hollick(flow, k):
|
|
5
|
+
"""LH digital filter (Lyne & Hollick, 1979)"""
|
|
6
|
+
alpha = k
|
|
7
|
+
beta = (1 - k) / 2
|
|
8
|
+
gamma = 1.0
|
|
9
|
+
|
|
10
|
+
return general_form_digital_filter(flow, alpha, beta, gamma)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from hydrotoolbox.baseflow.methods.general_form import general_form_digital_filter
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def willems(flow, b_LH, k, w):
|
|
5
|
+
"""Digital filter (Willems, 2009)"""
|
|
6
|
+
v = (1 - w) * (1 - k) / (2 * w)
|
|
7
|
+
alpha = (k - v) / (1 + v)
|
|
8
|
+
beta = v / (1 + v)
|
|
9
|
+
gamma = 1
|
|
10
|
+
|
|
11
|
+
return general_form_digital_filter(flow, alpha, beta, gamma)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def f_Willems(a):
|
|
15
|
+
def _Willems(Q, b_LH, w):
|
|
16
|
+
return willems(Q, b_LH, a, w)
|
|
17
|
+
|
|
18
|
+
return _Willems
|