hydrotoolbox 2.3.1__tar.gz → 2.4.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.4.0/.github/workflows/pypi-package.yml +49 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/.github/workflows/tests.yml +3 -2
- hydrotoolbox-2.4.0/.pre-commit-config.yaml +87 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/BADGES.rst +0 -5
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/CHANGELOG.md +12 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/PKG-INFO +17 -2
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/README.rst +15 -0
- hydrotoolbox-2.4.0/VERSION +1 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/docs/conf.py +3 -1
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/pyproject.toml +22 -2
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/__init__.py +1 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/baseflow/__init__.py +13 -13
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/baseflow/comparison.py +35 -16
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/general_form.py +77 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/baseflow/methods/__init__.py +11 -15
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/boughton.py +48 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/chapman.py +35 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/chapman_maxwell.py +35 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/eckhardt.py +49 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/ewma.py +75 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/baseflow/methods/five_day.py +1 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/furey.py +58 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/ihacres.py +69 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/lyne_hollick.py +57 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/baseflow/methods/ukih.py +24 -4
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/usgs_hysep_fixed.py +42 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/usgs_hysep_local.py +102 -0
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/slide.py → hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/usgs_hysep_slide.py +19 -7
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/methods/willems.py +49 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/param_estimate.py +141 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/separation.py +61 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/baseflow/utils.py +114 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/baseflow_sep.py +362 -225
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/hydrotoolbox.py +100 -159
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/indices/indices.py +101 -6
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/.deepsource.toml +8 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/.github/dependabot.yml +7 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/.github/workflows/clean-workflow-runs.yml +21 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/.github/workflows/tests.yml +87 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/.gitignore +38 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/.sourcery.yaml +77 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/AUTHORS.rst +3 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/BADGES.rst +24 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/CHANGELOG.md +278 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/CONTRIBUTING.rst +105 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/LICENSE.txt +27 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/README.rst +48 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/VERSION +1 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/docs/Makefile +158 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/docs/authors.rst +2 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/docs/contributing.rst +2 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/docs/index.rst +25 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/docs/license.rst +5 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/docs/make.bat +190 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/docs/readme.rst +1 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/pyproject.toml +82 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/tsutils.py +2 -6
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data.wdm +0 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_bi_daily.csv +4 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_bivl.hbn +4 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_end.bivl.csv +17545 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_end.daily.csv +732 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_end.monthly.csv +25 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_end.yearly.csv +52 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_flow_stage.xlsx +0 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_period.bivl.csv +17545 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_period.daily.csv +732 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_period.monthly.csv +25 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_period.yearly.csv +52 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_plotgen.plt +758 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_simple.csv +3 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_start.bivl.csv +17545 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_start.daily.csv +732 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_start.monthly.csv +25 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_start.yearly.csv +52 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_wdm_1.csv +13150 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_wdm_2.csv +11135 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils/tests/data_yearly.hbn +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox.egg-info/PKG-INFO +17 -2
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox.egg-info/SOURCES.txt +53 -7
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox.egg-info/requires.txt +1 -1
- hydrotoolbox-2.4.0/src/hydrotoolbox.egg-info/scm_file_list.json +162 -0
- hydrotoolbox-2.4.0/src/hydrotoolbox.egg-info/scm_version.json +8 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_boughton.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_chapman.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_chapman_maxwell.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_eckhardt.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_ewma.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_five_day.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_furey.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_ihacres.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_lyne_hollick.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_strict.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_ukih.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_usgs_hysep_fixed.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_usgs_hysep_local.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_usgs_hysep_slide.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_baseflow_willems.csv +2000 -0
- hydrotoolbox-2.4.0/tests/data_short.csv +2000 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/run_test.sh +4 -4
- hydrotoolbox-2.4.0/tests/test_baseflow_initialization.py +450 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/test_baseflow_sep.py +28 -6
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/test_exceedance_time.py +2 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/test_flow_duration.py +2 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/test_indices.py +3 -0
- hydrotoolbox-2.4.0/tests/test_lyne_hollick_recurrence.py +117 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/test_recession.py +2 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/test_storm_events.py +2 -0
- hydrotoolbox-2.3.1/VERSION +0 -1
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/boughton.py +0 -21
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/chapman.py +0 -14
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/chapman_maxwell.py +0 -14
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/eckhardt.py +0 -22
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/ewma.py +0 -27
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/fixed.py +0 -30
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/furey.py +0 -28
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/general_form.py +0 -56
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/ihacres.py +0 -31
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/local.py +0 -56
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/lyne_hollick.py +0 -19
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/strict.py +0 -21
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/methods/willems.py +0 -22
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/param_estimate.py +0 -101
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/separation.py +0 -146
- hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow/utils.py +0 -94
- hydrotoolbox-2.3.1/src/hydrotoolbox/utils.py +0 -28
- hydrotoolbox-2.3.1/tests/data_baseflow_boughton.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_chapman.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_chapman_maxwell.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_eckhardt.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_ewma.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_five_day.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_furey.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_ihacres.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_lyne_hollick.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_strict.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_ukih.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_usgs_hysep_fixed.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_usgs_hysep_local.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_usgs_hysep_slide.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_baseflow_willems.csv +0 -7496
- hydrotoolbox-2.3.1/tests/data_short.csv +0 -7496
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/.deepsource.toml +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/.github/dependabot.yml +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/.github/workflows/clean-workflow-runs.yml +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/.gitignore +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/.gitmodules +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/.sourcery.yaml +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/AUTHORS.rst +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/CONTRIBUTING.rst +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/LICENSE.txt +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/docs/Makefile +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/docs/authors.rst +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/docs/command_line.rst +15 -15
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/docs/contributing.rst +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/docs/function_summary.rst +3 -3
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/docs/index.rst +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/docs/license.rst +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/docs/make.bat +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/docs/readme.rst +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/setup.cfg +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/indices/__init__.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils}/.github/workflows/pypi-package.yml +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0/src/hydrotoolbox/toolbox_utils}/.pre-commit-config.yaml +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/docs/conf.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/__init__.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/__init__.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/hbn.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/plotgen.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/utils.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/wdm.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/utils.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_asbestfreq.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_date_slice.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_dateparse.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_extract.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_hbn.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_make_list.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_period_timestamp.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_plotgen.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_range_to_numlist.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_read.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox/toolbox_utils/tests/test_wdm.py +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox.egg-info/dependency_links.txt +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox.egg-info/entry_points.txt +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/src/hydrotoolbox.egg-info/top_level.txt +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/BEC_test.sh +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/Q_BEC_BE_6500.csv +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/Q_BEC_BE_6500.ssf +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/black_earth_creek_05406500_flow.csv +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/black_earth_creek_05406500_test.sh +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/data.csv +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/data_02239501.csv +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/data_percentile_test.csv +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/data_test_storm_events.csv +0 -0
- {hydrotoolbox-2.3.1/src/hydrotoolbox/baseflow → hydrotoolbox-2.4.0/tests}/example.csv +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/gtable.out +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/gtable_1955.out +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/hydrotoolbox_indices.txt +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/tsproc_hydrologic_indices.inp +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/tsproc_hydrologic_indices.rec +0 -0
- {hydrotoolbox-2.3.1 → hydrotoolbox-2.4.0}/tests/tsproc_hydrologic_indices_percentile_test.inp +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
# This workflow will install Python dependencies, run tests and lint with
|
|
3
|
+
# a variety of Python versions For more information see:
|
|
4
|
+
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
5
|
+
|
|
6
|
+
name: PyPI package tests
|
|
7
|
+
|
|
8
|
+
on: # yamllint disable-line rule:truthy
|
|
9
|
+
push:
|
|
10
|
+
branches: [main]
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: [main]
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
tests:
|
|
17
|
+
uses: ./.github/workflows/tests.yml
|
|
18
|
+
|
|
19
|
+
pypi-publish:
|
|
20
|
+
needs: tests
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
environment: release
|
|
23
|
+
name: upload release to PyPI
|
|
24
|
+
|
|
25
|
+
permissions:
|
|
26
|
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
|
27
|
+
id-token: write
|
|
28
|
+
|
|
29
|
+
steps:
|
|
30
|
+
- name: Checkout source
|
|
31
|
+
uses: actions/checkout@v7
|
|
32
|
+
with:
|
|
33
|
+
submodules: recursive
|
|
34
|
+
|
|
35
|
+
- name: Build sdist and wheel
|
|
36
|
+
run: |
|
|
37
|
+
python -m pip install build
|
|
38
|
+
python -m build
|
|
39
|
+
|
|
40
|
+
- name: Download artifact
|
|
41
|
+
uses: actions/download-artifact@v8
|
|
42
|
+
with:
|
|
43
|
+
path: dist
|
|
44
|
+
merge-multiple: true
|
|
45
|
+
|
|
46
|
+
- name: Publish package distributions to PyPI
|
|
47
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
48
|
+
with:
|
|
49
|
+
skip-existing: true
|
|
@@ -43,12 +43,12 @@ jobs:
|
|
|
43
43
|
|
|
44
44
|
steps:
|
|
45
45
|
- name: Checkout repository
|
|
46
|
-
uses: actions/checkout@
|
|
46
|
+
uses: actions/checkout@v7
|
|
47
47
|
with:
|
|
48
48
|
submodules: recursive
|
|
49
49
|
|
|
50
50
|
- name: Set up Python ${{ matrix.python-versions }}
|
|
51
|
-
uses: actions/setup-python@
|
|
51
|
+
uses: actions/setup-python@v7
|
|
52
52
|
with:
|
|
53
53
|
python-version: ${{ matrix.python-versions }}
|
|
54
54
|
|
|
@@ -73,6 +73,7 @@ jobs:
|
|
|
73
73
|
uses: coverallsapp/github-action@v2
|
|
74
74
|
with:
|
|
75
75
|
parallel: true
|
|
76
|
+
fail-on-error: false
|
|
76
77
|
|
|
77
78
|
finish:
|
|
78
79
|
needs: test
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
# See https://pre-commit.com for more information
|
|
3
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
|
4
|
+
|
|
5
|
+
exclude: |
|
|
6
|
+
(?x)^(
|
|
7
|
+
.*\.dods|
|
|
8
|
+
.*\.dmr|
|
|
9
|
+
.*\.dmd|
|
|
10
|
+
.*\.wdm|
|
|
11
|
+
.*\.hbn
|
|
12
|
+
)$
|
|
13
|
+
|
|
14
|
+
repos:
|
|
15
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
16
|
+
rev: v6.0.0
|
|
17
|
+
hooks:
|
|
18
|
+
- id: check-case-conflict
|
|
19
|
+
- id: check-docstring-first
|
|
20
|
+
- id: check-executables-have-shebangs
|
|
21
|
+
- id: check-json
|
|
22
|
+
- id: check-merge-conflict
|
|
23
|
+
- id: check-shebang-scripts-are-executable
|
|
24
|
+
- id: check-toml
|
|
25
|
+
- id: check-xml
|
|
26
|
+
- id: end-of-file-fixer
|
|
27
|
+
exclude: notebooks/tstoolbox_plot_bash.sh
|
|
28
|
+
- id: mixed-line-ending
|
|
29
|
+
- id: trailing-whitespace
|
|
30
|
+
exclude: notebooks/tstoolbox_plot_bash.sh
|
|
31
|
+
|
|
32
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
33
|
+
# Ruff version.
|
|
34
|
+
rev: v0.16.5
|
|
35
|
+
hooks:
|
|
36
|
+
# Run the linter.
|
|
37
|
+
- id: ruff
|
|
38
|
+
types_or: [python, pyi, jupyter]
|
|
39
|
+
args: [--fix]
|
|
40
|
+
# Run the formatter.
|
|
41
|
+
- id: ruff-format
|
|
42
|
+
types_or: [python, pyi, jupyter]
|
|
43
|
+
|
|
44
|
+
- repo: https://github.com/pappasam/toml-sort
|
|
45
|
+
rev: v0.24.4
|
|
46
|
+
hooks:
|
|
47
|
+
- id: toml-sort-fix
|
|
48
|
+
args: [--in-place, --spaces-indent-inline-array, '4']
|
|
49
|
+
|
|
50
|
+
- repo: https://github.com/adrienverge/yamllint.git
|
|
51
|
+
rev: v1.38.0
|
|
52
|
+
hooks:
|
|
53
|
+
- id: yamllint
|
|
54
|
+
args: [--format, parsable, --strict]
|
|
55
|
+
|
|
56
|
+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
|
|
57
|
+
rev: 0.2.3
|
|
58
|
+
hooks:
|
|
59
|
+
- id: yamlfmt
|
|
60
|
+
|
|
61
|
+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
|
62
|
+
rev: 3.0.0
|
|
63
|
+
hooks:
|
|
64
|
+
- id: shellcheck
|
|
65
|
+
args: [-s, bash]
|
|
66
|
+
|
|
67
|
+
- repo: https://github.com/lovesegfault/beautysh
|
|
68
|
+
rev: v6.4.3
|
|
69
|
+
hooks:
|
|
70
|
+
- id: beautysh
|
|
71
|
+
args: [--indent-size, '4']
|
|
72
|
+
|
|
73
|
+
- repo: https://github.com/asottile/blacken-docs
|
|
74
|
+
rev: 1.20.0
|
|
75
|
+
hooks:
|
|
76
|
+
- id: blacken-docs
|
|
77
|
+
|
|
78
|
+
- repo: https://github.com/asottile/pyupgrade
|
|
79
|
+
rev: v3.21.2
|
|
80
|
+
hooks:
|
|
81
|
+
- id: pyupgrade
|
|
82
|
+
|
|
83
|
+
- repo: https://github.com/commitizen-tools/commitizen
|
|
84
|
+
rev: v4.18.0
|
|
85
|
+
hooks:
|
|
86
|
+
- id: commitizen
|
|
87
|
+
stages: [commit-msg]
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
.. image:: https://github.com/timcera/hydrotoolbox/actions/workflows/pypi-package.yml/badge.svg
|
|
2
|
-
:alt: Tests
|
|
3
|
-
:target: https://github.com/timcera/hydrotoolbox/actions/workflows/pypi-package.yml
|
|
4
|
-
:height: 20
|
|
5
|
-
|
|
6
1
|
.. image:: https://img.shields.io/coveralls/github/timcera/hydrotoolbox
|
|
7
2
|
:alt: Test Coverage
|
|
8
3
|
:target: https://coveralls.io/r/timcera/hydrotoolbox?branch=master
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## v2.4.0 (2026-11-09)
|
|
2
|
+
|
|
3
|
+
### Feat
|
|
4
|
+
|
|
5
|
+
- **baseflow_sep**: reworked all aspect of the baseflow_sep functionality
|
|
6
|
+
|
|
7
|
+
## v2.3.2 (2026-06-11)
|
|
8
|
+
|
|
9
|
+
### Fix
|
|
10
|
+
|
|
11
|
+
- update toolbox_utils to support numpy 1.*
|
|
12
|
+
|
|
1
13
|
## v2.3.1 (2026-06-11)
|
|
2
14
|
|
|
3
15
|
## v2.3.0 (2026-06-09)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hydrotoolbox
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.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
|
|
@@ -34,7 +34,7 @@ Requires-Dist: numpy
|
|
|
34
34
|
Requires-Dist: pandas[excel]
|
|
35
35
|
Requires-Dist: pint!=0.21.*
|
|
36
36
|
Requires-Dist: pint-pandas
|
|
37
|
-
Requires-Dist: pydantic
|
|
37
|
+
Requires-Dist: pydantic>=2.0
|
|
38
38
|
Requires-Dist: scipy
|
|
39
39
|
Requires-Dist: tabulate
|
|
40
40
|
Dynamic: license-file
|
|
@@ -70,6 +70,21 @@ The hydrotoolbox is a Python script for hydrologic calculations and analysis
|
|
|
70
70
|
or by function calls within Python. Uses pandas (http://pandas.pydata.org/)
|
|
71
71
|
or numpy (http://numpy.scipy.org) for any heavy lifting.
|
|
72
72
|
|
|
73
|
+
The "baseflow_sep" code is based on the work of Xie et al. (2024) and
|
|
74
|
+
Xie et al. (2020), from the code repository at
|
|
75
|
+
https://github.com/xiejx5/baseflow. It was refactored to not use numba, and
|
|
76
|
+
instead use scipy.signal.lfilter where possible, and to be more modular.
|
|
77
|
+
|
|
78
|
+
Xie, J., Liu, X., Jasechko, S., Berghuijs, W. R., Wang, K., Liu, C.,
|
|
79
|
+
Reichstein, M., Jung, M., & Koirala, S. (2024). Majority of global river
|
|
80
|
+
flow sustained by groundwater. Nature Geoscience, 17(8), 770–777.
|
|
81
|
+
https://doi.org/10.1038/s41561-024-01483-5
|
|
82
|
+
|
|
83
|
+
Xie, J., Liu, X., Wang, K., Yang, T., Liang, K., & Liu, C. (2020).
|
|
84
|
+
Evaluation of typical methods for baseflow separation in the contiguous
|
|
85
|
+
United States. Journal of Hydrology, 583, 124628.
|
|
86
|
+
https://doi.org/10.1016/j.jhydrol.2020.124628
|
|
87
|
+
|
|
73
88
|
Requirements
|
|
74
89
|
------------
|
|
75
90
|
* python 3.10 or higher
|
|
@@ -29,6 +29,21 @@ The hydrotoolbox is a Python script for hydrologic calculations and analysis
|
|
|
29
29
|
or by function calls within Python. Uses pandas (http://pandas.pydata.org/)
|
|
30
30
|
or numpy (http://numpy.scipy.org) for any heavy lifting.
|
|
31
31
|
|
|
32
|
+
The "baseflow_sep" code is based on the work of Xie et al. (2024) and
|
|
33
|
+
Xie et al. (2020), from the code repository at
|
|
34
|
+
https://github.com/xiejx5/baseflow. It was refactored to not use numba, and
|
|
35
|
+
instead use scipy.signal.lfilter where possible, and to be more modular.
|
|
36
|
+
|
|
37
|
+
Xie, J., Liu, X., Jasechko, S., Berghuijs, W. R., Wang, K., Liu, C.,
|
|
38
|
+
Reichstein, M., Jung, M., & Koirala, S. (2024). Majority of global river
|
|
39
|
+
flow sustained by groundwater. Nature Geoscience, 17(8), 770–777.
|
|
40
|
+
https://doi.org/10.1038/s41561-024-01483-5
|
|
41
|
+
|
|
42
|
+
Xie, J., Liu, X., Wang, K., Yang, T., Liang, K., & Liu, C. (2020).
|
|
43
|
+
Evaluation of typical methods for baseflow separation in the contiguous
|
|
44
|
+
United States. Journal of Hydrology, 583, 124628.
|
|
45
|
+
https://doi.org/10.1016/j.jhydrol.2020.124628
|
|
46
|
+
|
|
32
47
|
Requirements
|
|
33
48
|
------------
|
|
34
49
|
* python 3.10 or higher
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.4.0
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
# All configuration values have a default; values that are commented out
|
|
11
11
|
# serve to show the default.
|
|
12
12
|
|
|
13
|
+
# Standard library imports
|
|
13
14
|
import os
|
|
14
15
|
|
|
15
16
|
# If extensions (or modules to document with autodoc) are in another directory,
|
|
@@ -58,7 +59,8 @@ copyright = "2013, Tim Cera, P.E."
|
|
|
58
59
|
# built documents.
|
|
59
60
|
#
|
|
60
61
|
# The short X.Y version.
|
|
61
|
-
|
|
62
|
+
with open(os.path.join(os.path.pardir, "VERSION"), encoding="ascii") as vers:
|
|
63
|
+
version = vers.readline().strip()
|
|
62
64
|
# The full version, including alpha/beta/rc tags.
|
|
63
65
|
release = version
|
|
64
66
|
|
|
@@ -35,7 +35,7 @@ dependencies = [
|
|
|
35
35
|
"pandas[excel]",
|
|
36
36
|
"pint!=0.21.*",
|
|
37
37
|
"pint-pandas",
|
|
38
|
-
"pydantic",
|
|
38
|
+
"pydantic >= 2.0",
|
|
39
39
|
"scipy",
|
|
40
40
|
"tabulate"
|
|
41
41
|
]
|
|
@@ -62,18 +62,38 @@ documentation = "https://timcera.bitbucket.io/hydrotoolbox/docs/index.html#hydro
|
|
|
62
62
|
github = "https://github.com/timcera/hydrotoolbox"
|
|
63
63
|
|
|
64
64
|
[tool.commitizen]
|
|
65
|
+
multiline = true
|
|
65
66
|
name = "cz_conventional_commits"
|
|
66
67
|
tag_format = "v$version"
|
|
67
68
|
update_changelog_on_bump = true
|
|
68
|
-
version = "2.
|
|
69
|
+
version = "2.4.0"
|
|
69
70
|
version_files = ["VERSION"]
|
|
70
71
|
|
|
71
72
|
[tool.isort]
|
|
72
73
|
profile = "black"
|
|
73
74
|
|
|
75
|
+
[tool.jupytext]
|
|
76
|
+
formats = "auto:percent"
|
|
77
|
+
|
|
74
78
|
[tool.pytest.ini_options]
|
|
75
79
|
testpaths = ["tests"]
|
|
76
80
|
|
|
81
|
+
[tool.ruff]
|
|
82
|
+
exclude = [
|
|
83
|
+
"src/hydrotoolbox/toolbox_utils"
|
|
84
|
+
]
|
|
85
|
+
fix = true
|
|
86
|
+
|
|
87
|
+
[tool.ruff.lint]
|
|
88
|
+
extend-select = ["I"]
|
|
89
|
+
|
|
90
|
+
[tool.ruff.lint.isort.import-heading]
|
|
91
|
+
first-party = "First party imports"
|
|
92
|
+
future = "Future imports"
|
|
93
|
+
local-folder = "Local folder imports"
|
|
94
|
+
standard-library = "Standard library imports"
|
|
95
|
+
third-party = "Third party imports"
|
|
96
|
+
|
|
77
97
|
[tool.setuptools]
|
|
78
98
|
include-package-data = true
|
|
79
99
|
license-files = ["LICENSE.txt"]
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
+
# Standard library imports
|
|
1
2
|
import os
|
|
2
3
|
|
|
3
4
|
__all__ = [
|
|
5
|
+
"KGE",
|
|
4
6
|
"boughton",
|
|
5
7
|
"chapman",
|
|
6
8
|
"chapman_maxwell",
|
|
7
9
|
"eckhardt",
|
|
8
10
|
"ewma",
|
|
9
11
|
"five_day",
|
|
10
|
-
"fixed",
|
|
11
12
|
"furey",
|
|
12
13
|
"ihacres",
|
|
13
14
|
"lyne_hollick",
|
|
14
|
-
"
|
|
15
|
-
"slide",
|
|
16
|
-
"strict",
|
|
17
|
-
"ukih",
|
|
18
|
-
"willems",
|
|
19
|
-
"recession_coefficient",
|
|
15
|
+
"maximum_BFI",
|
|
20
16
|
"param_calibrate",
|
|
17
|
+
"recession_coefficient",
|
|
21
18
|
"recession_period",
|
|
22
|
-
"maximum_BFI",
|
|
23
19
|
"separation",
|
|
24
20
|
"strict_baseflow",
|
|
25
|
-
"
|
|
21
|
+
"ukih",
|
|
22
|
+
"usgs_hysep_fixed",
|
|
23
|
+
"usgs_hysep_local",
|
|
24
|
+
"usgs_hysep_slide",
|
|
25
|
+
"willems",
|
|
26
26
|
]
|
|
27
27
|
|
|
28
|
+
# Local folder imports
|
|
28
29
|
from .comparison import KGE, strict_baseflow
|
|
29
30
|
from .methods import (
|
|
30
31
|
boughton,
|
|
@@ -33,14 +34,13 @@ from .methods import (
|
|
|
33
34
|
eckhardt,
|
|
34
35
|
ewma,
|
|
35
36
|
five_day,
|
|
36
|
-
fixed,
|
|
37
37
|
furey,
|
|
38
38
|
ihacres,
|
|
39
|
-
local,
|
|
40
39
|
lyne_hollick,
|
|
41
|
-
slide,
|
|
42
|
-
strict,
|
|
43
40
|
ukih,
|
|
41
|
+
usgs_hysep_fixed,
|
|
42
|
+
usgs_hysep_local,
|
|
43
|
+
usgs_hysep_slide,
|
|
44
44
|
willems,
|
|
45
45
|
)
|
|
46
46
|
from .param_estimate import (
|
|
@@ -3,6 +3,7 @@ __all__ = [
|
|
|
3
3
|
"strict_baseflow",
|
|
4
4
|
]
|
|
5
5
|
|
|
6
|
+
# Third party imports
|
|
6
7
|
import numpy as np
|
|
7
8
|
|
|
8
9
|
|
|
@@ -37,23 +38,41 @@ def strict_baseflow(Q):
|
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
def KGE(simulations, evaluation):
|
|
40
|
-
"""
|
|
41
|
-
|
|
41
|
+
"""Calculate original Kling-Gupta Efficiency (KGE).
|
|
42
|
+
|
|
43
|
+
The KGE and its components (r, α, β) follow `Gupta et al., 2009
|
|
42
44
|
<https://doi.org/10.1016/j.jhydrol.2009.08.003>`_.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
|
|
46
|
+
Parameters
|
|
47
|
+
----------
|
|
48
|
+
simulations : array_like
|
|
49
|
+
Simulated values, with time along the first axis.
|
|
50
|
+
evaluation : array_like
|
|
51
|
+
Observed values, with time along the first axis.
|
|
52
|
+
|
|
53
|
+
Returns
|
|
54
|
+
-------
|
|
55
|
+
float or ndarray
|
|
56
|
+
KGE for each series.
|
|
57
|
+
|
|
58
|
+
Notes
|
|
59
|
+
-----
|
|
60
|
+
.. math::
|
|
61
|
+
E_{\\text{KGE}} = 1 - \\sqrt{[r - 1]^2 + [\\alpha - 1]^2
|
|
62
|
+
+ [\\beta - 1]^2}
|
|
63
|
+
|
|
64
|
+
.. math::
|
|
65
|
+
r = \\frac{\\text{cov}(e, s)}{\\sigma({e}) \\cdot \\sigma(s)}
|
|
66
|
+
|
|
67
|
+
.. math::
|
|
68
|
+
\\alpha = \\frac{\\sigma(s)}{\\sigma(e)}
|
|
69
|
+
|
|
70
|
+
.. math::
|
|
71
|
+
\\beta = \\frac{\\mu(s)}{\\mu(e)}
|
|
72
|
+
|
|
73
|
+
Here *e* is the *evaluation* series, *s* is (one of) the
|
|
74
|
+
*simulations* series, *cov* is the covariance, *σ* is the
|
|
75
|
+
standard deviation, and *μ* is the arithmetic mean.
|
|
57
76
|
"""
|
|
58
77
|
# calculate error in timing and dynamics r
|
|
59
78
|
# (Pearson's correlation coefficient)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Third party imports
|
|
2
|
+
import numpy as np
|
|
3
|
+
from scipy.signal import lfilter
|
|
4
|
+
|
|
5
|
+
# First party imports
|
|
6
|
+
from hydrotoolbox.baseflow.utils import BaseflowInitialMethod, _init_baseflow
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def general_form_digital_filter(
|
|
10
|
+
flow, alpha, beta, gamma, delta=1, b0_method: BaseflowInitialMethod = "zi", k=None
|
|
11
|
+
):
|
|
12
|
+
"""
|
|
13
|
+
Use a general form digital filter given coefficients alpha, beta, gamma, and delta.
|
|
14
|
+
|
|
15
|
+
The filter is defined by the difference equation::
|
|
16
|
+
|
|
17
|
+
bf[t] = alpha * bf[t-1] + beta * (delta * flow[t] + gamma * flow[t-1])
|
|
18
|
+
|
|
19
|
+
group baseflow terms on left side...
|
|
20
|
+
|
|
21
|
+
bf[t] - alpha * bf[t-1] = beta * delta * flow[t] + beta * gamma * flow[t-1]
|
|
22
|
+
|
|
23
|
+
The scipy lfilter takes "b" and "a" using the equation::
|
|
24
|
+
|
|
25
|
+
sum for k=0 to N (a[k]*bf[t-k]) = sum for k=0 to M (b[k]*flow[t-k])
|
|
26
|
+
|
|
27
|
+
Since N and M are both 1, expands to...
|
|
28
|
+
|
|
29
|
+
a[0]*bf[t] + a[1]*bf[t-1] = b[0]*flow[t] + b[1]*flow[t-1]
|
|
30
|
+
|
|
31
|
+
Comparing reshaped equations give::
|
|
32
|
+
|
|
33
|
+
b = [beta*delta, beta*gamma]
|
|
34
|
+
a = [1, -alpha]
|
|
35
|
+
|
|
36
|
+
Parameters
|
|
37
|
+
----------
|
|
38
|
+
flow : array_like
|
|
39
|
+
Input signal (e.g., streamflow time series).
|
|
40
|
+
alpha
|
|
41
|
+
Parameter for the previous baseflow value.
|
|
42
|
+
beta
|
|
43
|
+
Parameter for the current and previous total flow values.
|
|
44
|
+
gamma
|
|
45
|
+
Parameter for the previous total flow value.
|
|
46
|
+
delta : float, optional
|
|
47
|
+
Multiplier for the current total flow value (default is 1).
|
|
48
|
+
b0_method : {"Q0", "min", "LH", "zi"} or float, optional
|
|
49
|
+
Initial baseflow. "zi" uses the SciPy steady-state filter
|
|
50
|
+
initialization. Numeric strings are also accepted.
|
|
51
|
+
k : float, optional
|
|
52
|
+
Recession coefficient used when b0_method is "LH".
|
|
53
|
+
|
|
54
|
+
Returns
|
|
55
|
+
-------
|
|
56
|
+
baseflow
|
|
57
|
+
The filtered baseflow signal.
|
|
58
|
+
num_exceeds
|
|
59
|
+
The count of baseflow values that exceed the input flow.
|
|
60
|
+
|
|
61
|
+
Notes
|
|
62
|
+
-----
|
|
63
|
+
The selected initial value is used as the first unbounded filter output.
|
|
64
|
+
Clipping to the flow is applied after filtering, as for all other outputs.
|
|
65
|
+
"""
|
|
66
|
+
b = [beta * delta, gamma * beta]
|
|
67
|
+
a = [1.0, -alpha]
|
|
68
|
+
|
|
69
|
+
b0 = _init_baseflow(
|
|
70
|
+
flow, b0_method, k=k, alpha=alpha, beta=beta, gamma=gamma, delta=delta
|
|
71
|
+
)
|
|
72
|
+
zi = np.array([b0 - b[0] * flow[0]])
|
|
73
|
+
bf = lfilter(b, a, flow, axis=0, zi=zi)[0]
|
|
74
|
+
|
|
75
|
+
num_exceeds = np.count_nonzero(bf > flow)
|
|
76
|
+
bf = np.clip(bf, a_min=0, a_max=flow)
|
|
77
|
+
return bf, num_exceeds
|
|
@@ -5,33 +5,29 @@ __all__ = [
|
|
|
5
5
|
"eckhardt",
|
|
6
6
|
"ewma",
|
|
7
7
|
"five_day",
|
|
8
|
-
"fixed",
|
|
9
8
|
"furey",
|
|
10
9
|
"ihacres",
|
|
11
10
|
"lyne_hollick",
|
|
12
|
-
"local",
|
|
13
|
-
"slide",
|
|
14
11
|
"strict",
|
|
15
12
|
"ukih",
|
|
13
|
+
"usgs_hysep_fixed",
|
|
14
|
+
"usgs_hysep_local",
|
|
15
|
+
"usgs_hysep_slide",
|
|
16
16
|
"willems",
|
|
17
|
-
"f_Boughton",
|
|
18
|
-
"f_Eckhardt",
|
|
19
|
-
"f_Furey",
|
|
20
|
-
"f_Willems",
|
|
21
17
|
]
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
# Local folder imports
|
|
20
|
+
from .boughton import boughton
|
|
24
21
|
from .chapman import chapman
|
|
25
22
|
from .chapman_maxwell import chapman_maxwell
|
|
26
|
-
from .eckhardt import eckhardt
|
|
23
|
+
from .eckhardt import eckhardt
|
|
27
24
|
from .ewma import ewma
|
|
28
25
|
from .five_day import five_day
|
|
29
|
-
from .
|
|
30
|
-
from .furey import f_Furey, furey
|
|
26
|
+
from .furey import furey
|
|
31
27
|
from .ihacres import ihacres
|
|
32
|
-
from .local import local
|
|
33
28
|
from .lyne_hollick import lyne_hollick
|
|
34
|
-
from .slide import slide
|
|
35
|
-
from .strict import strict
|
|
36
29
|
from .ukih import ukih
|
|
37
|
-
from .
|
|
30
|
+
from .usgs_hysep_fixed import usgs_hysep_fixed
|
|
31
|
+
from .usgs_hysep_local import usgs_hysep_local
|
|
32
|
+
from .usgs_hysep_slide import usgs_hysep_slide
|
|
33
|
+
from .willems import willems
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
__all__ = [
|
|
2
|
+
"boughton",
|
|
3
|
+
]
|
|
4
|
+
|
|
5
|
+
# Third party imports
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
8
|
+
# First party imports
|
|
9
|
+
from hydrotoolbox.baseflow.general_form import general_form_digital_filter
|
|
10
|
+
from hydrotoolbox.baseflow.param_estimate import param_calibrate, resolve_k
|
|
11
|
+
from hydrotoolbox.baseflow.utils import BaseflowInitialMethod
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _boughton(flow, k, C, b0_method: BaseflowInitialMethod = "zi"):
|
|
15
|
+
alpha = k / (1 + C)
|
|
16
|
+
beta = C / (1 + C)
|
|
17
|
+
gamma = 0.0
|
|
18
|
+
return general_form_digital_filter(
|
|
19
|
+
flow, alpha, beta, gamma, b0_method=b0_method, k=k
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def boughton(flow, k=None, C=None, b0_method: BaseflowInitialMethod = "zi"):
|
|
24
|
+
"""Boughton double-parameter filter (Boughton, 2004).
|
|
25
|
+
|
|
26
|
+
Parameters
|
|
27
|
+
----------
|
|
28
|
+
flow : ndarray
|
|
29
|
+
Streamflow.
|
|
30
|
+
k : float, optional
|
|
31
|
+
Recession coefficient, estimated if None.
|
|
32
|
+
C : float, optional
|
|
33
|
+
Filter parameter, calibrated if None.
|
|
34
|
+
b0_method : {"Q0", "min", "LH", "zi"} or float, optional
|
|
35
|
+
Initial baseflow method or value. "zi" uses SciPy filter
|
|
36
|
+
initialization. Numeric strings are also accepted.
|
|
37
|
+
|
|
38
|
+
Returns
|
|
39
|
+
-------
|
|
40
|
+
ndarray
|
|
41
|
+
Separated baseflow.
|
|
42
|
+
"""
|
|
43
|
+
k = resolve_k(flow, k)
|
|
44
|
+
if C is None:
|
|
45
|
+
C = param_calibrate(
|
|
46
|
+
np.arange(0.001, 1, 0.001), _boughton, flow, k, b0_method=b0_method
|
|
47
|
+
)
|
|
48
|
+
return _boughton(flow, k, float(C), b0_method=b0_method)[0]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
__all__ = [
|
|
2
|
+
"chapman",
|
|
3
|
+
]
|
|
4
|
+
|
|
5
|
+
# First party imports
|
|
6
|
+
from hydrotoolbox.baseflow.general_form import general_form_digital_filter
|
|
7
|
+
from hydrotoolbox.baseflow.param_estimate import resolve_k
|
|
8
|
+
from hydrotoolbox.baseflow.utils import BaseflowInitialMethod
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def chapman(flow, k=None, b0_method: BaseflowInitialMethod = "zi"):
|
|
12
|
+
"""Chapman filter (Chapman, 1991).
|
|
13
|
+
|
|
14
|
+
Parameters
|
|
15
|
+
----------
|
|
16
|
+
flow : ndarray
|
|
17
|
+
Streamflow.
|
|
18
|
+
k : float, optional
|
|
19
|
+
Recession coefficient, estimated if None.
|
|
20
|
+
b0_method : {"Q0", "min", "LH", "zi"} or float, optional
|
|
21
|
+
Initial baseflow method or value. "zi" uses SciPy filter
|
|
22
|
+
initialization. Numeric strings are also accepted.
|
|
23
|
+
|
|
24
|
+
Returns
|
|
25
|
+
-------
|
|
26
|
+
ndarray
|
|
27
|
+
Separated baseflow.
|
|
28
|
+
"""
|
|
29
|
+
k = resolve_k(flow, k)
|
|
30
|
+
alpha = (3 * k - 1) / (3 - k)
|
|
31
|
+
beta = (1 - k) / (3 - k)
|
|
32
|
+
gamma = 1.0
|
|
33
|
+
return general_form_digital_filter(
|
|
34
|
+
flow, alpha, beta, gamma, b0_method=b0_method, k=k
|
|
35
|
+
)[0]
|