rivia 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. rivia-0.1.0/.gitignore +49 -0
  2. rivia-0.1.0/.readthedocs.yaml +21 -0
  3. rivia-0.1.0/CREDITS +22 -0
  4. rivia-0.1.0/LICENSE +185 -0
  5. rivia-0.1.0/NOTICE +13 -0
  6. rivia-0.1.0/PKG-INFO +150 -0
  7. rivia-0.1.0/README.md +102 -0
  8. rivia-0.1.0/build_tool.bat +4 -0
  9. rivia-0.1.0/docs/Makefile +12 -0
  10. rivia-0.1.0/docs/_templates/autosummary/class.rst +29 -0
  11. rivia-0.1.0/docs/_templates/autosummary/module.rst +60 -0
  12. rivia-0.1.0/docs/api/com.rst +17 -0
  13. rivia-0.1.0/docs/api/geo.rst +16 -0
  14. rivia-0.1.0/docs/api/hdf.rst +18 -0
  15. rivia-0.1.0/docs/api/model.rst +22 -0
  16. rivia-0.1.0/docs/api/utils.rst +16 -0
  17. rivia-0.1.0/docs/cln.bat +2 -0
  18. rivia-0.1.0/docs/conf.py +73 -0
  19. rivia-0.1.0/docs/dev/changelog.md +12 -0
  20. rivia-0.1.0/docs/dev/contributing.md +33 -0
  21. rivia-0.1.0/docs/guide/installation.md +25 -0
  22. rivia-0.1.0/docs/guide/introduction.md +58 -0
  23. rivia-0.1.0/docs/guide/quickstart.md +313 -0
  24. rivia-0.1.0/docs/guide/readdata.md +339 -0
  25. rivia-0.1.0/docs/index.rst +29 -0
  26. rivia-0.1.0/docs/make.bat +35 -0
  27. rivia-0.1.0/pyproject.toml +99 -0
  28. rivia-0.1.0/setup.cfg +4 -0
  29. rivia-0.1.0/src/rivia/__init__.py +13 -0
  30. rivia-0.1.0/src/rivia/_version.py +24 -0
  31. rivia-0.1.0/src/rivia/bin/README.txt +19 -0
  32. rivia-0.1.0/src/rivia/bin/RasMapperStoreMap.exe +0 -0
  33. rivia-0.1.0/src/rivia/com/__init__.py +3 -0
  34. rivia-0.1.0/src/rivia/com/_geometry.py +347 -0
  35. rivia-0.1.0/src/rivia/com/_runtime.py +296 -0
  36. rivia-0.1.0/src/rivia/com/_ver400.py +2353 -0
  37. rivia-0.1.0/src/rivia/com/_ver500.py +250 -0
  38. rivia-0.1.0/src/rivia/com/_ver503.py +151 -0
  39. rivia-0.1.0/src/rivia/com/controller.py +394 -0
  40. rivia-0.1.0/src/rivia/com/ras.py +84 -0
  41. rivia-0.1.0/src/rivia/com/registry.py +472 -0
  42. rivia-0.1.0/src/rivia/geo/__init__.py +5 -0
  43. rivia-0.1.0/src/rivia/geo/_rasmap.py +3413 -0
  44. rivia-0.1.0/src/rivia/geo/mesh_validation.py +513 -0
  45. rivia-0.1.0/src/rivia/geo/raster.py +686 -0
  46. rivia-0.1.0/src/rivia/hdf/__init__.py +75 -0
  47. rivia-0.1.0/src/rivia/hdf/_base.py +77 -0
  48. rivia-0.1.0/src/rivia/hdf/_geometry.py +2674 -0
  49. rivia-0.1.0/src/rivia/hdf/_plan.py +2947 -0
  50. rivia-0.1.0/src/rivia/hdf/_terrain.py +663 -0
  51. rivia-0.1.0/src/rivia/hdf/_velocity.py +488 -0
  52. rivia-0.1.0/src/rivia/model/__init__.py +590 -0
  53. rivia-0.1.0/src/rivia/model/_dss.py +697 -0
  54. rivia-0.1.0/src/rivia/model/_mapper.py +1898 -0
  55. rivia-0.1.0/src/rivia/model/flow_steady.py +579 -0
  56. rivia-0.1.0/src/rivia/model/flow_unsteady.py +1666 -0
  57. rivia-0.1.0/src/rivia/model/geometry.py +2872 -0
  58. rivia-0.1.0/src/rivia/model/plan.py +427 -0
  59. rivia-0.1.0/src/rivia/model/project.py +326 -0
  60. rivia-0.1.0/src/rivia/utils/__init__.py +6 -0
  61. rivia-0.1.0/src/rivia/utils/fs.py +73 -0
  62. rivia-0.1.0/src/rivia/utils/helpers.py +135 -0
  63. rivia-0.1.0/src/rivia.egg-info/PKG-INFO +150 -0
  64. rivia-0.1.0/src/rivia.egg-info/SOURCES.txt +103 -0
  65. rivia-0.1.0/src/rivia.egg-info/dependency_links.txt +1 -0
  66. rivia-0.1.0/src/rivia.egg-info/requires.txt +28 -0
  67. rivia-0.1.0/src/rivia.egg-info/top_level.txt +1 -0
  68. rivia-0.1.0/tests/__init__.py +0 -0
  69. rivia-0.1.0/tests/com/test_registry.py +112 -0
  70. rivia-0.1.0/tests/geo/__init__.py +0 -0
  71. rivia-0.1.0/tests/geo/test_rasmap.py +844 -0
  72. rivia-0.1.0/tests/hdf/__init__.py +0 -0
  73. rivia-0.1.0/tests/hdf/conftest.py +209 -0
  74. rivia-0.1.0/tests/hdf/test_base.py +63 -0
  75. rivia-0.1.0/tests/hdf/test_geometry.py +195 -0
  76. rivia-0.1.0/tests/hdf/test_plan.py +365 -0
  77. rivia-0.1.0/tests/hdf/test_velocity.py +443 -0
  78. rivia-0.1.0/tests/model/__init__.py +0 -0
  79. rivia-0.1.0/tests/model/fixtures/3reach_lat.g01 +506 -0
  80. rivia-0.1.0/tests/model/fixtures/baldeagle_1d.u02 +132 -0
  81. rivia-0.1.0/tests/model/fixtures/baldeagle_unsteady1d.p01 +349 -0
  82. rivia-0.1.0/tests/model/fixtures/baldeagle_unsteady1d.p02 +225 -0
  83. rivia-0.1.0/tests/model/fixtures/baxter.f01 +52 -0
  84. rivia-0.1.0/tests/model/fixtures/baxter_1d.u01 +117 -0
  85. rivia-0.1.0/tests/model/fixtures/baxter_steady.p01 +171 -0
  86. rivia-0.1.0/tests/model/fixtures/beaver.g01 +1722 -0
  87. rivia-0.1.0/tests/model/fixtures/conspan.f01 +30 -0
  88. rivia-0.1.0/tests/model/fixtures/conspan.g01 +203 -0
  89. rivia-0.1.0/tests/model/fixtures/dambrk.u01 +161 -0
  90. rivia-0.1.0/tests/model/fixtures/dambrk_dss.u02 +151 -0
  91. rivia-0.1.0/tests/model/fixtures/ex1.g01 +238 -0
  92. rivia-0.1.0/tests/model/fixtures/inline_3gates.u01 +91 -0
  93. rivia-0.1.0/tests/model/fixtures/mixed.f01 +43 -0
  94. rivia-0.1.0/tests/model/fixtures/muncie_unsteady2d.p01 +317 -0
  95. rivia-0.1.0/tests/model/fixtures/muncie_unsteady2d_v510.p03 +418 -0
  96. rivia-0.1.0/tests/model/fixtures/nit_inline.g01 +802 -0
  97. rivia-0.1.0/tests/model/fixtures/wailupe.f01 +74 -0
  98. rivia-0.1.0/tests/model/test_geometry_file.py +1397 -0
  99. rivia-0.1.0/tests/model/test_plan.py +363 -0
  100. rivia-0.1.0/tests/model/test_steady_flow_file.py +422 -0
  101. rivia-0.1.0/tests/model/test_unsteady_flow_file.py +823 -0
  102. rivia-0.1.0/tests/test_rivia.py +15 -0
  103. rivia-0.1.0/tools/RasMapperStoreMap/.gitignore +2 -0
  104. rivia-0.1.0/tools/RasMapperStoreMap/Program.cs +821 -0
  105. rivia-0.1.0/tools/RasMapperStoreMap/RasMapperStoreMap.csproj +18 -0
rivia-0.1.0/.gitignore ADDED
@@ -0,0 +1,49 @@
1
+ # Root-level development scripts (not part of the package)
2
+ /*.py
3
+ *.xlsm
4
+ *.tmp
5
+
6
+ # Python build and packaging
7
+ __pycache__/
8
+ *.py[cod]
9
+ *.egg-info/
10
+ dist/
11
+ build/
12
+ *.egg
13
+ *.whl
14
+ *.tar.gz
15
+
16
+ # setuptools-scm generated version file
17
+ src/rivia/_version.py
18
+
19
+ # Testing
20
+ .pytest_cache/
21
+ .coverage
22
+ htmlcov/
23
+
24
+ # Type checking and linting
25
+ .mypy_cache/
26
+ .ruff_cache/
27
+
28
+ # Virtual environments
29
+ .venv/
30
+ venv/
31
+
32
+ # Sphinx build output
33
+ docs/_build/
34
+ docs/api/generated/
35
+
36
+ # IDE
37
+ .vscode/
38
+ .idea/
39
+ *.swp
40
+ *.swo
41
+
42
+ # OS
43
+ Thumbs.db
44
+ .DS_Store
45
+
46
+ # Project-specific
47
+ archive/
48
+ CLAUDE.md
49
+ .claude
@@ -0,0 +1,21 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-22.04
5
+ tools:
6
+ python: "3.11"
7
+
8
+ python:
9
+ install:
10
+ - method: pip
11
+ path: .
12
+ extra_requirements:
13
+ - docs
14
+
15
+ sphinx:
16
+ configuration: docs/conf.py
17
+ fail_on_warning: false
18
+
19
+ formats:
20
+ - pdf
21
+ - epub
rivia-0.1.0/CREDITS ADDED
@@ -0,0 +1,22 @@
1
+ Credits and Acknowledgements
2
+ =============================
3
+
4
+ PyRAS — Gonzalo Peña-Castellanos
5
+ ----------------------------------
6
+ Portions of raspy/com/ (_ver400.py, _ver500.py, _ver503.py) are derived
7
+ from PyRAS, a HEC-RAS Python wrapper originally authored by Gonzalo
8
+ Peña-Castellanos.
9
+
10
+ Original author : Gonzalo Peña-Castellanos
11
+ GitHub : https://github.com/goanpeca
12
+ Repository : original repository no longer publicly available
13
+
14
+ We are grateful for his pioneering work on HEC-RAS COM automation in Python.
15
+
16
+ ras-commander — William (Bill) Katzenmeyer
17
+ ----------------------------------
18
+ The RASMapper result export pipeline in rivia.model and rivia.geo was informed by ideas and
19
+ knowledge shared by Bill, including insights from his ras-commander repository and his direct
20
+ technical guidance on RASMapper's internal algorithm and source code.
21
+
22
+ We are grateful for his generosity in sharing his expertise.
rivia-0.1.0/LICENSE ADDED
@@ -0,0 +1,185 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submit" means any form of electronic, verbal, or
51
+ written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of discussing and
55
+ improving the Work, but excluding communication that is conspicuously
56
+ marked or designated in writing by the copyright owner as "Not a
57
+ Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and added to the
61
+ Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or a Contribution
81
+ incorporated within the Work constitutes direct or contributory patent
82
+ infringement, then any patent licenses granted to You under this
83
+ License for that Work shall terminate as of the date such litigation
84
+ is filed.
85
+
86
+ 4. Redistribution. You may reproduce and distribute copies of the
87
+ Work or Derivative Works thereof in any medium, with or without
88
+ modifications, and in Source or Object form, provided that You
89
+ meet the following conditions:
90
+
91
+ (a) You must give any other recipients of the Work or Derivative
92
+ Works a copy of this License; and
93
+
94
+ (b) You must cause any modified files to carry prominent notices
95
+ stating that You changed the files; and
96
+
97
+ (c) You must retain, in the Source form of any Derivative Works
98
+ that You distribute, all copyright, patent, trademark, and
99
+ attribution notices from the Source form of the Work,
100
+ excluding those notices that do not pertain to any part of
101
+ the Derivative Works; and
102
+
103
+ (d) If the Work includes a "NOTICE" text file as part of its
104
+ distribution, You must include a readable copy of the
105
+ attribution notices contained within such NOTICE file, in
106
+ at least one of the following places: within a NOTICE text
107
+ file distributed as part of the Derivative Works; within
108
+ the Source form or documentation, if provided along with the
109
+ Derivative Works; or, within a display generated by the
110
+ Derivative Works, if and wherever such third-party notices
111
+ normally appear. The contents of the NOTICE file are for
112
+ informational purposes only and do not modify the License.
113
+ You may add Your own attribution notices within Derivative
114
+ Works that You distribute, alongside or as an addendum to
115
+ the NOTICE text from the Work, provided that such additional
116
+ attribution notices cannot be construed as modifying the
117
+ License.
118
+
119
+ You may add Your own license statement for Your modifications and
120
+ may provide additional grant of rights to use, copy, modify, merge,
121
+ publish, distribute, sublicense, and/or sell copies of the
122
+ Derivative Works, and to permit persons to whom the Derivative Works
123
+ is furnished to do so.
124
+
125
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
126
+ any Contribution intentionally submitted for inclusion in the Work
127
+ by You to the Licensor shall be under the terms and conditions of
128
+ this License, without any additional terms or conditions.
129
+ Notwithstanding the above, nothing herein shall supersede or modify
130
+ the terms of any separate license agreement you may have executed
131
+ with Licensor regarding such Contributions.
132
+
133
+ 6. Trademarks. This License does not grant permission to use the trade
134
+ names, trademarks, service marks, or product names of the Licensor,
135
+ except as required for reasonable and customary use in describing the
136
+ origin of the Work and reproducing the content of the NOTICE file.
137
+
138
+ 7. Disclaimer of Warranty. Unless required by applicable law or
139
+ agreed to in writing, Licensor provides the Work (and each
140
+ Contributor provides its Contributions) on an "AS IS" BASIS,
141
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
142
+ implied, including, without limitation, any warranties or conditions
143
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
144
+ PARTICULAR PURPOSE. You are solely responsible for determining the
145
+ appropriateness of using or reproducing the Work and assume any
146
+ risks associated with Your exercise of permissions under this License.
147
+
148
+ 8. Limitation of Liability. In no event and under no legal theory,
149
+ whether in tort (including negligence), contract, or otherwise,
150
+ unless required by applicable law (such as deliberate and grossly
151
+ negligent acts) or agreed to in writing, shall any Contributor be
152
+ liable to You for damages, including any direct, indirect, special,
153
+ incidental, or exemplary damages of any character arising as a
154
+ result of this License or out of the use or inability to use the
155
+ Work (including but not limited to damages for loss of goodwill,
156
+ work stoppage, computer failure or malfunction, or all other
157
+ commercial damages or losses), even if such Contributor has been
158
+ advised of the possibility of such damages.
159
+
160
+ 9. Accepting Warranty or Liability. While redistributing the Work or
161
+ Derivative Works thereof, You may choose to offer, and charge a fee
162
+ for, acceptance of support, warranty, indemnity, or other liability
163
+ obligations and/or rights consistent with this License. However, in
164
+ accepting such obligations, You may offer such obligations only on
165
+ Your own behalf and on Your sole responsibility, not on behalf of
166
+ any other Contributor, and only if You agree to indemnify, defend,
167
+ and hold each Contributor harmless for any liability incurred by,
168
+ or claims asserted against, such Contributor by reason of your
169
+ accepting any such warranty or additional liability.
170
+
171
+ END OF TERMS AND CONDITIONS
172
+
173
+ Copyright 2025 Gyan Basyal and WEST Consultants, Inc.
174
+
175
+ Licensed under the Apache License, Version 2.0 (the "License");
176
+ you may not use this file except in compliance with the License.
177
+ You may obtain a copy of the License at
178
+
179
+ http://www.apache.org/licenses/LICENSE-2.0
180
+
181
+ Unless required by applicable law or agreed to in writing, software
182
+ distributed under the License is distributed on an "AS IS" BASIS,
183
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
184
+ implied. See the License for the specific language governing
185
+ permissions and limitations under the License.
rivia-0.1.0/NOTICE ADDED
@@ -0,0 +1,13 @@
1
+ raspy
2
+ Copyright 2025 Gyan Basyal and WEST Consultants, Inc.
3
+
4
+ This product was developed by Gyan Basyal at WEST Consultants, Inc.
5
+ (https://www.westconsultants.com) and is licensed under the Apache
6
+ License, Version 2.0.
7
+
8
+ ---
9
+
10
+ This software includes algorithms reverse-engineered from HEC-RAS,
11
+ a hydraulic modeling program developed by the U.S. Army Corps of
12
+ Engineers Hydrologic Engineering Center (HEC), which is in the
13
+ public domain.
rivia-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.4
2
+ Name: rivia
3
+ Version: 0.1.0
4
+ Summary: A modern Python interface for HEC-RAS Visualization, Information, and Automation
5
+ Author: Gyan Basyal, WEST Consultants, Inc.
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/gyanz/rivia
8
+ Project-URL: Repository, https://github.com/gyanz/rivia
9
+ Project-URL: Issues, https://github.com/gyanz/rivia/issues
10
+ Keywords: hec-ras,hydraulics,hydrology,modeling,water-resources
11
+ Classifier: Development Status :: 2 - Pre-Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Hydrology
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ License-File: NOTICE
24
+ Requires-Dist: numpy
25
+ Requires-Dist: scipy
26
+ Requires-Dist: pandas
27
+ Requires-Dist: h5py
28
+ Requires-Dist: pywin32; sys_platform == "win32"
29
+ Requires-Dist: psutil; sys_platform == "win32"
30
+ Requires-Dist: pydantic>=2
31
+ Provides-Extra: geo
32
+ Requires-Dist: geopandas; extra == "geo"
33
+ Requires-Dist: rasterio; extra == "geo"
34
+ Requires-Dist: matplotlib; extra == "geo"
35
+ Requires-Dist: numba; extra == "geo"
36
+ Provides-Extra: dev
37
+ Requires-Dist: pytest>=7.0; extra == "dev"
38
+ Requires-Dist: pytest-cov; extra == "dev"
39
+ Requires-Dist: ruff; extra == "dev"
40
+ Requires-Dist: mypy; extra == "dev"
41
+ Requires-Dist: build; extra == "dev"
42
+ Provides-Extra: docs
43
+ Requires-Dist: sphinx>=7.0; extra == "docs"
44
+ Requires-Dist: furo; extra == "docs"
45
+ Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
46
+ Requires-Dist: myst-parser; extra == "docs"
47
+ Dynamic: license-file
48
+
49
+ # RIVIA
50
+
51
+ **RAS Interface for Visualization, Information, and Automation**
52
+
53
+ A modern, modular Python library for interacting with [HEC-RAS](https://www.hec.usace.army.mil/software/hec-ras/) hydraulic modeling software.
54
+
55
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
56
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
57
+ [![Platform](https://img.shields.io/badge/platform-Windows-lightgrey.svg)](https://www.hec.usace.army.mil/software/hec-ras/)
58
+ [![Documentation](https://readthedocs.org/projects/rivia/badge/?version=latest)](https://rivia.readthedocs.io/en/latest/)
59
+
60
+ ## Documentation
61
+
62
+ Full documentation is available at [rivia.readthedocs.io](https://rivia.readthedocs.io).
63
+
64
+ ## Overview
65
+
66
+ `rivia` provides a clean, Pythonic interface for working with HEC-RAS projects:
67
+
68
+ - **Control HEC-RAS** via COM automation — open projects, switch plans, run simulations
69
+ - **Read and write** HEC-RAS text input files (`.prj`, `.g*`, `.p*`, `.f*`, `.u*`)
70
+ - **Access HDF5 results** — water surface, velocity, depth, and other outputs
71
+ - **Export rasters** — pixel-perfect RASMapper-equivalent rasters (WSE, depth, velocity, etc.)
72
+ - **Export terrain** — mosaic and modify terrain from HEC-RAS terrain HDF files
73
+
74
+ ## Requirements
75
+
76
+ - **Windows** — HEC-RAS is Windows-only
77
+ - Python 3.10+
78
+ - HEC-RAS 5.x or later installed
79
+
80
+ ## Installation
81
+
82
+ ```bash
83
+ pip install rivia
84
+ ```
85
+
86
+ With geospatial extras (required for raster export):
87
+
88
+ ```bash
89
+ pip install rivia[geo]
90
+ ```
91
+
92
+ ## Quick Example
93
+
94
+ ```python
95
+ from rivia.model import Model
96
+
97
+ # Open a HEC-RAS project
98
+ model = Model("path/to/project.prj")
99
+ print(model.version) # e.g. "6.30"
100
+
101
+ # Switch plans
102
+ model.change_plan(title="Base Condition")
103
+ model.change_plan(short_id="BC")
104
+ model.change_plan(index=0)
105
+
106
+ # Read HDF results
107
+ area = model.hdf.flow_areas["Perimeter 1"]
108
+ wse_max = area.max_water_surface
109
+
110
+ # Export a WSE raster
111
+ vrt = model.export_wse(timestep=None, render_mode="sloping")
112
+ print(vrt.path)
113
+ ```
114
+
115
+ ## Package Structure
116
+
117
+ ```
118
+ rivia/
119
+ ├── com/ # COM interface to run/control HEC-RAS
120
+ ├── model/ # Model - primary project interface; read/write text input files, read HDF results
121
+ ├── hdf/ # Read HEC-RAS HDF5 geometry and result files
122
+ ├── geo/ # Geospatial operations: raster export (geopandas/rasterio)
123
+ └── utils/ # Shared helpers
124
+ ```
125
+
126
+ ## Development
127
+
128
+ ```bash
129
+ git clone https://github.com/gyanz/rivia.git
130
+ cd rivia
131
+ pip install -e ".[dev,geo,docs]"
132
+
133
+ # Run tests
134
+ pytest tests/ -x --tb=short
135
+
136
+ # Lint
137
+ ruff check src/
138
+
139
+ # Type check
140
+ mypy src/rivia
141
+
142
+ # Build docs
143
+ sphinx-build -b html docs docs/_build/html
144
+ ```
145
+
146
+ ## License
147
+
148
+ Copyright 2025 Gyan Basyal and WEST Consultants, Inc.
149
+
150
+ Licensed under the [Apache License, Version 2.0](LICENSE).
rivia-0.1.0/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # RIVIA
2
+
3
+ **RAS Interface for Visualization, Information, and Automation**
4
+
5
+ A modern, modular Python library for interacting with [HEC-RAS](https://www.hec.usace.army.mil/software/hec-ras/) hydraulic modeling software.
6
+
7
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
8
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
9
+ [![Platform](https://img.shields.io/badge/platform-Windows-lightgrey.svg)](https://www.hec.usace.army.mil/software/hec-ras/)
10
+ [![Documentation](https://readthedocs.org/projects/rivia/badge/?version=latest)](https://rivia.readthedocs.io/en/latest/)
11
+
12
+ ## Documentation
13
+
14
+ Full documentation is available at [rivia.readthedocs.io](https://rivia.readthedocs.io).
15
+
16
+ ## Overview
17
+
18
+ `rivia` provides a clean, Pythonic interface for working with HEC-RAS projects:
19
+
20
+ - **Control HEC-RAS** via COM automation — open projects, switch plans, run simulations
21
+ - **Read and write** HEC-RAS text input files (`.prj`, `.g*`, `.p*`, `.f*`, `.u*`)
22
+ - **Access HDF5 results** — water surface, velocity, depth, and other outputs
23
+ - **Export rasters** — pixel-perfect RASMapper-equivalent rasters (WSE, depth, velocity, etc.)
24
+ - **Export terrain** — mosaic and modify terrain from HEC-RAS terrain HDF files
25
+
26
+ ## Requirements
27
+
28
+ - **Windows** — HEC-RAS is Windows-only
29
+ - Python 3.10+
30
+ - HEC-RAS 5.x or later installed
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install rivia
36
+ ```
37
+
38
+ With geospatial extras (required for raster export):
39
+
40
+ ```bash
41
+ pip install rivia[geo]
42
+ ```
43
+
44
+ ## Quick Example
45
+
46
+ ```python
47
+ from rivia.model import Model
48
+
49
+ # Open a HEC-RAS project
50
+ model = Model("path/to/project.prj")
51
+ print(model.version) # e.g. "6.30"
52
+
53
+ # Switch plans
54
+ model.change_plan(title="Base Condition")
55
+ model.change_plan(short_id="BC")
56
+ model.change_plan(index=0)
57
+
58
+ # Read HDF results
59
+ area = model.hdf.flow_areas["Perimeter 1"]
60
+ wse_max = area.max_water_surface
61
+
62
+ # Export a WSE raster
63
+ vrt = model.export_wse(timestep=None, render_mode="sloping")
64
+ print(vrt.path)
65
+ ```
66
+
67
+ ## Package Structure
68
+
69
+ ```
70
+ rivia/
71
+ ├── com/ # COM interface to run/control HEC-RAS
72
+ ├── model/ # Model - primary project interface; read/write text input files, read HDF results
73
+ ├── hdf/ # Read HEC-RAS HDF5 geometry and result files
74
+ ├── geo/ # Geospatial operations: raster export (geopandas/rasterio)
75
+ └── utils/ # Shared helpers
76
+ ```
77
+
78
+ ## Development
79
+
80
+ ```bash
81
+ git clone https://github.com/gyanz/rivia.git
82
+ cd rivia
83
+ pip install -e ".[dev,geo,docs]"
84
+
85
+ # Run tests
86
+ pytest tests/ -x --tb=short
87
+
88
+ # Lint
89
+ ruff check src/
90
+
91
+ # Type check
92
+ mypy src/rivia
93
+
94
+ # Build docs
95
+ sphinx-build -b html docs docs/_build/html
96
+ ```
97
+
98
+ ## License
99
+
100
+ Copyright 2025 Gyan Basyal and WEST Consultants, Inc.
101
+
102
+ Licensed under the [Apache License, Version 2.0](LICENSE).
@@ -0,0 +1,4 @@
1
+ cd tools\RasMapperStoreMap
2
+ dotnet build -c Release
3
+ copy bin\Release\net472\RasMapperStoreMap.exe ..\..\src\raspy\bin\
4
+ cd ..\..
@@ -0,0 +1,12 @@
1
+ SPHINXOPTS ?=
2
+ SPHINXBUILD ?= sphinx-build
3
+ SOURCEDIR = .
4
+ BUILDDIR = _build
5
+
6
+ help:
7
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
8
+
9
+ .PHONY: help Makefile
10
+
11
+ %: Makefile
12
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,29 @@
1
+ {{ objname | escape | underline}}
2
+
3
+ .. currentmodule:: {{ module }}
4
+
5
+ .. autoclass:: {{ objname }}
6
+
7
+ {% block methods %}
8
+ .. automethod:: __init__
9
+
10
+ {% if methods %}
11
+ .. rubric:: {{ _('Methods') }}
12
+
13
+ .. autosummary::
14
+ {% for item in methods %}
15
+ ~{{ name }}.{{ item }}
16
+ {%- endfor %}
17
+ {% endif %}
18
+ {% endblock %}
19
+
20
+ {% block attributes %}
21
+ {% if attributes %}
22
+ .. rubric:: {{ _('Attributes') }}
23
+
24
+ .. autosummary::
25
+ {% for item in attributes %}
26
+ ~{{ name }}.{{ item }}
27
+ {%- endfor %}
28
+ {% endif %}
29
+ {% endblock %}
@@ -0,0 +1,60 @@
1
+ {{ name | escape | underline}}
2
+
3
+ .. automodule:: {{ fullname }}
4
+
5
+ {% block attributes %}
6
+ {%- if attributes %}
7
+ .. rubric:: {{ _('Module Attributes') }}
8
+
9
+ .. autosummary::
10
+ {% for item in attributes %}
11
+ {{ item }}
12
+ {%- endfor %}
13
+ {% endif %}
14
+ {%- endblock %}
15
+
16
+ {%- block functions %}
17
+ {%- if functions %}
18
+ .. rubric:: {{ _('Functions') }}
19
+
20
+ .. autosummary::
21
+ {% for item in functions %}
22
+ {{ item }}
23
+ {%- endfor %}
24
+ {% endif %}
25
+ {%- endblock %}
26
+
27
+ {%- block classes %}
28
+ {%- if classes %}
29
+ .. rubric:: {{ _('Classes') }}
30
+
31
+ .. autosummary::
32
+ {% for item in classes %}
33
+ {{ item }}
34
+ {%- endfor %}
35
+ {% endif %}
36
+ {%- endblock %}
37
+
38
+ {%- block exceptions %}
39
+ {%- if exceptions %}
40
+ .. rubric:: {{ _('Exceptions') }}
41
+
42
+ .. autosummary::
43
+ {% for item in exceptions %}
44
+ {{ item }}
45
+ {%- endfor %}
46
+ {% endif %}
47
+ {%- endblock %}
48
+
49
+ {%- block modules %}
50
+ {%- if modules %}
51
+ .. rubric:: Modules
52
+
53
+ .. autosummary::
54
+ :toctree:
55
+ :recursive:
56
+ {% for item in modules %}
57
+ {{ item }}
58
+ {%- endfor %}
59
+ {% endif %}
60
+ {%- endblock %}
@@ -0,0 +1,17 @@
1
+ rivia.com
2
+ =========
3
+
4
+ COM interface to run and control HEC-RAS. Windows only; requires ``pywin32``.
5
+
6
+ .. automodule:: rivia.com
7
+ :members:
8
+
9
+ .. rubric:: Submodules
10
+
11
+ .. autosummary::
12
+ :toctree: generated
13
+ :recursive:
14
+
15
+ rivia.com.controller
16
+ rivia.com.ras
17
+ rivia.com.registry
@@ -0,0 +1,16 @@
1
+ rivia.geo
2
+ =========
3
+
4
+ Geospatial operations: mesh interpolation, raster export.
5
+ Requires ``geopandas`` and ``rasterio`` (install with ``pip install rivia[geo]``).
6
+
7
+ .. automodule:: rivia.geo
8
+ :members:
9
+
10
+ .. rubric:: Submodules
11
+
12
+ .. autosummary::
13
+ :toctree: generated
14
+ :recursive:
15
+
16
+ rivia.geo.raster