pyrorb 26.11.24.1__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.
- pyrorb-26.11.24.1/LICENSE +73 -0
- pyrorb-26.11.24.1/PKG-INFO +76 -0
- pyrorb-26.11.24.1/README.md +55 -0
- pyrorb-26.11.24.1/pyproject.toml +42 -0
- pyrorb-26.11.24.1/setup.cfg +4 -0
- pyrorb-26.11.24.1/src/pyrorb.egg-info/PKG-INFO +76 -0
- pyrorb-26.11.24.1/src/pyrorb.egg-info/SOURCES.txt +173 -0
- pyrorb-26.11.24.1/src/pyrorb.egg-info/dependency_links.txt +1 -0
- pyrorb-26.11.24.1/src/pyrorb.egg-info/requires.txt +14 -0
- pyrorb-26.11.24.1/src/pyrorb.egg-info/top_level.txt +1 -0
- pyrorb-26.11.24.1/src/runoff_routing/__init__.py +1 -0
- pyrorb-26.11.24.1/src/runoff_routing/_cmd644/__init__.py +5 -0
- pyrorb-26.11.24.1/src/runoff_routing/_cmd644/geometry.py +110 -0
- pyrorb-26.11.24.1/src/runoff_routing/_cmd644/models.py +60 -0
- pyrorb-26.11.24.1/src/runoff_routing/_cmd644/native_diagnostics.py +55 -0
- pyrorb-26.11.24.1/src/runoff_routing/_cmd644/power.py +137 -0
- pyrorb-26.11.24.1/src/runoff_routing/_cmd644/precision.py +149 -0
- pyrorb-26.11.24.1/src/runoff_routing/_cmd644/preparation.py +131 -0
- pyrorb-26.11.24.1/src/runoff_routing/_cmd644/reporting.py +214 -0
- pyrorb-26.11.24.1/src/runoff_routing/_cmd644/routing.py +369 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_arf.py +338 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_data.py +278 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_design_batch.py +803 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_import.py +432 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_legacy.py +274 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_losses.py +564 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_patterns.py +315 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_report.py +203 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_result_summary.py +665 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_selection.py +148 -0
- pyrorb-26.11.24.1/src/runoff_routing/arr_storm.py +146 -0
- pyrorb-26.11.24.1/src/runoff_routing/bom_ifd.py +361 -0
- pyrorb-26.11.24.1/src/runoff_routing/cmd_deviation.py +106 -0
- pyrorb-26.11.24.1/src/runoff_routing/cmd_engine.py +295 -0
- pyrorb-26.11.24.1/src/runoff_routing/engine_execution.py +313 -0
- pyrorb-26.11.24.1/src/runoff_routing/engine_provenance.py +118 -0
- pyrorb-26.11.24.1/src/runoff_routing/engine_types.py +192 -0
- pyrorb-26.11.24.1/src/runoff_routing/engineering_batch.py +83 -0
- pyrorb-26.11.24.1/src/runoff_routing/integration.py +374 -0
- pyrorb-26.11.24.1/src/runoff_routing/integration_reporting.py +102 -0
- pyrorb-26.11.24.1/src/runoff_routing/legacy_inputs.py +82 -0
- pyrorb-26.11.24.1/src/runoff_routing/mcp_catalog.py +205 -0
- pyrorb-26.11.24.1/src/runoff_routing/mcp_reference.py +406 -0
- pyrorb-26.11.24.1/src/runoff_routing/mcp_results.py +230 -0
- pyrorb-26.11.24.1/src/runoff_routing/mcp_server.py +422 -0
- pyrorb-26.11.24.1/src/runoff_routing/mcp_tool_errors.py +89 -0
- pyrorb-26.11.24.1/src/runoff_routing/monte_carlo_bridge.py +348 -0
- pyrorb-26.11.24.1/src/runoff_routing/monte_carlo_comparison.py +233 -0
- pyrorb-26.11.24.1/src/runoff_routing/monte_carlo_effective.py +890 -0
- pyrorb-26.11.24.1/src/runoff_routing/monte_carlo_execution.py +855 -0
- pyrorb-26.11.24.1/src/runoff_routing/monte_carlo_frequency.py +819 -0
- pyrorb-26.11.24.1/src/runoff_routing/monte_carlo_frequency_bridge.py +383 -0
- pyrorb-26.11.24.1/src/runoff_routing/monte_carlo_plan.py +932 -0
- pyrorb-26.11.24.1/src/runoff_routing/native_cmd.py +453 -0
- pyrorb-26.11.24.1/src/runoff_routing/native_export.py +507 -0
- pyrorb-26.11.24.1/src/runoff_routing/offline_reference.py +311 -0
- pyrorb-26.11.24.1/src/runoff_routing/onset_diagnostics.py +177 -0
- pyrorb-26.11.24.1/src/runoff_routing/par_project_import.py +193 -0
- pyrorb-26.11.24.1/src/runoff_routing/parity_metrics.py +382 -0
- pyrorb-26.11.24.1/src/runoff_routing/project_batch.py +709 -0
- pyrorb-26.11.24.1/src/runoff_routing/project_execution.py +172 -0
- pyrorb-26.11.24.1/src/runoff_routing/project_json.py +980 -0
- pyrorb-26.11.24.1/src/runoff_routing/project_native_review.py +325 -0
- pyrorb-26.11.24.1/src/runoff_routing/py.typed +0 -0
- pyrorb-26.11.24.1/src/runoff_routing/reach_analysis.py +157 -0
- pyrorb-26.11.24.1/src/runoff_routing/reach_routing.py +214 -0
- pyrorb-26.11.24.1/src/runoff_routing/reference.py +561 -0
- pyrorb-26.11.24.1/src/runoff_routing/reference_compare.py +164 -0
- pyrorb-26.11.24.1/src/runoff_routing/regression_dataset.py +974 -0
- pyrorb-26.11.24.1/src/runoff_routing/regression_metric_controls.py +111 -0
- pyrorb-26.11.24.1/src/runoff_routing/regression_metrics.py +212 -0
- pyrorb-26.11.24.1/src/runoff_routing/regression_scalar_adapter.py +103 -0
- pyrorb-26.11.24.1/src/runoff_routing/reporting_conventions.py +133 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_codec.py +984 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_documents.py +147 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_ge_authoring.py +310 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_ge_gis.py +258 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_ge_profile.py +157 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_inspect.py +56 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_model.py +929 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_out.py +178 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_par.py +229 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_readers/__init__.py +1 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_readers/associations.py +250 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_readers/output_reader.py +369 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_readers/parameter_reader.py +178 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_readers/reader_types.py +139 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_readers/readers.py +141 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_readers/result_readers.py +272 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorb_report_views.py +109 -0
- pyrorb-26.11.24.1/src/runoff_routing/rorbwin_losses.py +80 -0
- pyrorb-26.11.24.1/src/runoff_routing/single_storm.py +392 -0
- pyrorb-26.11.24.1/tests/test_arr_arf.py +218 -0
- pyrorb-26.11.24.1/tests/test_arr_arf_2026.py +151 -0
- pyrorb-26.11.24.1/tests/test_arr_data.py +304 -0
- pyrorb-26.11.24.1/tests/test_arr_design_batch.py +410 -0
- pyrorb-26.11.24.1/tests/test_arr_legacy.py +208 -0
- pyrorb-26.11.24.1/tests/test_arr_losses.py +339 -0
- pyrorb-26.11.24.1/tests/test_arr_patterns.py +265 -0
- pyrorb-26.11.24.1/tests/test_arr_result_summary.py +415 -0
- pyrorb-26.11.24.1/tests/test_arr_selection.py +188 -0
- pyrorb-26.11.24.1/tests/test_auto_release_version.py +62 -0
- pyrorb-26.11.24.1/tests/test_bom_ifd.py +215 -0
- pyrorb-26.11.24.1/tests/test_canonical_rorb_reader.py +178 -0
- pyrorb-26.11.24.1/tests/test_cmd91_multisite.py +434 -0
- pyrorb-26.11.24.1/tests/test_cmd92_boundaries.py +153 -0
- pyrorb-26.11.24.1/tests/test_cmd96_code2_fi_kernel.py +96 -0
- pyrorb-26.11.24.1/tests/test_cmd96_pr16_typed_bridge.py +118 -0
- pyrorb-26.11.24.1/tests/test_cmd_deviation.py +72 -0
- pyrorb-26.11.24.1/tests/test_cmd_engine.py +435 -0
- pyrorb-26.11.24.1/tests/test_cmd_native_target_diagnostics.py +40 -0
- pyrorb-26.11.24.1/tests/test_cmd_public_probe.py +346 -0
- pyrorb-26.11.24.1/tests/test_engine_contract.py +548 -0
- pyrorb-26.11.24.1/tests/test_engineering_accuracy.py +249 -0
- pyrorb-26.11.24.1/tests/test_engineering_batch.py +153 -0
- pyrorb-26.11.24.1/tests/test_engineering_loss_mode2.py +114 -0
- pyrorb-26.11.24.1/tests/test_ge_652_profile.py +139 -0
- pyrorb-26.11.24.1/tests/test_integration.py +286 -0
- pyrorb-26.11.24.1/tests/test_integration_reporting.py +151 -0
- pyrorb-26.11.24.1/tests/test_legacy_inputs.py +115 -0
- pyrorb-26.11.24.1/tests/test_mc150_frequency_adapter.py +200 -0
- pyrorb-26.11.24.1/tests/test_mc150_independent_reference.py +223 -0
- pyrorb-26.11.24.1/tests/test_mc150_sampler_adapter.py +295 -0
- pyrorb-26.11.24.1/tests/test_mc_convergence_research.py +261 -0
- pyrorb-26.11.24.1/tests/test_mc_physical_preflight.py +262 -0
- pyrorb-26.11.24.1/tests/test_mcp_reference.py +111 -0
- pyrorb-26.11.24.1/tests/test_mcp_results.py +183 -0
- pyrorb-26.11.24.1/tests/test_mcp_server.py +281 -0
- pyrorb-26.11.24.1/tests/test_mcp_stdio.py +201 -0
- pyrorb-26.11.24.1/tests/test_mcp_tool_errors.py +147 -0
- pyrorb-26.11.24.1/tests/test_metric_controls.py +113 -0
- pyrorb-26.11.24.1/tests/test_monte_carlo_bridge.py +175 -0
- pyrorb-26.11.24.1/tests/test_monte_carlo_comparison.py +129 -0
- pyrorb-26.11.24.1/tests/test_monte_carlo_execution.py +543 -0
- pyrorb-26.11.24.1/tests/test_monte_carlo_frequency.py +446 -0
- pyrorb-26.11.24.1/tests/test_monte_carlo_integration.py +380 -0
- pyrorb-26.11.24.1/tests/test_monte_carlo_interval_contribution.py +214 -0
- pyrorb-26.11.24.1/tests/test_monte_carlo_plan.py +533 -0
- pyrorb-26.11.24.1/tests/test_native_export.py +453 -0
- pyrorb-26.11.24.1/tests/test_nonlinear_printed_balance.py +152 -0
- pyrorb-26.11.24.1/tests/test_offline_reference.py +197 -0
- pyrorb-26.11.24.1/tests/test_onset_diagnostics.py +163 -0
- pyrorb-26.11.24.1/tests/test_original_645_readers.py +111 -0
- pyrorb-26.11.24.1/tests/test_original_652_readers.py +101 -0
- pyrorb-26.11.24.1/tests/test_par_project_import.py +409 -0
- pyrorb-26.11.24.1/tests/test_parity_metrics.py +117 -0
- pyrorb-26.11.24.1/tests/test_project_batch.py +632 -0
- pyrorb-26.11.24.1/tests/test_project_execution.py +286 -0
- pyrorb-26.11.24.1/tests/test_project_json.py +483 -0
- pyrorb-26.11.24.1/tests/test_project_native_review.py +377 -0
- pyrorb-26.11.24.1/tests/test_publishing_workflow.py +108 -0
- pyrorb-26.11.24.1/tests/test_python96_code2_impervious.py +118 -0
- pyrorb-26.11.24.1/tests/test_python96_import_adapter.py +281 -0
- pyrorb-26.11.24.1/tests/test_python96_original_deviation.py +135 -0
- pyrorb-26.11.24.1/tests/test_quality_policy.py +85 -0
- pyrorb-26.11.24.1/tests/test_reach_analysis.py +105 -0
- pyrorb-26.11.24.1/tests/test_reach_routing.py +96 -0
- pyrorb-26.11.24.1/tests/test_reference.py +313 -0
- pyrorb-26.11.24.1/tests/test_regression_dataset.py +468 -0
- pyrorb-26.11.24.1/tests/test_regression_public_native.py +302 -0
- pyrorb-26.11.24.1/tests/test_regression_scalars.py +497 -0
- pyrorb-26.11.24.1/tests/test_release_checks.py +256 -0
- pyrorb-26.11.24.1/tests/test_report_metrics.py +253 -0
- pyrorb-26.11.24.1/tests/test_reporting_conventions.py +148 -0
- pyrorb-26.11.24.1/tests/test_repository_checks.py +32 -0
- pyrorb-26.11.24.1/tests/test_rorb_ge_authoring.py +465 -0
- pyrorb-26.11.24.1/tests/test_rorb_inspection.py +203 -0
- pyrorb-26.11.24.1/tests/test_rorb_reader_contract.py +736 -0
- pyrorb-26.11.24.1/tests/test_rorb_report_views.py +135 -0
- pyrorb-26.11.24.1/tests/test_rorb_roundtrip.py +947 -0
- pyrorb-26.11.24.1/tests/test_rorbwin_losses.py +130 -0
- pyrorb-26.11.24.1/tests/test_s5_workflow_acceptance.py +290 -0
- pyrorb-26.11.24.1/tests/test_scaffold.py +36 -0
- pyrorb-26.11.24.1/tests/test_single_storm.py +93 -0
- pyrorb-26.11.24.1/tests/test_typed_effective_model.py +248 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Sustainable Use License
|
|
2
|
+
|
|
3
|
+
Version 1.0
|
|
4
|
+
|
|
5
|
+
Acceptance
|
|
6
|
+
|
|
7
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
8
|
+
|
|
9
|
+
Copyright License
|
|
10
|
+
|
|
11
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license
|
|
12
|
+
to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject
|
|
13
|
+
to the limitations below.
|
|
14
|
+
|
|
15
|
+
Limitations
|
|
16
|
+
|
|
17
|
+
You may use or modify the software only for your own internal business purposes or for non-commercial or
|
|
18
|
+
personal use. You may distribute the software or provide it to others only if you do so free of charge for
|
|
19
|
+
non-commercial purposes. You may not alter, remove, or obscure any licensing, copyright, or other notices of
|
|
20
|
+
the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
|
|
21
|
+
|
|
22
|
+
Patents
|
|
23
|
+
|
|
24
|
+
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to
|
|
25
|
+
license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case
|
|
26
|
+
subject to the limitations and conditions in this license. This license does not cover any patent claims that
|
|
27
|
+
you cause to be infringed by modifications or additions to the software. If you or your company make any
|
|
28
|
+
written claim that the software infringes or contributes to infringement of any patent, your patent license
|
|
29
|
+
for the software granted under these terms ends immediately. If your company makes such a claim, your patent
|
|
30
|
+
license ends immediately for work on behalf of your company.
|
|
31
|
+
|
|
32
|
+
Notices
|
|
33
|
+
|
|
34
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these
|
|
35
|
+
terms. If you modify the software, you must include in any modified copies of the software a prominent notice
|
|
36
|
+
stating that you have modified the software.
|
|
37
|
+
|
|
38
|
+
No Other Rights
|
|
39
|
+
|
|
40
|
+
These terms do not imply any licenses other than those expressly granted in these terms.
|
|
41
|
+
|
|
42
|
+
Termination
|
|
43
|
+
|
|
44
|
+
If you use the software in violation of these terms, such use is not licensed, and your license will
|
|
45
|
+
automatically terminate. If the licensor provides you with a notice of your violation, and you cease all
|
|
46
|
+
violation of this license no later than 30 days after you receive that notice, your license will be reinstated
|
|
47
|
+
retroactively. However, if you violate these terms after such reinstatement, any additional violation of these
|
|
48
|
+
terms will cause your license to terminate automatically and permanently.
|
|
49
|
+
|
|
50
|
+
No Liability
|
|
51
|
+
|
|
52
|
+
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will
|
|
53
|
+
not be liable to you for any damages arising out of these terms or the use or nature of the software, under
|
|
54
|
+
any kind of legal claim.
|
|
55
|
+
|
|
56
|
+
Definitions
|
|
57
|
+
|
|
58
|
+
The “licensor” is the entity offering these terms.
|
|
59
|
+
|
|
60
|
+
The “software” is the software the licensor makes available under these terms, including any portion of it.
|
|
61
|
+
|
|
62
|
+
“You” refers to the individual or entity agreeing to these terms.
|
|
63
|
+
|
|
64
|
+
“Your company” is any legal entity, sole proprietorship, or other kind of organization that you work for, plus
|
|
65
|
+
all organizations that have control over, are under the control of, or are under common control with that
|
|
66
|
+
organization. Control means ownership of substantially all the assets of an entity, or the power to direct its
|
|
67
|
+
management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
68
|
+
|
|
69
|
+
“Your license” is the license granted to you for the software under these terms.
|
|
70
|
+
|
|
71
|
+
“Use” means anything you do with the software requiring your license.
|
|
72
|
+
|
|
73
|
+
“Trademark” means trademarks, service marks, and similar rights.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyrorb
|
|
3
|
+
Version: 26.11.24.1
|
|
4
|
+
Summary: PyRORB: an in-development Python rainfall-runoff routing implementation
|
|
5
|
+
License-Expression: LicenseRef-SUL-1.0
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: typing_extensions>=4.12
|
|
10
|
+
Provides-Extra: mcp
|
|
11
|
+
Requires-Dist: mcp<3,>=2.3; extra == "mcp"
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Requires-Dist: build; extra == "dev"
|
|
14
|
+
Requires-Dist: pytest; extra == "dev"
|
|
15
|
+
Requires-Dist: mcp<3,>=2.3; extra == "dev"
|
|
16
|
+
Requires-Dist: pyright; extra == "dev"
|
|
17
|
+
Requires-Dist: ruff==0.16.6; extra == "dev"
|
|
18
|
+
Provides-Extra: research
|
|
19
|
+
Requires-Dist: scipy>=1.15; extra == "research"
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# PyRORB
|
|
23
|
+
|
|
24
|
+
**PyRORB** is an **in-development** Python package for selected RORB rainfall–runoff procedures, including canonical dependency-light RORB report readers maintained in PyRORB. Normal Python runs and the public regression suite require **no private repository and no native RORB executable**. This is not a certified full CMD replacement or a released hydrologic product.
|
|
25
|
+
|
|
26
|
+
The repository and distribution use `pyrorb`; the Python import namespace remains `runoff_routing`. Install from the public checkout below while PyPI publication is deferred. The [naming and compatibility policy](docs/NAMING.md) distinguishes current branding from stable file-format and provenance identifiers.
|
|
27
|
+
|
|
28
|
+
## Install and execute a supplied storm
|
|
29
|
+
|
|
30
|
+
Python **3.11, 3.12, 3.13 or 3.14** (3.14 preferred for development), on **Linux or Windows**, is supported for pure-Python development. From a checkout of [Chain-Frost/pyrorb](https://github.com/Chain-Frost/pyrorb):
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
python -m pip install -r requirements-catg.txt -e ".[dev]"
|
|
34
|
+
python repo-scripts/check_local.py
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The first command installs the package, development tools and the optional PR-pinned PyRomb writer. To install only the core checkout, use `python -m pip install -e .`; edited CATG export requires the separately installed writer. See [CATG authoring](docs/RORB_GE_AUTHORING.md). the second runs repository, Ruff, strict Pyright and non-native test checks. A virtual environment is optional. For an existing explicit S1 run document, run the checked-in synthetic example:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from pathlib import Path
|
|
41
|
+
from runoff_routing.integration import read_run_json, run_model
|
|
42
|
+
|
|
43
|
+
model = read_run_json(Path("examples/synthetic-run.json").read_text(encoding="utf-8"))
|
|
44
|
+
result = run_model(model)
|
|
45
|
+
print(result.to_csv())
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This executes the supported direct S2 engineering API. Schema-based project and CLI execution uses the temporary `python-cmd` default described below. The example is a software smoke check, not unrestricted native/engineering-accuracy acceptance. See the [quickstart](docs/QUICKSTART.md) for projects, explicit engine selection, batches, installed wheels and reproducible offline regression.
|
|
49
|
+
|
|
50
|
+
## Three selectable product engines
|
|
51
|
+
|
|
52
|
+
| Engine ID | Role | Current main availability |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `python-cmd` | **Temporary project/CLI default**, CMD 6.44 compatible arithmetic | Bounded computation and original-source regression; full feature/physical qualification remains under #5. |
|
|
55
|
+
| `python` | Explicit independent engineering implementation; **intended long-term default** | Supported event/batch method, including merged #110/#125 mode-2 and code-2/impervious counterparts; broader accuracy remains separately qualified. |
|
|
56
|
+
| `rorb-cmd` | Explicit optional user-installed native CMD adapter | Verified local executable/configuration and supported inputs; no bundled binary or engine fallback. |
|
|
57
|
+
|
|
58
|
+
Projects preserve the engine/profile separately from rainfall source and method. Historical engine-less schema-1 projects retain `python`; explicitly stored choices never migrate silently. See the [engine contract](docs/ENGINES.md) and [current status](docs/STATUS.md) for supported subsets and acceptance limits.
|
|
59
|
+
|
|
60
|
+
## Development priority
|
|
61
|
+
|
|
62
|
+
The CLI/text-file MVP #119, deterministic rainfall preparation #136/#175, reporting #155 and the import/edit/export/reader programme #138–#143 are **delivered on main**. Current work includes the owner-approved **provisional** Monte Carlo CLI/API/text implementation from [PR #151](https://github.com/Chain-Frost/pyrorb/pull/151). Its reproducible sampling, routed-event and weighted-frequency software is available on main, but RORBwin statistical equivalence, full probability support and design-flood engineering accuracy are **not qualified**. See [method and limitations](docs/MONTE_CARLO.md). [Current status](docs/STATUS.md) and [the backlog](docs/BACKLOG.md) identify remaining work. Advanced #114–#118 and saved RORBwin PAR #144 remain deferred. Deliverables are CLI, Python API and text files; no graphical-interface implementation, design or planning is included.
|
|
63
|
+
|
|
64
|
+
## Regression and outstanding acceptance
|
|
65
|
+
|
|
66
|
+
The [self-contained public regression guide](docs/REGRESSION_DATASET.md) uses one maintained register and comparator. Current bounded original-CMD evidence is **50/50 printed Q cases / 19,550 ordinates**, **48 reporting-scalar passes and two undefined all-zero peak-time incompletes**. The former 14 source exclusions were admitted by #132; 36-case results are historical. Original native gaps, authored controls and unresolved feature/site/physical qualifications remain explicit. `--snapshot` compares historical candidate outputs and does not execute the installed engine. Exact source/wheel receipts are linked from [current status](docs/STATUS.md).
|
|
67
|
+
|
|
68
|
+
The [engineering method and CMD deviation policy](docs/ENGINEERING_METHOD.md), [batch contract](docs/ENGINEERING_BATCHES.md), [single CMD feature matrix](docs/CMD_FEATURE_MATRIX.md) and open [CMD gate #5](https://github.com/Chain-Frost/pyrorb/issues/5) distinguish delivered software from scientific acceptance. Monte Carlo's independently verified software subset is admitted **provisionally**, while [#9](https://github.com/Chain-Frost/pyrorb/issues/9) remains open for native/source/statistical/physical-catchment qualification. The first public release remains separately gated; the reader implementation is now owned by PyRORB, with ryan-tools compatibility imports planned after that release.
|
|
69
|
+
|
|
70
|
+
## Documentation and source custody
|
|
71
|
+
|
|
72
|
+
- [Quickstart and commands](docs/QUICKSTART.md) · [documentation index](docs/README.md) · [development guide](docs/DEVELOPMENT.md) · [source register](docs/SOURCES.md) · [regression policy](docs/REGRESSION.md).
|
|
73
|
+
- Preserve authentic native inputs, original source identities/hashes, exact raw clocks, full horizons and frozen metrics. Approved, path-sanitised public data are versioned test evidence; original and transformed bytes are not interchangeable.
|
|
74
|
+
- The private investigations repository is for agent research only. No executable, manual, restricted capture, client data or private installation path is distributed. The optional RORBwin loss profile is experimental and not the default method. This project is not endorsed by RORB's authors or custodians.
|
|
75
|
+
|
|
76
|
+
Python compatibility: [24 November 2026 migration receipt](docs/work/2026-11-24-python311-compatibility.md).
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# PyRORB
|
|
2
|
+
|
|
3
|
+
**PyRORB** is an **in-development** Python package for selected RORB rainfall–runoff procedures, including canonical dependency-light RORB report readers maintained in PyRORB. Normal Python runs and the public regression suite require **no private repository and no native RORB executable**. This is not a certified full CMD replacement or a released hydrologic product.
|
|
4
|
+
|
|
5
|
+
The repository and distribution use `pyrorb`; the Python import namespace remains `runoff_routing`. Install from the public checkout below while PyPI publication is deferred. The [naming and compatibility policy](docs/NAMING.md) distinguishes current branding from stable file-format and provenance identifiers.
|
|
6
|
+
|
|
7
|
+
## Install and execute a supplied storm
|
|
8
|
+
|
|
9
|
+
Python **3.11, 3.12, 3.13 or 3.14** (3.14 preferred for development), on **Linux or Windows**, is supported for pure-Python development. From a checkout of [Chain-Frost/pyrorb](https://github.com/Chain-Frost/pyrorb):
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
python -m pip install -r requirements-catg.txt -e ".[dev]"
|
|
13
|
+
python repo-scripts/check_local.py
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The first command installs the package, development tools and the optional PR-pinned PyRomb writer. To install only the core checkout, use `python -m pip install -e .`; edited CATG export requires the separately installed writer. See [CATG authoring](docs/RORB_GE_AUTHORING.md). the second runs repository, Ruff, strict Pyright and non-native test checks. A virtual environment is optional. For an existing explicit S1 run document, run the checked-in synthetic example:
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
from runoff_routing.integration import read_run_json, run_model
|
|
21
|
+
|
|
22
|
+
model = read_run_json(Path("examples/synthetic-run.json").read_text(encoding="utf-8"))
|
|
23
|
+
result = run_model(model)
|
|
24
|
+
print(result.to_csv())
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This executes the supported direct S2 engineering API. Schema-based project and CLI execution uses the temporary `python-cmd` default described below. The example is a software smoke check, not unrestricted native/engineering-accuracy acceptance. See the [quickstart](docs/QUICKSTART.md) for projects, explicit engine selection, batches, installed wheels and reproducible offline regression.
|
|
28
|
+
|
|
29
|
+
## Three selectable product engines
|
|
30
|
+
|
|
31
|
+
| Engine ID | Role | Current main availability |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `python-cmd` | **Temporary project/CLI default**, CMD 6.44 compatible arithmetic | Bounded computation and original-source regression; full feature/physical qualification remains under #5. |
|
|
34
|
+
| `python` | Explicit independent engineering implementation; **intended long-term default** | Supported event/batch method, including merged #110/#125 mode-2 and code-2/impervious counterparts; broader accuracy remains separately qualified. |
|
|
35
|
+
| `rorb-cmd` | Explicit optional user-installed native CMD adapter | Verified local executable/configuration and supported inputs; no bundled binary or engine fallback. |
|
|
36
|
+
|
|
37
|
+
Projects preserve the engine/profile separately from rainfall source and method. Historical engine-less schema-1 projects retain `python`; explicitly stored choices never migrate silently. See the [engine contract](docs/ENGINES.md) and [current status](docs/STATUS.md) for supported subsets and acceptance limits.
|
|
38
|
+
|
|
39
|
+
## Development priority
|
|
40
|
+
|
|
41
|
+
The CLI/text-file MVP #119, deterministic rainfall preparation #136/#175, reporting #155 and the import/edit/export/reader programme #138–#143 are **delivered on main**. Current work includes the owner-approved **provisional** Monte Carlo CLI/API/text implementation from [PR #151](https://github.com/Chain-Frost/pyrorb/pull/151). Its reproducible sampling, routed-event and weighted-frequency software is available on main, but RORBwin statistical equivalence, full probability support and design-flood engineering accuracy are **not qualified**. See [method and limitations](docs/MONTE_CARLO.md). [Current status](docs/STATUS.md) and [the backlog](docs/BACKLOG.md) identify remaining work. Advanced #114–#118 and saved RORBwin PAR #144 remain deferred. Deliverables are CLI, Python API and text files; no graphical-interface implementation, design or planning is included.
|
|
42
|
+
|
|
43
|
+
## Regression and outstanding acceptance
|
|
44
|
+
|
|
45
|
+
The [self-contained public regression guide](docs/REGRESSION_DATASET.md) uses one maintained register and comparator. Current bounded original-CMD evidence is **50/50 printed Q cases / 19,550 ordinates**, **48 reporting-scalar passes and two undefined all-zero peak-time incompletes**. The former 14 source exclusions were admitted by #132; 36-case results are historical. Original native gaps, authored controls and unresolved feature/site/physical qualifications remain explicit. `--snapshot` compares historical candidate outputs and does not execute the installed engine. Exact source/wheel receipts are linked from [current status](docs/STATUS.md).
|
|
46
|
+
|
|
47
|
+
The [engineering method and CMD deviation policy](docs/ENGINEERING_METHOD.md), [batch contract](docs/ENGINEERING_BATCHES.md), [single CMD feature matrix](docs/CMD_FEATURE_MATRIX.md) and open [CMD gate #5](https://github.com/Chain-Frost/pyrorb/issues/5) distinguish delivered software from scientific acceptance. Monte Carlo's independently verified software subset is admitted **provisionally**, while [#9](https://github.com/Chain-Frost/pyrorb/issues/9) remains open for native/source/statistical/physical-catchment qualification. The first public release remains separately gated; the reader implementation is now owned by PyRORB, with ryan-tools compatibility imports planned after that release.
|
|
48
|
+
|
|
49
|
+
## Documentation and source custody
|
|
50
|
+
|
|
51
|
+
- [Quickstart and commands](docs/QUICKSTART.md) · [documentation index](docs/README.md) · [development guide](docs/DEVELOPMENT.md) · [source register](docs/SOURCES.md) · [regression policy](docs/REGRESSION.md).
|
|
52
|
+
- Preserve authentic native inputs, original source identities/hashes, exact raw clocks, full horizons and frozen metrics. Approved, path-sanitised public data are versioned test evidence; original and transformed bytes are not interchangeable.
|
|
53
|
+
- The private investigations repository is for agent research only. No executable, manual, restricted capture, client data or private installation path is distributed. The optional RORBwin loss profile is experimental and not the default method. This project is not endorsed by RORB's authors or custodians.
|
|
54
|
+
|
|
55
|
+
Python compatibility: [24 November 2026 migration receipt](docs/work/2026-11-24-python311-compatibility.md).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pyrorb"
|
|
7
|
+
version = "26.11.24.1"
|
|
8
|
+
description = "PyRORB: an in-development Python rainfall-runoff routing implementation"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "LicenseRef-SUL-1.0"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
dependencies = [
|
|
14
|
+
"typing_extensions>=4.12",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[project.optional-dependencies]
|
|
18
|
+
mcp = ["mcp>=2.3,<3"]
|
|
19
|
+
dev = ["build", "pytest", "mcp>=2.3,<3", "pyright", "ruff==0.16.6"]
|
|
20
|
+
research = ["scipy>=1.15"]
|
|
21
|
+
|
|
22
|
+
[tool.setuptools.packages.find]
|
|
23
|
+
where = ["src"]
|
|
24
|
+
|
|
25
|
+
[tool.setuptools.package-data]
|
|
26
|
+
runoff_routing = ["py.typed"]
|
|
27
|
+
|
|
28
|
+
[tool.pyright]
|
|
29
|
+
include = ["src", "repo-scripts", "tests"]
|
|
30
|
+
exclude = [".local", "tests/fixtures", "build", "dist"]
|
|
31
|
+
pythonVersion = "3.11"
|
|
32
|
+
pythonPlatform = "Windows"
|
|
33
|
+
typeCheckingMode = "strict"
|
|
34
|
+
|
|
35
|
+
[tool.pytest.ini_options]
|
|
36
|
+
testpaths = ["tests"]
|
|
37
|
+
addopts = "-ra --strict-markers"
|
|
38
|
+
markers = [
|
|
39
|
+
"native: explicitly requested local reference-engine acceptance",
|
|
40
|
+
"regression: comparison against retained reference evidence",
|
|
41
|
+
"benchmark: explicitly requested timing and memory measurements",
|
|
42
|
+
]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyrorb
|
|
3
|
+
Version: 26.11.24.1
|
|
4
|
+
Summary: PyRORB: an in-development Python rainfall-runoff routing implementation
|
|
5
|
+
License-Expression: LicenseRef-SUL-1.0
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: typing_extensions>=4.12
|
|
10
|
+
Provides-Extra: mcp
|
|
11
|
+
Requires-Dist: mcp<3,>=2.3; extra == "mcp"
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Requires-Dist: build; extra == "dev"
|
|
14
|
+
Requires-Dist: pytest; extra == "dev"
|
|
15
|
+
Requires-Dist: mcp<3,>=2.3; extra == "dev"
|
|
16
|
+
Requires-Dist: pyright; extra == "dev"
|
|
17
|
+
Requires-Dist: ruff==0.16.6; extra == "dev"
|
|
18
|
+
Provides-Extra: research
|
|
19
|
+
Requires-Dist: scipy>=1.15; extra == "research"
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# PyRORB
|
|
23
|
+
|
|
24
|
+
**PyRORB** is an **in-development** Python package for selected RORB rainfall–runoff procedures, including canonical dependency-light RORB report readers maintained in PyRORB. Normal Python runs and the public regression suite require **no private repository and no native RORB executable**. This is not a certified full CMD replacement or a released hydrologic product.
|
|
25
|
+
|
|
26
|
+
The repository and distribution use `pyrorb`; the Python import namespace remains `runoff_routing`. Install from the public checkout below while PyPI publication is deferred. The [naming and compatibility policy](docs/NAMING.md) distinguishes current branding from stable file-format and provenance identifiers.
|
|
27
|
+
|
|
28
|
+
## Install and execute a supplied storm
|
|
29
|
+
|
|
30
|
+
Python **3.11, 3.12, 3.13 or 3.14** (3.14 preferred for development), on **Linux or Windows**, is supported for pure-Python development. From a checkout of [Chain-Frost/pyrorb](https://github.com/Chain-Frost/pyrorb):
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
python -m pip install -r requirements-catg.txt -e ".[dev]"
|
|
34
|
+
python repo-scripts/check_local.py
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The first command installs the package, development tools and the optional PR-pinned PyRomb writer. To install only the core checkout, use `python -m pip install -e .`; edited CATG export requires the separately installed writer. See [CATG authoring](docs/RORB_GE_AUTHORING.md). the second runs repository, Ruff, strict Pyright and non-native test checks. A virtual environment is optional. For an existing explicit S1 run document, run the checked-in synthetic example:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from pathlib import Path
|
|
41
|
+
from runoff_routing.integration import read_run_json, run_model
|
|
42
|
+
|
|
43
|
+
model = read_run_json(Path("examples/synthetic-run.json").read_text(encoding="utf-8"))
|
|
44
|
+
result = run_model(model)
|
|
45
|
+
print(result.to_csv())
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This executes the supported direct S2 engineering API. Schema-based project and CLI execution uses the temporary `python-cmd` default described below. The example is a software smoke check, not unrestricted native/engineering-accuracy acceptance. See the [quickstart](docs/QUICKSTART.md) for projects, explicit engine selection, batches, installed wheels and reproducible offline regression.
|
|
49
|
+
|
|
50
|
+
## Three selectable product engines
|
|
51
|
+
|
|
52
|
+
| Engine ID | Role | Current main availability |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `python-cmd` | **Temporary project/CLI default**, CMD 6.44 compatible arithmetic | Bounded computation and original-source regression; full feature/physical qualification remains under #5. |
|
|
55
|
+
| `python` | Explicit independent engineering implementation; **intended long-term default** | Supported event/batch method, including merged #110/#125 mode-2 and code-2/impervious counterparts; broader accuracy remains separately qualified. |
|
|
56
|
+
| `rorb-cmd` | Explicit optional user-installed native CMD adapter | Verified local executable/configuration and supported inputs; no bundled binary or engine fallback. |
|
|
57
|
+
|
|
58
|
+
Projects preserve the engine/profile separately from rainfall source and method. Historical engine-less schema-1 projects retain `python`; explicitly stored choices never migrate silently. See the [engine contract](docs/ENGINES.md) and [current status](docs/STATUS.md) for supported subsets and acceptance limits.
|
|
59
|
+
|
|
60
|
+
## Development priority
|
|
61
|
+
|
|
62
|
+
The CLI/text-file MVP #119, deterministic rainfall preparation #136/#175, reporting #155 and the import/edit/export/reader programme #138–#143 are **delivered on main**. Current work includes the owner-approved **provisional** Monte Carlo CLI/API/text implementation from [PR #151](https://github.com/Chain-Frost/pyrorb/pull/151). Its reproducible sampling, routed-event and weighted-frequency software is available on main, but RORBwin statistical equivalence, full probability support and design-flood engineering accuracy are **not qualified**. See [method and limitations](docs/MONTE_CARLO.md). [Current status](docs/STATUS.md) and [the backlog](docs/BACKLOG.md) identify remaining work. Advanced #114–#118 and saved RORBwin PAR #144 remain deferred. Deliverables are CLI, Python API and text files; no graphical-interface implementation, design or planning is included.
|
|
63
|
+
|
|
64
|
+
## Regression and outstanding acceptance
|
|
65
|
+
|
|
66
|
+
The [self-contained public regression guide](docs/REGRESSION_DATASET.md) uses one maintained register and comparator. Current bounded original-CMD evidence is **50/50 printed Q cases / 19,550 ordinates**, **48 reporting-scalar passes and two undefined all-zero peak-time incompletes**. The former 14 source exclusions were admitted by #132; 36-case results are historical. Original native gaps, authored controls and unresolved feature/site/physical qualifications remain explicit. `--snapshot` compares historical candidate outputs and does not execute the installed engine. Exact source/wheel receipts are linked from [current status](docs/STATUS.md).
|
|
67
|
+
|
|
68
|
+
The [engineering method and CMD deviation policy](docs/ENGINEERING_METHOD.md), [batch contract](docs/ENGINEERING_BATCHES.md), [single CMD feature matrix](docs/CMD_FEATURE_MATRIX.md) and open [CMD gate #5](https://github.com/Chain-Frost/pyrorb/issues/5) distinguish delivered software from scientific acceptance. Monte Carlo's independently verified software subset is admitted **provisionally**, while [#9](https://github.com/Chain-Frost/pyrorb/issues/9) remains open for native/source/statistical/physical-catchment qualification. The first public release remains separately gated; the reader implementation is now owned by PyRORB, with ryan-tools compatibility imports planned after that release.
|
|
69
|
+
|
|
70
|
+
## Documentation and source custody
|
|
71
|
+
|
|
72
|
+
- [Quickstart and commands](docs/QUICKSTART.md) · [documentation index](docs/README.md) · [development guide](docs/DEVELOPMENT.md) · [source register](docs/SOURCES.md) · [regression policy](docs/REGRESSION.md).
|
|
73
|
+
- Preserve authentic native inputs, original source identities/hashes, exact raw clocks, full horizons and frozen metrics. Approved, path-sanitised public data are versioned test evidence; original and transformed bytes are not interchangeable.
|
|
74
|
+
- The private investigations repository is for agent research only. No executable, manual, restricted capture, client data or private installation path is distributed. The optional RORBwin loss profile is experimental and not the default method. This project is not endorsed by RORB's authors or custodians.
|
|
75
|
+
|
|
76
|
+
Python compatibility: [24 November 2026 migration receipt](docs/work/2026-11-24-python311-compatibility.md).
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/pyrorb.egg-info/PKG-INFO
|
|
5
|
+
src/pyrorb.egg-info/SOURCES.txt
|
|
6
|
+
src/pyrorb.egg-info/dependency_links.txt
|
|
7
|
+
src/pyrorb.egg-info/requires.txt
|
|
8
|
+
src/pyrorb.egg-info/top_level.txt
|
|
9
|
+
src/runoff_routing/__init__.py
|
|
10
|
+
src/runoff_routing/arr_arf.py
|
|
11
|
+
src/runoff_routing/arr_data.py
|
|
12
|
+
src/runoff_routing/arr_design_batch.py
|
|
13
|
+
src/runoff_routing/arr_import.py
|
|
14
|
+
src/runoff_routing/arr_legacy.py
|
|
15
|
+
src/runoff_routing/arr_losses.py
|
|
16
|
+
src/runoff_routing/arr_patterns.py
|
|
17
|
+
src/runoff_routing/arr_report.py
|
|
18
|
+
src/runoff_routing/arr_result_summary.py
|
|
19
|
+
src/runoff_routing/arr_selection.py
|
|
20
|
+
src/runoff_routing/arr_storm.py
|
|
21
|
+
src/runoff_routing/bom_ifd.py
|
|
22
|
+
src/runoff_routing/cmd_deviation.py
|
|
23
|
+
src/runoff_routing/cmd_engine.py
|
|
24
|
+
src/runoff_routing/engine_execution.py
|
|
25
|
+
src/runoff_routing/engine_provenance.py
|
|
26
|
+
src/runoff_routing/engine_types.py
|
|
27
|
+
src/runoff_routing/engineering_batch.py
|
|
28
|
+
src/runoff_routing/integration.py
|
|
29
|
+
src/runoff_routing/integration_reporting.py
|
|
30
|
+
src/runoff_routing/legacy_inputs.py
|
|
31
|
+
src/runoff_routing/mcp_catalog.py
|
|
32
|
+
src/runoff_routing/mcp_reference.py
|
|
33
|
+
src/runoff_routing/mcp_results.py
|
|
34
|
+
src/runoff_routing/mcp_server.py
|
|
35
|
+
src/runoff_routing/mcp_tool_errors.py
|
|
36
|
+
src/runoff_routing/monte_carlo_bridge.py
|
|
37
|
+
src/runoff_routing/monte_carlo_comparison.py
|
|
38
|
+
src/runoff_routing/monte_carlo_effective.py
|
|
39
|
+
src/runoff_routing/monte_carlo_execution.py
|
|
40
|
+
src/runoff_routing/monte_carlo_frequency.py
|
|
41
|
+
src/runoff_routing/monte_carlo_frequency_bridge.py
|
|
42
|
+
src/runoff_routing/monte_carlo_plan.py
|
|
43
|
+
src/runoff_routing/native_cmd.py
|
|
44
|
+
src/runoff_routing/native_export.py
|
|
45
|
+
src/runoff_routing/offline_reference.py
|
|
46
|
+
src/runoff_routing/onset_diagnostics.py
|
|
47
|
+
src/runoff_routing/par_project_import.py
|
|
48
|
+
src/runoff_routing/parity_metrics.py
|
|
49
|
+
src/runoff_routing/project_batch.py
|
|
50
|
+
src/runoff_routing/project_execution.py
|
|
51
|
+
src/runoff_routing/project_json.py
|
|
52
|
+
src/runoff_routing/project_native_review.py
|
|
53
|
+
src/runoff_routing/py.typed
|
|
54
|
+
src/runoff_routing/reach_analysis.py
|
|
55
|
+
src/runoff_routing/reach_routing.py
|
|
56
|
+
src/runoff_routing/reference.py
|
|
57
|
+
src/runoff_routing/reference_compare.py
|
|
58
|
+
src/runoff_routing/regression_dataset.py
|
|
59
|
+
src/runoff_routing/regression_metric_controls.py
|
|
60
|
+
src/runoff_routing/regression_metrics.py
|
|
61
|
+
src/runoff_routing/regression_scalar_adapter.py
|
|
62
|
+
src/runoff_routing/reporting_conventions.py
|
|
63
|
+
src/runoff_routing/rorb_codec.py
|
|
64
|
+
src/runoff_routing/rorb_documents.py
|
|
65
|
+
src/runoff_routing/rorb_ge_authoring.py
|
|
66
|
+
src/runoff_routing/rorb_ge_gis.py
|
|
67
|
+
src/runoff_routing/rorb_ge_profile.py
|
|
68
|
+
src/runoff_routing/rorb_inspect.py
|
|
69
|
+
src/runoff_routing/rorb_model.py
|
|
70
|
+
src/runoff_routing/rorb_out.py
|
|
71
|
+
src/runoff_routing/rorb_par.py
|
|
72
|
+
src/runoff_routing/rorb_report_views.py
|
|
73
|
+
src/runoff_routing/rorbwin_losses.py
|
|
74
|
+
src/runoff_routing/single_storm.py
|
|
75
|
+
src/runoff_routing/_cmd644/__init__.py
|
|
76
|
+
src/runoff_routing/_cmd644/geometry.py
|
|
77
|
+
src/runoff_routing/_cmd644/models.py
|
|
78
|
+
src/runoff_routing/_cmd644/native_diagnostics.py
|
|
79
|
+
src/runoff_routing/_cmd644/power.py
|
|
80
|
+
src/runoff_routing/_cmd644/precision.py
|
|
81
|
+
src/runoff_routing/_cmd644/preparation.py
|
|
82
|
+
src/runoff_routing/_cmd644/reporting.py
|
|
83
|
+
src/runoff_routing/_cmd644/routing.py
|
|
84
|
+
src/runoff_routing/rorb_readers/__init__.py
|
|
85
|
+
src/runoff_routing/rorb_readers/associations.py
|
|
86
|
+
src/runoff_routing/rorb_readers/output_reader.py
|
|
87
|
+
src/runoff_routing/rorb_readers/parameter_reader.py
|
|
88
|
+
src/runoff_routing/rorb_readers/reader_types.py
|
|
89
|
+
src/runoff_routing/rorb_readers/readers.py
|
|
90
|
+
src/runoff_routing/rorb_readers/result_readers.py
|
|
91
|
+
tests/test_arr_arf.py
|
|
92
|
+
tests/test_arr_arf_2026.py
|
|
93
|
+
tests/test_arr_data.py
|
|
94
|
+
tests/test_arr_design_batch.py
|
|
95
|
+
tests/test_arr_legacy.py
|
|
96
|
+
tests/test_arr_losses.py
|
|
97
|
+
tests/test_arr_patterns.py
|
|
98
|
+
tests/test_arr_result_summary.py
|
|
99
|
+
tests/test_arr_selection.py
|
|
100
|
+
tests/test_auto_release_version.py
|
|
101
|
+
tests/test_bom_ifd.py
|
|
102
|
+
tests/test_canonical_rorb_reader.py
|
|
103
|
+
tests/test_cmd91_multisite.py
|
|
104
|
+
tests/test_cmd92_boundaries.py
|
|
105
|
+
tests/test_cmd96_code2_fi_kernel.py
|
|
106
|
+
tests/test_cmd96_pr16_typed_bridge.py
|
|
107
|
+
tests/test_cmd_deviation.py
|
|
108
|
+
tests/test_cmd_engine.py
|
|
109
|
+
tests/test_cmd_native_target_diagnostics.py
|
|
110
|
+
tests/test_cmd_public_probe.py
|
|
111
|
+
tests/test_engine_contract.py
|
|
112
|
+
tests/test_engineering_accuracy.py
|
|
113
|
+
tests/test_engineering_batch.py
|
|
114
|
+
tests/test_engineering_loss_mode2.py
|
|
115
|
+
tests/test_ge_652_profile.py
|
|
116
|
+
tests/test_integration.py
|
|
117
|
+
tests/test_integration_reporting.py
|
|
118
|
+
tests/test_legacy_inputs.py
|
|
119
|
+
tests/test_mc150_frequency_adapter.py
|
|
120
|
+
tests/test_mc150_independent_reference.py
|
|
121
|
+
tests/test_mc150_sampler_adapter.py
|
|
122
|
+
tests/test_mc_convergence_research.py
|
|
123
|
+
tests/test_mc_physical_preflight.py
|
|
124
|
+
tests/test_mcp_reference.py
|
|
125
|
+
tests/test_mcp_results.py
|
|
126
|
+
tests/test_mcp_server.py
|
|
127
|
+
tests/test_mcp_stdio.py
|
|
128
|
+
tests/test_mcp_tool_errors.py
|
|
129
|
+
tests/test_metric_controls.py
|
|
130
|
+
tests/test_monte_carlo_bridge.py
|
|
131
|
+
tests/test_monte_carlo_comparison.py
|
|
132
|
+
tests/test_monte_carlo_execution.py
|
|
133
|
+
tests/test_monte_carlo_frequency.py
|
|
134
|
+
tests/test_monte_carlo_integration.py
|
|
135
|
+
tests/test_monte_carlo_interval_contribution.py
|
|
136
|
+
tests/test_monte_carlo_plan.py
|
|
137
|
+
tests/test_native_export.py
|
|
138
|
+
tests/test_nonlinear_printed_balance.py
|
|
139
|
+
tests/test_offline_reference.py
|
|
140
|
+
tests/test_onset_diagnostics.py
|
|
141
|
+
tests/test_original_645_readers.py
|
|
142
|
+
tests/test_original_652_readers.py
|
|
143
|
+
tests/test_par_project_import.py
|
|
144
|
+
tests/test_parity_metrics.py
|
|
145
|
+
tests/test_project_batch.py
|
|
146
|
+
tests/test_project_execution.py
|
|
147
|
+
tests/test_project_json.py
|
|
148
|
+
tests/test_project_native_review.py
|
|
149
|
+
tests/test_publishing_workflow.py
|
|
150
|
+
tests/test_python96_code2_impervious.py
|
|
151
|
+
tests/test_python96_import_adapter.py
|
|
152
|
+
tests/test_python96_original_deviation.py
|
|
153
|
+
tests/test_quality_policy.py
|
|
154
|
+
tests/test_reach_analysis.py
|
|
155
|
+
tests/test_reach_routing.py
|
|
156
|
+
tests/test_reference.py
|
|
157
|
+
tests/test_regression_dataset.py
|
|
158
|
+
tests/test_regression_public_native.py
|
|
159
|
+
tests/test_regression_scalars.py
|
|
160
|
+
tests/test_release_checks.py
|
|
161
|
+
tests/test_report_metrics.py
|
|
162
|
+
tests/test_reporting_conventions.py
|
|
163
|
+
tests/test_repository_checks.py
|
|
164
|
+
tests/test_rorb_ge_authoring.py
|
|
165
|
+
tests/test_rorb_inspection.py
|
|
166
|
+
tests/test_rorb_reader_contract.py
|
|
167
|
+
tests/test_rorb_report_views.py
|
|
168
|
+
tests/test_rorb_roundtrip.py
|
|
169
|
+
tests/test_rorbwin_losses.py
|
|
170
|
+
tests/test_s5_workflow_acceptance.py
|
|
171
|
+
tests/test_scaffold.py
|
|
172
|
+
tests/test_single_storm.py
|
|
173
|
+
tests/test_typed_effective_model.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
runoff_routing
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""PyRORB's Python API, retained under the runoff_routing import namespace."""
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"""Ordered source membership geometry and odd/even p53 weighted-distance rule."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from fractions import Fraction
|
|
5
|
+
|
|
6
|
+
from .models import Event
|
|
7
|
+
from .precision import UnsupportedNumericPath, add53, div53, fraction, mul53, store_rational
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass(frozen=True, slots=True)
|
|
11
|
+
class ReachGeometry:
|
|
12
|
+
"""Coefficient values for a reach in original encounter order."""
|
|
13
|
+
|
|
14
|
+
reach_id: int
|
|
15
|
+
length_km: float
|
|
16
|
+
relative_delay: float
|
|
17
|
+
coefficient: float
|
|
18
|
+
coefficient_seconds: float
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass(frozen=True, slots=True)
|
|
22
|
+
class Geometry:
|
|
23
|
+
"""Whole-event mean and reach coefficients from stored input geometry."""
|
|
24
|
+
|
|
25
|
+
distances: tuple[float, ...]
|
|
26
|
+
total_area: float
|
|
27
|
+
weighted_total: float
|
|
28
|
+
mean_distance: float
|
|
29
|
+
reaches: tuple[ReachGeometry, ...]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _source_distances(event: Event) -> tuple[list[float], list[float]]:
|
|
33
|
+
"""Compute C11-C13 geometry without changing the control evaluation order."""
|
|
34
|
+
distances = [0.0] * event.source_count
|
|
35
|
+
active: set[int] | None = None
|
|
36
|
+
branches: list[set[int]] = []
|
|
37
|
+
reach_lengths: list[float] = []
|
|
38
|
+
source = 0
|
|
39
|
+
for control in event.controls:
|
|
40
|
+
code = control.code
|
|
41
|
+
if code == 2 and active is None:
|
|
42
|
+
message = "code-2 source needs an existing running hydrograph"
|
|
43
|
+
raise UnsupportedNumericPath(message)
|
|
44
|
+
if code in (1, 2):
|
|
45
|
+
if active is None:
|
|
46
|
+
active = set()
|
|
47
|
+
active.add(source)
|
|
48
|
+
source += 1
|
|
49
|
+
elif code == 3:
|
|
50
|
+
active = _active_sources(active)
|
|
51
|
+
branches.append(active.copy())
|
|
52
|
+
active = None
|
|
53
|
+
elif code == 4:
|
|
54
|
+
active = _active_sources(active)
|
|
55
|
+
active.update(branches.pop())
|
|
56
|
+
if code in (1, 2, 5):
|
|
57
|
+
active = _active_sources(active)
|
|
58
|
+
length = control.length.stored
|
|
59
|
+
reach_lengths.append(length)
|
|
60
|
+
for index in sorted(active):
|
|
61
|
+
distances[index] = store_rational(add53(fraction(distances[index]), fraction(length)))
|
|
62
|
+
return distances, reach_lengths
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def compute_geometry(event: Event) -> Geometry: # noqa: C901 -- bounded zero terminal copy guard
|
|
66
|
+
"""Compute stored coefficients in the original arithmetic order."""
|
|
67
|
+
distances, reach_lengths = _source_distances(event)
|
|
68
|
+
if not all(x > 0 for x in distances):
|
|
69
|
+
message = "nonpositive source-to-outlet distance"
|
|
70
|
+
raise UnsupportedNumericPath(message)
|
|
71
|
+
area_total = 0.0
|
|
72
|
+
for area in event.areas:
|
|
73
|
+
area_total = store_rational(add53(fraction(area_total), fraction(area.stored)))
|
|
74
|
+
if area_total <= 0:
|
|
75
|
+
message = "nonpositive total area after store"
|
|
76
|
+
raise UnsupportedNumericPath(message)
|
|
77
|
+
even = event.source_count - (event.source_count % 2)
|
|
78
|
+
weighted = Fraction()
|
|
79
|
+
for index in range(even):
|
|
80
|
+
weighted = add53(weighted, mul53(fraction(event.areas[index].stored), fraction(distances[index])))
|
|
81
|
+
weighted_store = store_rational(weighted)
|
|
82
|
+
if even < event.source_count:
|
|
83
|
+
last_product = mul53(fraction(event.areas[-1].stored), fraction(distances[-1]))
|
|
84
|
+
weighted_store = store_rational(add53(fraction(weighted_store), last_product))
|
|
85
|
+
mean = store_rational(div53(fraction(weighted_store), fraction(area_total)))
|
|
86
|
+
if mean <= 0:
|
|
87
|
+
message = "nonpositive stored mean source distance"
|
|
88
|
+
raise UnsupportedNumericPath(message)
|
|
89
|
+
inverse = div53(Fraction(1), fraction(mean))
|
|
90
|
+
reaches: list[ReachGeometry] = []
|
|
91
|
+
for reach_id, length in enumerate(reach_lengths, 1):
|
|
92
|
+
relative = store_rational(mul53(fraction(length), inverse))
|
|
93
|
+
coefficient = store_rational(mul53(fraction(event.kc.stored), fraction(relative)))
|
|
94
|
+
seconds = store_rational(mul53(fraction(coefficient), Fraction(3600)))
|
|
95
|
+
if length == 0.0:
|
|
96
|
+
if relative != 0.0 or coefficient != 0.0 or seconds != 0.0:
|
|
97
|
+
message = f"reach {reach_id}: zero-length coefficient mismatch"
|
|
98
|
+
raise UnsupportedNumericPath(message)
|
|
99
|
+
elif min(relative, coefficient, seconds) <= 0:
|
|
100
|
+
message = f"reach {reach_id}: positive coefficient underflow"
|
|
101
|
+
raise UnsupportedNumericPath(message)
|
|
102
|
+
reaches.append(ReachGeometry(reach_id, length, relative, coefficient, seconds))
|
|
103
|
+
return Geometry(tuple(distances), area_total, weighted_store, mean, tuple(reaches))
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def _active_sources(active: set[int] | None) -> set[int]:
|
|
107
|
+
if active is None:
|
|
108
|
+
message = "geometry requires an active source branch"
|
|
109
|
+
raise UnsupportedNumericPath(message)
|
|
110
|
+
return active
|