sparsehydro 0.0.0__tar.gz → 1.0.0b1__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.
- sparsehydro-1.0.0b1/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- sparsehydro-1.0.0b1/.github/ISSUE_TEMPLATE/config.yml +8 -0
- sparsehydro-1.0.0b1/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
- sparsehydro-1.0.0b1/.github/PULL_REQUEST_TEMPLATE.md +37 -0
- sparsehydro-1.0.0b1/.github/scripts/check_release.py +68 -0
- sparsehydro-1.0.0b1/.github/workflows/docs.yml +58 -0
- sparsehydro-1.0.0b1/.github/workflows/publish.yml +94 -0
- sparsehydro-1.0.0b1/.github/workflows/tests.yml +73 -0
- sparsehydro-1.0.0b1/.gitignore +60 -0
- sparsehydro-1.0.0b1/CHANGELOG.md +274 -0
- sparsehydro-1.0.0b1/CODE_OF_CONDUCT.md +83 -0
- sparsehydro-1.0.0b1/CONTRIBUTING.md +293 -0
- sparsehydro-1.0.0b1/DESIGN.md +161 -0
- sparsehydro-1.0.0b1/LICENSE +21 -0
- sparsehydro-1.0.0b1/PKG-INFO +502 -0
- sparsehydro-1.0.0b1/README.md +412 -0
- sparsehydro-1.0.0b1/RELEASING.md +109 -0
- sparsehydro-1.0.0b1/docs/.nojekyll +0 -0
- sparsehydro-1.0.0b1/docs/Makefile +19 -0
- sparsehydro-1.0.0b1/docs/_assets/qaqc_figure_01.png +0 -0
- sparsehydro-1.0.0b1/docs/_assets/qaqc_figure_02.png +0 -0
- sparsehydro-1.0.0b1/docs/_assets/qaqc_figure_03.png +0 -0
- sparsehydro-1.0.0b1/docs/_assets/qaqc_figure_04.png +0 -0
- sparsehydro-1.0.0b1/docs/_assets/qaqc_figure_05.png +0 -0
- sparsehydro-1.0.0b1/docs/_assets/qaqc_figure_06.png +0 -0
- sparsehydro-1.0.0b1/docs/_static/sparsehydro.css +228 -0
- sparsehydro-1.0.0b1/docs/api.rst +1102 -0
- sparsehydro-1.0.0b1/docs/build_docx.py +81 -0
- sparsehydro-1.0.0b1/docs/combined_model.md +216 -0
- sparsehydro-1.0.0b1/docs/composition.md +268 -0
- sparsehydro-1.0.0b1/docs/conf.py +216 -0
- sparsehydro-1.0.0b1/docs/ensemble_visualization_plan.md +210 -0
- sparsehydro-1.0.0b1/docs/getting_started.rst +879 -0
- sparsehydro-1.0.0b1/docs/index.rst +256 -0
- sparsehydro-1.0.0b1/docs/make.bat +40 -0
- sparsehydro-1.0.0b1/docs/parsimonious_integration_plan.md +139 -0
- sparsehydro-1.0.0b1/docs/rdii_design.md +325 -0
- sparsehydro-1.0.0b1/docs/unit_hydrographs.md +257 -0
- sparsehydro-1.0.0b1/environment.yml +23 -0
- sparsehydro-1.0.0b1/examples/01_fit_unit_hydrograph.py +71 -0
- sparsehydro-1.0.0b1/examples/02_compare_unit_hydrographs.py +68 -0
- sparsehydro-1.0.0b1/examples/03_composite_from_config.py +102 -0
- sparsehydro-1.0.0b1/examples/04_events_and_event_scores.py +70 -0
- sparsehydro-1.0.0b1/examples/README.md +22 -0
- sparsehydro-1.0.0b1/pyproject.toml +132 -0
- sparsehydro-1.0.0b1/pyrightconfig.json +8 -0
- sparsehydro-1.0.0b1/requirements.txt +0 -0
- sparsehydro-1.0.0b1/sparsehydro/__init__.py +44 -0
- sparsehydro-1.0.0b1/sparsehydro/_columns.py +51 -0
- sparsehydro-1.0.0b1/sparsehydro/_numba.py +30 -0
- sparsehydro-1.0.0b1/sparsehydro/_validation.py +37 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/__init__.py +184 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/callbacks.py +84 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/diagnostics.py +359 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/problem.py +682 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/result.py +208 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/selection.py +195 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/sequential.py +840 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/solvers/__init__.py +31 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/solvers/base.py +54 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/solvers/cmaes_solver.py +233 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/solvers/nsga2.py +233 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/solvers/platypus_solver.py +580 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/solvers/registry.py +33 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/solvers/scipy_solver.py +174 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/splits/__init__.py +53 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/splits/blocks.py +422 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/splits/events.py +344 -0
- sparsehydro-1.0.0b1/sparsehydro/calibration/splits/masks.py +68 -0
- sparsehydro-1.0.0b1/sparsehydro/configuration.py +189 -0
- sparsehydro-1.0.0b1/sparsehydro/data/__init__.py +6 -0
- sparsehydro-1.0.0b1/sparsehydro/data/assembly.py +108 -0
- sparsehydro-1.0.0b1/sparsehydro/data/services/__init__.py +6 -0
- sparsehydro-1.0.0b1/sparsehydro/data/services/ayyeka.py +622 -0
- sparsehydro-1.0.0b1/sparsehydro/data/services/flowfinity.py +306 -0
- sparsehydro-1.0.0b1/sparsehydro/data/utilities.py +309 -0
- sparsehydro-1.0.0b1/sparsehydro/enums.py +35 -0
- sparsehydro-1.0.0b1/sparsehydro/events/__init__.py +93 -0
- sparsehydro-1.0.0b1/sparsehydro/events/bimodality.py +280 -0
- sparsehydro-1.0.0b1/sparsehydro/events/detection.py +410 -0
- sparsehydro-1.0.0b1/sparsehydro/events/hierarchy.py +190 -0
- sparsehydro-1.0.0b1/sparsehydro/events/io.py +251 -0
- sparsehydro-1.0.0b1/sparsehydro/events/peaks.py +148 -0
- sparsehydro-1.0.0b1/sparsehydro/events/records.py +353 -0
- sparsehydro-1.0.0b1/sparsehydro/events/screening.py +750 -0
- sparsehydro-1.0.0b1/sparsehydro/events/smoothing.py +343 -0
- sparsehydro-1.0.0b1/sparsehydro/events/zones.py +227 -0
- sparsehydro-1.0.0b1/sparsehydro/filters/__init__.py +32 -0
- sparsehydro-1.0.0b1/sparsehydro/filters/dryweather.py +749 -0
- sparsehydro-1.0.0b1/sparsehydro/filters/savgol.py +174 -0
- sparsehydro-1.0.0b1/sparsehydro/metrics/__init__.py +66 -0
- sparsehydro-1.0.0b1/sparsehydro/metrics/events.py +127 -0
- sparsehydro-1.0.0b1/sparsehydro/metrics/functions.py +334 -0
- sparsehydro-1.0.0b1/sparsehydro/metrics/objectives.py +822 -0
- sparsehydro-1.0.0b1/sparsehydro/metrics/scorecard.py +124 -0
- sparsehydro-1.0.0b1/sparsehydro/models/__init__.py +82 -0
- sparsehydro-1.0.0b1/sparsehydro/models/abstraction/__init__.py +38 -0
- sparsehydro-1.0.0b1/sparsehydro/models/abstraction/external.py +94 -0
- sparsehydro-1.0.0b1/sparsehydro/models/abstraction/soil_groundwater.py +251 -0
- sparsehydro-1.0.0b1/sparsehydro/models/abstraction/tank.py +395 -0
- sparsehydro-1.0.0b1/sparsehydro/models/amm.py +557 -0
- sparsehydro-1.0.0b1/sparsehydro/models/base.py +774 -0
- sparsehydro-1.0.0b1/sparsehydro/models/baseflow/__init__.py +26 -0
- sparsehydro-1.0.0b1/sparsehydro/models/baseflow/_shapes.py +145 -0
- sparsehydro-1.0.0b1/sparsehydro/models/baseflow/components.py +270 -0
- sparsehydro-1.0.0b1/sparsehydro/models/baseflow/fitting.py +170 -0
- sparsehydro-1.0.0b1/sparsehydro/models/composite.py +611 -0
- sparsehydro-1.0.0b1/sparsehydro/models/convolution.py +121 -0
- sparsehydro-1.0.0b1/sparsehydro/models/ensemble.py +569 -0
- sparsehydro-1.0.0b1/sparsehydro/models/forcing/__init__.py +5 -0
- sparsehydro-1.0.0b1/sparsehydro/models/forcing/snow.py +218 -0
- sparsehydro-1.0.0b1/sparsehydro/models/presets/__init__.py +5 -0
- sparsehydro-1.0.0b1/sparsehydro/models/presets/wholeflow.py +359 -0
- sparsehydro-1.0.0b1/sparsehydro/models/rdii/__init__.py +27 -0
- sparsehydro-1.0.0b1/sparsehydro/models/rdii/initial_abstraction.py +683 -0
- sparsehydro-1.0.0b1/sparsehydro/models/rdii/model.py +646 -0
- sparsehydro-1.0.0b1/sparsehydro/models/rdii/rtk_triangle.py +239 -0
- sparsehydro-1.0.0b1/sparsehydro/models/seasonality.py +329 -0
- sparsehydro-1.0.0b1/sparsehydro/models/torch_model.py +136 -0
- sparsehydro-1.0.0b1/sparsehydro/models/unithydrograph/__init__.py +69 -0
- sparsehydro-1.0.0b1/sparsehydro/models/unithydrograph/base.py +452 -0
- sparsehydro-1.0.0b1/sparsehydro/models/unithydrograph/clark.py +187 -0
- sparsehydro-1.0.0b1/sparsehydro/models/unithydrograph/distributions.py +138 -0
- sparsehydro-1.0.0b1/sparsehydro/models/unithydrograph/kernels.py +222 -0
- sparsehydro-1.0.0b1/sparsehydro/models/unithydrograph/mixture.py +200 -0
- sparsehydro-1.0.0b1/sparsehydro/models/unithydrograph/models.py +256 -0
- sparsehydro-1.0.0b1/sparsehydro/models/unithydrograph/peak_tail.py +53 -0
- sparsehydro-1.0.0b1/sparsehydro/models/unithydrograph/rtk.py +399 -0
- sparsehydro-1.0.0b1/sparsehydro/models/unithydrograph/synthetic.py +150 -0
- sparsehydro-1.0.0b1/sparsehydro/parameters.py +415 -0
- sparsehydro-1.0.0b1/sparsehydro/registry.py +381 -0
- sparsehydro-1.0.0b1/sparsehydro/sample_data/__init__.py +17 -0
- sparsehydro-1.0.0b1/sparsehydro/sample_data/samples.py +35 -0
- sparsehydro-1.0.0b1/sparsehydro/sample_data/tc_nb_001_rain_stormflow.csv +8929 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/__init__.py +5 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/__init__.py +22 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/assessment.py +343 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/data.py +114 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/defaults.py +163 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/detector.py +442 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/events.py +223 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/notebook.py +29 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/pareto.py +148 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/plots.py +323 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/reporting.py +538 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/scorecard.py +331 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/settings.py +433 -0
- sparsehydro-1.0.0b1/sparsehydro/studies/msdgc/workflow.py +488 -0
- sparsehydro-1.0.0b1/sparsehydro/units.py +28 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/__init__.py +223 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/_utils.py +48 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/bias_multi.py +212 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/calibration.py +741 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/dashboard.py +192 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/display.py +203 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/eventsplit_plot.py +294 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/model.py +218 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/rdii.py +219 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/seasonality.py +128 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/timeseries.py +1449 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/unithydrograph.py +933 -0
- sparsehydro-1.0.0b1/sparsehydro/visualization/wholeflow.py +320 -0
- sparsehydro-1.0.0b1/tests/__init__.py +0 -0
- sparsehydro-1.0.0b1/tests/conftest.py +71 -0
- sparsehydro-1.0.0b1/tests/data/MU-UM-019/lstStormTs.tsf +6339 -0
- sparsehydro-1.0.0b1/tests/data/MU-UM-019/rain_list.tsf +6339 -0
- sparsehydro-1.0.0b1/tests/data/__init__.py +11 -0
- sparsehydro-1.0.0b1/tests/golden/__init__.py +1 -0
- sparsehydro-1.0.0b1/tests/golden/cases.py +178 -0
- sparsehydro-1.0.0b1/tests/golden/evaluate.npz +0 -0
- sparsehydro-1.0.0b1/tests/golden/generate.py +397 -0
- sparsehydro-1.0.0b1/tests/golden/kernels.npz +0 -0
- sparsehydro-1.0.0b1/tests/golden/objectives.npz +0 -0
- sparsehydro-1.0.0b1/tests/golden/predictions.npz +0 -0
- sparsehydro-1.0.0b1/tests/golden/wholeflow.npz +0 -0
- sparsehydro-1.0.0b1/tests/golden/wholeflow_cases.py +154 -0
- sparsehydro-1.0.0b1/tests/pattern_workflow_support.py +205 -0
- sparsehydro-1.0.0b1/tests/test_amm_model.py +340 -0
- sparsehydro-1.0.0b1/tests/test_ayyeka.py +335 -0
- sparsehydro-1.0.0b1/tests/test_bias_multi.py +58 -0
- sparsehydro-1.0.0b1/tests/test_calibration.py +899 -0
- sparsehydro-1.0.0b1/tests/test_calibration_comprehensive.py +984 -0
- sparsehydro-1.0.0b1/tests/test_calibration_splits.py +219 -0
- sparsehydro-1.0.0b1/tests/test_cmaes_solver.py +136 -0
- sparsehydro-1.0.0b1/tests/test_combined_model.py +223 -0
- sparsehydro-1.0.0b1/tests/test_composite.py +92 -0
- sparsehydro-1.0.0b1/tests/test_composite_model.py +189 -0
- sparsehydro-1.0.0b1/tests/test_config_building.py +116 -0
- sparsehydro-1.0.0b1/tests/test_configuration.py +423 -0
- sparsehydro-1.0.0b1/tests/test_dryweather.py +200 -0
- sparsehydro-1.0.0b1/tests/test_ensemble.py +404 -0
- sparsehydro-1.0.0b1/tests/test_enums.py +33 -0
- sparsehydro-1.0.0b1/tests/test_event_hierarchy.py +110 -0
- sparsehydro-1.0.0b1/tests/test_event_peak_calibration.py +146 -0
- sparsehydro-1.0.0b1/tests/test_events_mask.py +91 -0
- sparsehydro-1.0.0b1/tests/test_events_screening.py +398 -0
- sparsehydro-1.0.0b1/tests/test_eventsplit.py +171 -0
- sparsehydro-1.0.0b1/tests/test_eventsplit_plot.py +69 -0
- sparsehydro-1.0.0b1/tests/test_examples.py +28 -0
- sparsehydro-1.0.0b1/tests/test_extensions.py +106 -0
- sparsehydro-1.0.0b1/tests/test_fastpath_invariants.py +319 -0
- sparsehydro-1.0.0b1/tests/test_flowfinity.py +263 -0
- sparsehydro-1.0.0b1/tests/test_golden_convolution.py +341 -0
- sparsehydro-1.0.0b1/tests/test_hybrid_events.py +266 -0
- sparsehydro-1.0.0b1/tests/test_imported_events.py +161 -0
- sparsehydro-1.0.0b1/tests/test_interfaces.py +174 -0
- sparsehydro-1.0.0b1/tests/test_internal_helpers.py +58 -0
- sparsehydro-1.0.0b1/tests/test_layering.py +139 -0
- sparsehydro-1.0.0b1/tests/test_metrics_functions.py +55 -0
- sparsehydro-1.0.0b1/tests/test_msdgc_assessment.py +181 -0
- sparsehydro-1.0.0b1/tests/test_msdgc_pareto.py +161 -0
- sparsehydro-1.0.0b1/tests/test_msdgc_scorecard.py +145 -0
- sparsehydro-1.0.0b1/tests/test_msdgc_workflow.py +213 -0
- sparsehydro-1.0.0b1/tests/test_parameters.py +226 -0
- sparsehydro-1.0.0b1/tests/test_pattern_extraction.py +233 -0
- sparsehydro-1.0.0b1/tests/test_platypus_parallel.py +202 -0
- sparsehydro-1.0.0b1/tests/test_problem_feasibility.py +88 -0
- sparsehydro-1.0.0b1/tests/test_rdii_model.py +1182 -0
- sparsehydro-1.0.0b1/tests/test_registry.py +218 -0
- sparsehydro-1.0.0b1/tests/test_reinitialize.py +44 -0
- sparsehydro-1.0.0b1/tests/test_scorecard.py +73 -0
- sparsehydro-1.0.0b1/tests/test_seasonality.py +419 -0
- sparsehydro-1.0.0b1/tests/test_sequential_global.py +136 -0
- sparsehydro-1.0.0b1/tests/test_slow_response_warning.py +94 -0
- sparsehydro-1.0.0b1/tests/test_tank_abstraction.py +134 -0
- sparsehydro-1.0.0b1/tests/test_torch_model.py +94 -0
- sparsehydro-1.0.0b1/tests/test_trace.py +299 -0
- sparsehydro-1.0.0b1/tests/test_uh_library.py +307 -0
- sparsehydro-1.0.0b1/tests/test_uh_models.py +137 -0
- sparsehydro-1.0.0b1/tests/test_uh_visualization.py +62 -0
- sparsehydro-1.0.0b1/tests/test_utilities.py +335 -0
- sparsehydro-1.0.0b1/tests/test_visualization.py +725 -0
- sparsehydro-1.0.0b1/tests/test_visualization_display.py +169 -0
- sparsehydro-1.0.0b1/tests/test_wholeflow_background.py +374 -0
- sparsehydro-1.0.0b1/tests/test_wholeflow_compact.py +151 -0
- sparsehydro-1.0.0b1/tests/test_wholeflow_components.py +169 -0
- sparsehydro-1.0.0b1/tests/test_wholeflow_lean.py +233 -0
- sparsehydro-1.0.0b1/tests/test_wholeflow_parity.py +71 -0
- sparsehydro-1.0.0b1/tests/test_wholeflow_pattern.py +971 -0
- sparsehydro-1.0.0b1/tests/test_wholeflow_physics.py +44 -0
- sparsehydro-1.0.0b1/tests/test_wholeflow_presentation.py +141 -0
- sparsehydro-1.0.0b1/tests/test_wholeflow_sanitary.py +103 -0
- sparsehydro-1.0.0b1/tests/test_wholeflow_snow.py +359 -0
- sparsehydro-0.0.0/PKG-INFO +0 -40
- sparsehydro-0.0.0/README.md +0 -4
- sparsehydro-0.0.0/__init__.py +0 -2
- sparsehydro-0.0.0/setup.cfg +0 -4
- sparsehydro-0.0.0/setup.py +0 -49
- sparsehydro-0.0.0/sparsehydro.egg-info/PKG-INFO +0 -40
- sparsehydro-0.0.0/sparsehydro.egg-info/SOURCES.txt +0 -7
- sparsehydro-0.0.0/sparsehydro.egg-info/dependency_links.txt +0 -1
- sparsehydro-0.0.0/sparsehydro.egg-info/top_level.txt +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Something does not work as documented
|
|
4
|
+
title: "[BUG] "
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Describe the bug**
|
|
10
|
+
A clear and concise description of what is wrong.
|
|
11
|
+
|
|
12
|
+
**To reproduce**
|
|
13
|
+
A minimal script that shows the problem. Use synthetic data or the bundled
|
|
14
|
+
sample (`from sparsehydro.sample_data import load_sample`) where possible, and
|
|
15
|
+
remove anything not needed to trigger the bug.
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
# paste the script here
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**What happened**
|
|
22
|
+
The full error message and traceback, or the incorrect result.
|
|
23
|
+
|
|
24
|
+
**What you expected**
|
|
25
|
+
What you expected to happen instead.
|
|
26
|
+
|
|
27
|
+
**Environment**
|
|
28
|
+
- sparsehydro version (`python -c "import sparsehydro; print(sparsehydro.__version__)"`):
|
|
29
|
+
- Python version:
|
|
30
|
+
- Operating system:
|
|
31
|
+
- Installed extras (for example `speed`, `parallel`):
|
|
32
|
+
|
|
33
|
+
**Additional context**
|
|
34
|
+
Anything else that might help, such as whether it worked in an earlier version.
|
|
35
|
+
Please do not attach confidential monitoring data.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
blank_issues_enabled: true
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Documentation
|
|
4
|
+
url: https://coc-msd.github.io/SparseHydro/
|
|
5
|
+
about: Check the user guide and API reference first.
|
|
6
|
+
- name: Code of Conduct concerns
|
|
7
|
+
url: https://github.com/CoC-MSD/sparsehydro/blob/main/CODE_OF_CONDUCT.md#reporting-an-issue
|
|
8
|
+
about: Report conduct issues privately by email, not in a public issue.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature or formulation request
|
|
3
|
+
about: Suggest a new capability or model formulation
|
|
4
|
+
title: "[FEATURE] "
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**What problem would this solve?**
|
|
10
|
+
Describe the analysis you are trying to do and what is missing or awkward
|
|
11
|
+
today.
|
|
12
|
+
|
|
13
|
+
**Proposed solution**
|
|
14
|
+
What you would like to happen. For a new model formulation, include:
|
|
15
|
+
- the equations or a reference (paper, manual, textbook section),
|
|
16
|
+
- its parameters with units and typical ranges,
|
|
17
|
+
- which existing components it would combine with.
|
|
18
|
+
|
|
19
|
+
**Alternatives considered**
|
|
20
|
+
Other approaches or existing components you tried.
|
|
21
|
+
|
|
22
|
+
**Additional context**
|
|
23
|
+
Anything else, such as example data (synthetic or public) or plots.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- What does this pull request change, and why? One or two short paragraphs. -->
|
|
4
|
+
|
|
5
|
+
Closes #
|
|
6
|
+
|
|
7
|
+
## Type of change
|
|
8
|
+
|
|
9
|
+
<!-- Tick all that apply. -->
|
|
10
|
+
|
|
11
|
+
- [ ] Bug fix
|
|
12
|
+
- [ ] New model formulation or component
|
|
13
|
+
- [ ] New feature (other)
|
|
14
|
+
- [ ] Refactor with no change in results
|
|
15
|
+
- [ ] Documentation only
|
|
16
|
+
- [ ] **Breaking change** (changes a public interface or existing numerical results)
|
|
17
|
+
|
|
18
|
+
## How it was tested
|
|
19
|
+
|
|
20
|
+
<!-- Which tests did you add or run? For numerical changes, include a short
|
|
21
|
+
before/after comparison (a table or a few numbers is enough). -->
|
|
22
|
+
|
|
23
|
+
## Checklist
|
|
24
|
+
|
|
25
|
+
- [ ] The pull request targets `dev`.
|
|
26
|
+
- [ ] `pytest` passes locally.
|
|
27
|
+
- [ ] New behaviour has tests; no existing test was deleted or weakened for code I did not change.
|
|
28
|
+
- [ ] New formulations are registered (`@registry.register`), use physical units (hours, not time steps), and declare bounds and constraints.
|
|
29
|
+
- [ ] No study-specific code outside `sparsehydro/studies/`.
|
|
30
|
+
- [ ] No `print()`, notebooks, generated outputs, credentials, or files over 1 MiB are added.
|
|
31
|
+
- [ ] Public docstrings and `docs/` are updated.
|
|
32
|
+
- [ ] `CHANGELOG.md` has an entry under `[Unreleased]` (breaking changes marked **BREAKING**).
|
|
33
|
+
|
|
34
|
+
## Notes for reviewers
|
|
35
|
+
|
|
36
|
+
<!-- Anything you would like a reviewer to look at closely, open questions,
|
|
37
|
+
or follow-up work. Delete this section if not needed. -->
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Release checks run by .github/workflows/publish.yml (also runnable locally).
|
|
2
|
+
|
|
3
|
+
python .github/scripts/check_release.py v1.0.0b1 [--prerelease true|false] [--dist dist]
|
|
4
|
+
|
|
5
|
+
Fails (exit 1) when:
|
|
6
|
+
- the tag is not "v" + the version in sparsehydro/__init__.py;
|
|
7
|
+
- the GitHub release's pre-release flag does not match the version
|
|
8
|
+
(alpha/beta/rc versions must be marked pre-release, final versions not);
|
|
9
|
+
- CHANGELOG.md has no "## [<version>]" section;
|
|
10
|
+
- built files in --dist carry a different version.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import argparse
|
|
16
|
+
import re
|
|
17
|
+
import sys
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
from packaging.version import Version
|
|
21
|
+
|
|
22
|
+
ROOT = Path(__file__).resolve().parents[2]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def package_version() -> str:
|
|
26
|
+
text = (ROOT / "sparsehydro" / "__init__.py").read_text(encoding="utf-8")
|
|
27
|
+
match = re.search(r'^__version__\s*=\s*"([^"]+)"', text, re.M)
|
|
28
|
+
if not match:
|
|
29
|
+
raise SystemExit("could not find __version__ in sparsehydro/__init__.py")
|
|
30
|
+
return match.group(1)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def main() -> int:
|
|
34
|
+
parser = argparse.ArgumentParser()
|
|
35
|
+
parser.add_argument("tag")
|
|
36
|
+
parser.add_argument("--prerelease", choices=["true", "false"])
|
|
37
|
+
parser.add_argument("--dist", type=Path)
|
|
38
|
+
args = parser.parse_args()
|
|
39
|
+
|
|
40
|
+
version = package_version()
|
|
41
|
+
problems = []
|
|
42
|
+
if args.tag != f"v{version}":
|
|
43
|
+
problems.append(f"tag {args.tag!r} does not match package version {version!r} (expected 'v{version}')")
|
|
44
|
+
if args.prerelease is not None:
|
|
45
|
+
is_pre = Version(version).is_prerelease
|
|
46
|
+
if is_pre != (args.prerelease == "true"):
|
|
47
|
+
want = "ticked" if is_pre else "unticked"
|
|
48
|
+
problems.append(f"version {version} needs 'Set as a pre-release' {want} on the GitHub release")
|
|
49
|
+
changelog = (ROOT / "CHANGELOG.md").read_text(encoding="utf-8")
|
|
50
|
+
if f"## [{version}]" not in changelog:
|
|
51
|
+
problems.append(f"CHANGELOG.md has no '## [{version}]' section")
|
|
52
|
+
if args.dist is not None:
|
|
53
|
+
files = sorted(args.dist.glob("sparsehydro-*"))
|
|
54
|
+
if not files:
|
|
55
|
+
problems.append(f"no built files in {args.dist}")
|
|
56
|
+
for f in files:
|
|
57
|
+
if not f.name.startswith(f"sparsehydro-{version}"):
|
|
58
|
+
problems.append(f"{f.name} does not carry version {version}")
|
|
59
|
+
|
|
60
|
+
for p in problems:
|
|
61
|
+
print(f"::error::{p}")
|
|
62
|
+
if not problems:
|
|
63
|
+
print(f"release checks passed for {version}")
|
|
64
|
+
return 1 if problems else 0
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
if __name__ == "__main__":
|
|
68
|
+
sys.exit(main())
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, dev]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, dev]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
pages: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: pages
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.12"
|
|
28
|
+
cache: pip
|
|
29
|
+
|
|
30
|
+
- name: Install package and doc dependencies
|
|
31
|
+
run: pip install -e ".[docs]"
|
|
32
|
+
|
|
33
|
+
- name: Build Sphinx docs
|
|
34
|
+
run: sphinx-build -b html docs docs/_build/html -W --keep-going
|
|
35
|
+
|
|
36
|
+
- name: Upload Pages artifact
|
|
37
|
+
uses: actions/upload-pages-artifact@v3
|
|
38
|
+
with:
|
|
39
|
+
path: docs/_build/html
|
|
40
|
+
|
|
41
|
+
- name: Upload documentation for PR preview
|
|
42
|
+
uses: actions/upload-artifact@v4
|
|
43
|
+
with:
|
|
44
|
+
name: documentation-preview
|
|
45
|
+
path: docs/_build/html
|
|
46
|
+
retention-days: 7
|
|
47
|
+
|
|
48
|
+
deploy:
|
|
49
|
+
needs: build
|
|
50
|
+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
environment:
|
|
53
|
+
name: github-pages
|
|
54
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
55
|
+
steps:
|
|
56
|
+
- name: Deploy to GitHub Pages
|
|
57
|
+
id: deployment
|
|
58
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
# Runs when a GitHub release is published. Uses PyPI trusted publishing (no API
|
|
4
|
+
# tokens); see RELEASING.md for the one-time setup on PyPI and GitHub.
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [published]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
tests:
|
|
15
|
+
name: Full test matrix
|
|
16
|
+
uses: ./.github/workflows/tests.yml
|
|
17
|
+
secrets: inherit
|
|
18
|
+
|
|
19
|
+
build:
|
|
20
|
+
name: Build and check distributions
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
|
|
30
|
+
- name: Install build tools
|
|
31
|
+
run: pip install build twine packaging
|
|
32
|
+
|
|
33
|
+
- name: Build source and wheel distributions
|
|
34
|
+
run: python -m build
|
|
35
|
+
|
|
36
|
+
- name: Check tag, version, pre-release flag and changelog
|
|
37
|
+
run: >
|
|
38
|
+
python .github/scripts/check_release.py "${{ github.event.release.tag_name }}"
|
|
39
|
+
--prerelease "${{ github.event.release.prerelease }}" --dist dist
|
|
40
|
+
|
|
41
|
+
- name: Check package metadata
|
|
42
|
+
run: twine check --strict dist/*
|
|
43
|
+
|
|
44
|
+
- name: Install the wheel and import it
|
|
45
|
+
run: |
|
|
46
|
+
python -m venv /tmp/smoke
|
|
47
|
+
/tmp/smoke/bin/pip install dist/*.whl
|
|
48
|
+
cd /tmp && /tmp/smoke/bin/python -c "import sparsehydro, sparsehydro.models, sparsehydro.calibration; print(sparsehydro.__version__)"
|
|
49
|
+
|
|
50
|
+
- name: Upload distribution artifacts
|
|
51
|
+
uses: actions/upload-artifact@v4
|
|
52
|
+
with:
|
|
53
|
+
name: dist
|
|
54
|
+
path: dist/
|
|
55
|
+
|
|
56
|
+
testpypi:
|
|
57
|
+
name: Publish to TestPyPI
|
|
58
|
+
# Optional rehearsal: set the repository variable USE_TESTPYPI to "true"
|
|
59
|
+
# (Settings > Secrets and variables > Actions > Variables) to enable it.
|
|
60
|
+
if: vars.USE_TESTPYPI == 'true'
|
|
61
|
+
needs: [tests, build]
|
|
62
|
+
runs-on: ubuntu-latest
|
|
63
|
+
environment:
|
|
64
|
+
name: testpypi
|
|
65
|
+
url: https://test.pypi.org/p/sparsehydro
|
|
66
|
+
permissions:
|
|
67
|
+
id-token: write
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/download-artifact@v4
|
|
70
|
+
with:
|
|
71
|
+
name: dist
|
|
72
|
+
path: dist/
|
|
73
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
74
|
+
with:
|
|
75
|
+
repository-url: https://test.pypi.org/legacy/
|
|
76
|
+
skip-existing: true
|
|
77
|
+
|
|
78
|
+
pypi:
|
|
79
|
+
name: Publish to PyPI
|
|
80
|
+
needs: [tests, build, testpypi]
|
|
81
|
+
# Run after TestPyPI succeeds, or when it is switched off (skipped).
|
|
82
|
+
if: ${{ !failure() && !cancelled() }}
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
environment:
|
|
85
|
+
name: pypi
|
|
86
|
+
url: https://pypi.org/p/sparsehydro
|
|
87
|
+
permissions:
|
|
88
|
+
id-token: write
|
|
89
|
+
steps:
|
|
90
|
+
- uses: actions/download-artifact@v4
|
|
91
|
+
with:
|
|
92
|
+
name: dist
|
|
93
|
+
path: dist/
|
|
94
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, dev]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, dev]
|
|
8
|
+
workflow_call: # reused by publish.yml before every release
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
hygiene:
|
|
12
|
+
name: Repository hygiene
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: No notebooks, Git LFS or large files
|
|
18
|
+
shell: bash
|
|
19
|
+
run: |
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
status=0
|
|
22
|
+
notebooks=$(git ls-files '*.ipynb')
|
|
23
|
+
if [ -n "$notebooks" ]; then
|
|
24
|
+
echo "::error::Notebooks are not kept in the repository (use examples/*.py):"
|
|
25
|
+
echo "$notebooks"
|
|
26
|
+
status=1
|
|
27
|
+
fi
|
|
28
|
+
if git grep -q "filter=lfs" -- .gitattributes 2>/dev/null; then
|
|
29
|
+
echo "::error::Git LFS is not used in this repository."
|
|
30
|
+
status=1
|
|
31
|
+
fi
|
|
32
|
+
# Files above 1 MiB need a reason; list any agreed exceptions here (one per line).
|
|
33
|
+
allow=""
|
|
34
|
+
while IFS= read -r -d '' f; do
|
|
35
|
+
size=$(stat -c %s "$f")
|
|
36
|
+
if [ "$size" -gt 1048576 ] && ! grep -qxF "$f" <<< "$allow"; then
|
|
37
|
+
echo "::error file=$f::$f is $size bytes (limit 1 MiB)."
|
|
38
|
+
status=1
|
|
39
|
+
fi
|
|
40
|
+
done < <(git ls-files -z)
|
|
41
|
+
exit $status
|
|
42
|
+
|
|
43
|
+
test:
|
|
44
|
+
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
|
|
45
|
+
runs-on: ${{ matrix.os }}
|
|
46
|
+
strategy:
|
|
47
|
+
fail-fast: false
|
|
48
|
+
matrix:
|
|
49
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
50
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
51
|
+
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
|
|
55
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
56
|
+
uses: actions/setup-python@v5
|
|
57
|
+
with:
|
|
58
|
+
python-version: ${{ matrix.python-version }}
|
|
59
|
+
cache: pip
|
|
60
|
+
|
|
61
|
+
- name: Install package and dev dependencies
|
|
62
|
+
run: pip install -e ".[dev]"
|
|
63
|
+
|
|
64
|
+
- name: Run tests
|
|
65
|
+
run: pytest
|
|
66
|
+
|
|
67
|
+
- name: Upload coverage to Codecov
|
|
68
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
|
|
69
|
+
uses: codecov/codecov-action@v4
|
|
70
|
+
with:
|
|
71
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
72
|
+
files: coverage.xml
|
|
73
|
+
fail_ci_if_error: false
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.pyo
|
|
5
|
+
*.pyd
|
|
6
|
+
*.egg
|
|
7
|
+
*.egg-info/
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
.eggs/
|
|
11
|
+
*.whl
|
|
12
|
+
|
|
13
|
+
# Virtual environments
|
|
14
|
+
.venv/
|
|
15
|
+
venv/
|
|
16
|
+
env/
|
|
17
|
+
.env
|
|
18
|
+
|
|
19
|
+
# Testing / coverage
|
|
20
|
+
.pytest_cache/
|
|
21
|
+
.coverage
|
|
22
|
+
coverage.xml
|
|
23
|
+
htmlcov/
|
|
24
|
+
|
|
25
|
+
# Sphinx
|
|
26
|
+
docs/_build/
|
|
27
|
+
docs/_autosummary/
|
|
28
|
+
|
|
29
|
+
# IDEs
|
|
30
|
+
.vscode/
|
|
31
|
+
.idea/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
.DS_Store
|
|
35
|
+
Thumbs.db
|
|
36
|
+
|
|
37
|
+
# Distribution / packaging
|
|
38
|
+
*.tar.gz
|
|
39
|
+
*.zip
|
|
40
|
+
MANIFEST
|
|
41
|
+
|
|
42
|
+
# Local legacy reference material
|
|
43
|
+
/legacy/
|
|
44
|
+
|
|
45
|
+
# Secrets / credentials (never commit)
|
|
46
|
+
ayyeka_auth.py
|
|
47
|
+
flowfinity_auth.py
|
|
48
|
+
csvagent.json
|
|
49
|
+
*.secrets.json
|
|
50
|
+
|
|
51
|
+
# Notebooks and large data stay out of the repository (no Git LFS).
|
|
52
|
+
# Keep notebooks locally or in a separate examples repository; runnable
|
|
53
|
+
# examples live in examples/*.py.
|
|
54
|
+
*.ipynb
|
|
55
|
+
.ipynb_checkpoints/
|
|
56
|
+
*.parquet
|
|
57
|
+
|
|
58
|
+
# Generated outputs (plots, reports, exports) are never committed.
|
|
59
|
+
artifacts/
|
|
60
|
+
**/artifacts/
|