ras-commander 0.34.0__tar.gz → 0.35.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 (22) hide show
  1. {ras_commander-0.34.0/ras_commander.egg-info → ras_commander-0.35.0}/PKG-INFO +64 -8
  2. {ras_commander-0.34.0 → ras_commander-0.35.0}/README.md +59 -5
  3. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander/RasCmdr.py +8 -7
  4. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander/RasExamples.py +242 -78
  5. ras_commander-0.35.0/ras_commander/RasHdf.py +1702 -0
  6. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander/RasPlan.py +15 -8
  7. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander/RasPrj.py +8 -2
  8. {ras_commander-0.34.0 → ras_commander-0.35.0/ras_commander.egg-info}/PKG-INFO +64 -8
  9. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander.egg-info/requires.txt +2 -1
  10. {ras_commander-0.34.0 → ras_commander-0.35.0}/setup.py +26 -9
  11. ras_commander-0.34.0/ras_commander/RasHdf.py +0 -248
  12. {ras_commander-0.34.0 → ras_commander-0.35.0}/LICENSE +0 -0
  13. {ras_commander-0.34.0 → ras_commander-0.35.0}/pyproject.toml +0 -0
  14. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander/RasGeo.py +0 -0
  15. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander/RasUnsteady.py +0 -0
  16. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander/RasUtils.py +0 -0
  17. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander/__init__.py +0 -0
  18. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander/_version.py +0 -0
  19. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander.egg-info/SOURCES.txt +0 -0
  20. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander.egg-info/dependency_links.txt +0 -0
  21. {ras_commander-0.34.0 → ras_commander-0.35.0}/ras_commander.egg-info/top_level.txt +0 -0
  22. {ras_commander-0.34.0 → ras_commander-0.35.0}/setup.cfg +0 -0
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ras-commander
3
- Version: 0.34.0
3
+ Version: 0.35.0
4
4
  Summary: A Python library for automating HEC-RAS operations
5
5
  Home-page: https://github.com/billk-FM/ras-commander
6
6
  Author: William M. Katzenmeyer
7
7
  Author-email: billk@fenstermaker.com
8
- Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
9
10
  Classifier: License :: OSI Approved :: MIT License
10
11
  Classifier: Operating System :: OS Independent
11
12
  Requires-Python: >=3.9
@@ -15,9 +16,10 @@ Requires-Dist: pandas>=1.0.0
15
16
  Requires-Dist: numpy>=1.18.0
16
17
  Requires-Dist: h5py>=3.1.0
17
18
  Requires-Dist: requests>=2.25.0
18
- Requires-Dist: pathlib>=1.0.1
19
19
  Requires-Dist: scipy>=1.5.0
20
20
  Requires-Dist: matplotlib>=3.3.0
21
+ Requires-Dist: tqdm>=4.50.0
22
+ Requires-Dist: psutil>=5.7.0
21
23
  Provides-Extra: dev
22
24
  Requires-Dist: pytest>=6.2.0; extra == "dev"
23
25
  Requires-Dist: flake8>=3.9.0; extra == "dev"
@@ -116,18 +118,21 @@ results = RasCmdr.compute_parallel(
116
118
  RasPlan.set_geom("01", "02")
117
119
  ```
118
120
 
121
+ Certainly! I'll provide you with an updated Key Components section and Project Organization diagram based on the current structure of the ras-commander library.
122
+
119
123
  ## Key Components
120
124
 
121
- - `RasPrj`: Manages HEC-RAS projects
125
+ - `RasPrj`: Manages HEC-RAS projects, handling initialization and data loading
122
126
  - `RasCmdr`: Handles execution of HEC-RAS simulations
123
127
  - `RasPlan`: Provides functions for modifying and updating plan files
124
128
  - `RasGeo`: Handles operations related to geometry files
125
129
  - `RasUnsteady`: Manages unsteady flow file operations
126
130
  - `RasUtils`: Contains utility functions for file operations and data management
127
131
  - `RasExamples`: Manages and loads HEC-RAS example projects
128
-
132
+ - `RasHdf`: Provides utilities for working with HDF files in HEC-RAS projects
129
133
 
130
134
  ## Project Organization Diagram
135
+
131
136
  ```
132
137
  ras_commander
133
138
  ├── .github
@@ -135,9 +140,11 @@ ras_commander
135
140
  │ └── python-package.yml
136
141
  ├── ras_commander
137
142
  │ ├── __init__.py
143
+ │ ├── _version.py
138
144
  │ ├── RasCmdr.py
139
145
  │ ├── RasExamples.py
140
146
  │ ├── RasGeo.py
147
+ │ ├── RasHdf.py
141
148
  │ ├── RasPlan.py
142
149
  │ ├── RasPrj.py
143
150
  │ ├── RasUnsteady.py
@@ -155,7 +162,12 @@ ras_commander
155
162
  │ ├── 10_arguments_for_compute.py
156
163
  │ ├── 11_Using_RasExamples.ipynb
157
164
  │ ├── 12_plan_set_execution.py
158
- │ └── 13_multiple_project_operations.py
165
+ │ ├── 13_multiple_project_operations.py
166
+ │ ├── 14_Core_Sensitivity.ipynb
167
+ │ ├── 15_plan_key_operations.py
168
+ │ ├── 16_scanning_ras_project_info.py
169
+ │ ├── 17_parallel_execution_ble.py
170
+ │ └── HEC_RAS_2D_HDF_Analysis.ipynb
159
171
  ├── tests
160
172
  │ └── ... (test files)
161
173
  ├── .gitignore
@@ -190,7 +202,6 @@ projects = ras_examples.list_projects("Steady Flow")
190
202
  extracted_paths = ras_examples.extract_project(["Bald Eagle Creek", "Muncie"])
191
203
  ```
192
204
 
193
-
194
205
  ## RasPrj
195
206
 
196
207
  The `RasPrj` class is central to managing HEC-RAS projects within the ras-commander library. It handles project initialization, data loading, and provides access to project components.
@@ -218,6 +229,28 @@ custom_project = RasPrj()
218
229
  init_ras_project("/path/to/another_project", "6.5", ras_instance=custom_project)
219
230
  ```
220
231
 
232
+ ## RasHdf
233
+
234
+ The `RasHdf` class provides utilities for working with HDF files in HEC-RAS projects, enabling easy access to simulation results and model data.
235
+
236
+ Example usage:
237
+
238
+ ```python
239
+ from ras_commander import RasHdf, init_ras_project, RasPrj
240
+
241
+ # Initialize project with a custom ras object
242
+ custom_ras = RasPrj()
243
+ init_ras_project("/path/to/project", "6.5", ras_instance=custom_ras)
244
+
245
+ # Get runtime data for a specific plan
246
+ plan_number = "01"
247
+ runtime_data = RasHdf.get_runtime_data(plan_number, ras_object=custom_ras)
248
+ print(runtime_data)
249
+ ```
250
+
251
+ This class simplifies the process of extracting and analyzing data from HEC-RAS HDF output files, supporting tasks such as post-processing and result visualization.
252
+
253
+
221
254
  ## Documentation
222
255
 
223
256
  For detailed usage instructions and API documentation, please refer to the [Comprehensive Library Guide](Comprehensive_Library_Guide.md).
@@ -255,7 +288,30 @@ ras-commander is released under the MIT License. See the license file for detail
255
288
 
256
289
  ## Acknowledgments
257
290
 
258
- RAS Commander is based on the HEC-Commander project's "Command Line is All You Need" approach, leveraging the HEC-RAS command-line interface for automation. The initial development of this library was presented in the HEC-Commander Tools repository. In a 2024 Australian Water School webinar, Bill demonstrated the derivation of basic HEC-RAS automation functions from plain language instructions. Leveraging the previously developed code and AI tools, the library was created. The primary tools used for this initial development were Anthropic's Claude, GPT-4o, Google's Gemini Experimental models, and the Cursor AI Coding IDE.
291
+ RAS Commander is based on the HEC-Commander project's "Command Line is All You Need" approach, leveraging the HEC-RAS command-line interface for automation. The initial development of this library was presented in the HEC-Commander Tools repository. In a 2024 Australian Water School webinar, Bill demonstrated the derivation of basic HEC-RAS automation functions from plain language instructions. Leveraging the previously developed code and AI tools, the library was created. The primary tools used for this initial development were Anthropic's Claude, GPT-4, Google's Gemini Experimental models, and the Cursor AI Coding IDE.
292
+
293
+ Additionally, we would like to acknowledge the following notable contributions and attributions for open source projects which significantly influenced the development of RAS Commander:
294
+
295
+ 1. Contributions: Sean Micek's [`funkshuns`](https://github.com/openSourcerer9000/funkshuns), [`TXTure`](https://github.com/openSourcerer9000/TXTure), and [`RASmatazz`](https://github.com/openSourcerer9000/RASmatazz) libraries provided inspiration, code examples and utility functions which were adapted with AI for use in RAS Commander. Sean has also contributed heavily to
296
+
297
+ - Development of additional HDF functions for detailed analysis and mapping of HEC-RAS results within the RasHdf class.
298
+ - Development of the prototype `RasCmdr` class for executing HEC-RAS simulations.
299
+ - Optimization examples and methods from (INSERT REFERENCE) for use in the Ras-Commander library examples
300
+
301
+ 2. Attribution: The [`pyHMT2D`](https://github.com/psu-efd/pyHMT2D/) project by Xiaofeng Liu, which provided insights into HDF file handling methods for HEC-RAS outputs. Many of the functions in the [Ras_2D_Data.py](https://github.com/psu-efd/pyHMT2D/blob/main/pyHMT2D/Hydraulic_Models_Data/RAS_2D/RAS_2D_Data.py) file were adapted with AI for use in RAS Commander.
302
+
303
+ Xiaofeng Liu, Ph.D., P.E.
304
+ Associate Professor
305
+ Department of Civil and Environmental Engineering
306
+ Institute of Computational and Data Sciences
307
+ Penn State University
308
+
309
+ These acknowledgments recognize the contributions and inspirations that have helped shape RAS Commander, ensuring proper attribution for the ideas and code that have influenced its development.
310
+
311
+ 3. Chris Goodell, "Breaking the HEC-RAS Code" - Studied and used as a reference for understanding the inner workings of HEC-RAS, providing valuable insights into the software's functionality and structure.
312
+
313
+ 4. [HEC-Commander Tools](https://github.com/billk-FM/HEC-Commander) - Inspiration and initial code base for the development of RAS Commander.
314
+
259
315
 
260
316
  ## Contact
261
317
 
@@ -88,18 +88,21 @@ results = RasCmdr.compute_parallel(
88
88
  RasPlan.set_geom("01", "02")
89
89
  ```
90
90
 
91
+ Certainly! I'll provide you with an updated Key Components section and Project Organization diagram based on the current structure of the ras-commander library.
92
+
91
93
  ## Key Components
92
94
 
93
- - `RasPrj`: Manages HEC-RAS projects
95
+ - `RasPrj`: Manages HEC-RAS projects, handling initialization and data loading
94
96
  - `RasCmdr`: Handles execution of HEC-RAS simulations
95
97
  - `RasPlan`: Provides functions for modifying and updating plan files
96
98
  - `RasGeo`: Handles operations related to geometry files
97
99
  - `RasUnsteady`: Manages unsteady flow file operations
98
100
  - `RasUtils`: Contains utility functions for file operations and data management
99
101
  - `RasExamples`: Manages and loads HEC-RAS example projects
100
-
102
+ - `RasHdf`: Provides utilities for working with HDF files in HEC-RAS projects
101
103
 
102
104
  ## Project Organization Diagram
105
+
103
106
  ```
104
107
  ras_commander
105
108
  ├── .github
@@ -107,9 +110,11 @@ ras_commander
107
110
  │ └── python-package.yml
108
111
  ├── ras_commander
109
112
  │ ├── __init__.py
113
+ │ ├── _version.py
110
114
  │ ├── RasCmdr.py
111
115
  │ ├── RasExamples.py
112
116
  │ ├── RasGeo.py
117
+ │ ├── RasHdf.py
113
118
  │ ├── RasPlan.py
114
119
  │ ├── RasPrj.py
115
120
  │ ├── RasUnsteady.py
@@ -127,7 +132,12 @@ ras_commander
127
132
  │ ├── 10_arguments_for_compute.py
128
133
  │ ├── 11_Using_RasExamples.ipynb
129
134
  │ ├── 12_plan_set_execution.py
130
- └── 13_multiple_project_operations.py
135
+ ├── 13_multiple_project_operations.py
136
+ │ ├── 14_Core_Sensitivity.ipynb
137
+ │ ├── 15_plan_key_operations.py
138
+ │ ├── 16_scanning_ras_project_info.py
139
+ │ ├── 17_parallel_execution_ble.py
140
+ │ └── HEC_RAS_2D_HDF_Analysis.ipynb
131
141
  ├── tests
132
142
  │ └── ... (test files)
133
143
  ├── .gitignore
@@ -162,7 +172,6 @@ projects = ras_examples.list_projects("Steady Flow")
162
172
  extracted_paths = ras_examples.extract_project(["Bald Eagle Creek", "Muncie"])
163
173
  ```
164
174
 
165
-
166
175
  ## RasPrj
167
176
 
168
177
  The `RasPrj` class is central to managing HEC-RAS projects within the ras-commander library. It handles project initialization, data loading, and provides access to project components.
@@ -190,6 +199,28 @@ custom_project = RasPrj()
190
199
  init_ras_project("/path/to/another_project", "6.5", ras_instance=custom_project)
191
200
  ```
192
201
 
202
+ ## RasHdf
203
+
204
+ The `RasHdf` class provides utilities for working with HDF files in HEC-RAS projects, enabling easy access to simulation results and model data.
205
+
206
+ Example usage:
207
+
208
+ ```python
209
+ from ras_commander import RasHdf, init_ras_project, RasPrj
210
+
211
+ # Initialize project with a custom ras object
212
+ custom_ras = RasPrj()
213
+ init_ras_project("/path/to/project", "6.5", ras_instance=custom_ras)
214
+
215
+ # Get runtime data for a specific plan
216
+ plan_number = "01"
217
+ runtime_data = RasHdf.get_runtime_data(plan_number, ras_object=custom_ras)
218
+ print(runtime_data)
219
+ ```
220
+
221
+ This class simplifies the process of extracting and analyzing data from HEC-RAS HDF output files, supporting tasks such as post-processing and result visualization.
222
+
223
+
193
224
  ## Documentation
194
225
 
195
226
  For detailed usage instructions and API documentation, please refer to the [Comprehensive Library Guide](Comprehensive_Library_Guide.md).
@@ -227,7 +258,30 @@ ras-commander is released under the MIT License. See the license file for detail
227
258
 
228
259
  ## Acknowledgments
229
260
 
230
- RAS Commander is based on the HEC-Commander project's "Command Line is All You Need" approach, leveraging the HEC-RAS command-line interface for automation. The initial development of this library was presented in the HEC-Commander Tools repository. In a 2024 Australian Water School webinar, Bill demonstrated the derivation of basic HEC-RAS automation functions from plain language instructions. Leveraging the previously developed code and AI tools, the library was created. The primary tools used for this initial development were Anthropic's Claude, GPT-4o, Google's Gemini Experimental models, and the Cursor AI Coding IDE.
261
+ RAS Commander is based on the HEC-Commander project's "Command Line is All You Need" approach, leveraging the HEC-RAS command-line interface for automation. The initial development of this library was presented in the HEC-Commander Tools repository. In a 2024 Australian Water School webinar, Bill demonstrated the derivation of basic HEC-RAS automation functions from plain language instructions. Leveraging the previously developed code and AI tools, the library was created. The primary tools used for this initial development were Anthropic's Claude, GPT-4, Google's Gemini Experimental models, and the Cursor AI Coding IDE.
262
+
263
+ Additionally, we would like to acknowledge the following notable contributions and attributions for open source projects which significantly influenced the development of RAS Commander:
264
+
265
+ 1. Contributions: Sean Micek's [`funkshuns`](https://github.com/openSourcerer9000/funkshuns), [`TXTure`](https://github.com/openSourcerer9000/TXTure), and [`RASmatazz`](https://github.com/openSourcerer9000/RASmatazz) libraries provided inspiration, code examples and utility functions which were adapted with AI for use in RAS Commander. Sean has also contributed heavily to
266
+
267
+ - Development of additional HDF functions for detailed analysis and mapping of HEC-RAS results within the RasHdf class.
268
+ - Development of the prototype `RasCmdr` class for executing HEC-RAS simulations.
269
+ - Optimization examples and methods from (INSERT REFERENCE) for use in the Ras-Commander library examples
270
+
271
+ 2. Attribution: The [`pyHMT2D`](https://github.com/psu-efd/pyHMT2D/) project by Xiaofeng Liu, which provided insights into HDF file handling methods for HEC-RAS outputs. Many of the functions in the [Ras_2D_Data.py](https://github.com/psu-efd/pyHMT2D/blob/main/pyHMT2D/Hydraulic_Models_Data/RAS_2D/RAS_2D_Data.py) file were adapted with AI for use in RAS Commander.
272
+
273
+ Xiaofeng Liu, Ph.D., P.E.
274
+ Associate Professor
275
+ Department of Civil and Environmental Engineering
276
+ Institute of Computational and Data Sciences
277
+ Penn State University
278
+
279
+ These acknowledgments recognize the contributions and inspirations that have helped shape RAS Commander, ensuring proper attribution for the ideas and code that have influenced its development.
280
+
281
+ 3. Chris Goodell, "Breaking the HEC-RAS Code" - Studied and used as a reference for understanding the inner workings of HEC-RAS, providing valuable insights into the software's functionality and structure.
282
+
283
+ 4. [HEC-Commander Tools](https://github.com/billk-FM/HEC-Commander) - Inspiration and initial code base for the development of RAS Commander.
284
+
231
285
 
232
286
  ## Contact
233
287
 
@@ -74,7 +74,8 @@ class RasCmdr:
74
74
  Raises:
75
75
  ValueError: If the specified dest_folder already exists and is not empty, and overwrite_dest is False.
76
76
  """
77
- ras_obj = ras_object or ras
77
+ ras_obj = ras_object if ras_object is not None else ras
78
+ logging.info(f"Using ras_object with project folder: {ras_obj.project_folder}")
78
79
  ras_obj.check_initialized()
79
80
 
80
81
  if dest_folder is not None:
@@ -144,12 +145,12 @@ class RasCmdr:
144
145
  logging.error(f"Error message: {e.output}")
145
146
  logging.info(f"Total run time for plan {plan_number}: {run_time:.2f} seconds")
146
147
  return False
147
-
148
- ras_obj = ras_object or ras
149
- ras_obj.plan_df = ras_obj.get_plan_entries()
150
- ras_obj.geom_df = ras_obj.get_geom_entries()
151
- ras_obj.flow_df = ras_obj.get_flow_entries()
152
- ras_obj.unsteady_df = ras_obj.get_unsteady_entries()
148
+ finally:
149
+ # Update the RAS object's dataframes
150
+ ras_obj.plan_df = ras_obj.get_plan_entries()
151
+ ras_obj.geom_df = ras_obj.get_geom_entries()
152
+ ras_obj.flow_df = ras_obj.get_flow_entries()
153
+ ras_obj.unsteady_df = ras_obj.get_unsteady_entries()
153
154
 
154
155
 
155
156