ras-commander 0.33.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 (28) hide show
  1. ras_commander-0.35.0/PKG-INFO +319 -0
  2. ras_commander-0.35.0/README.md +289 -0
  3. {ras_commander-0.33.0 → ras_commander-0.35.0}/ras_commander/RasCmdr.py +171 -138
  4. ras_commander-0.35.0/ras_commander/RasExamples.py +518 -0
  5. {ras_commander-0.33.0 → ras_commander-0.35.0}/ras_commander/RasGeo.py +27 -6
  6. ras_commander-0.35.0/ras_commander/RasHdf.py +1702 -0
  7. {ras_commander-0.33.0 → ras_commander-0.35.0}/ras_commander/RasPlan.py +398 -437
  8. ras_commander-0.35.0/ras_commander/RasPrj.py +738 -0
  9. {ras_commander-0.33.0 → ras_commander-0.35.0}/ras_commander/RasUnsteady.py +24 -4
  10. ras_commander-0.35.0/ras_commander/RasUtils.py +611 -0
  11. {ras_commander-0.33.0 → ras_commander-0.35.0}/ras_commander/__init__.py +4 -1
  12. ras_commander-0.35.0/ras_commander.egg-info/PKG-INFO +319 -0
  13. {ras_commander-0.33.0 → ras_commander-0.35.0}/ras_commander.egg-info/SOURCES.txt +2 -0
  14. ras_commander-0.35.0/ras_commander.egg-info/requires.txt +16 -0
  15. ras_commander-0.35.0/setup.py +91 -0
  16. ras_commander-0.33.0/PKG-INFO +0 -4
  17. ras_commander-0.33.0/README.md +0 -185
  18. ras_commander-0.33.0/ras_commander/RasExamples.py +0 -304
  19. ras_commander-0.33.0/ras_commander/RasPrj.py +0 -400
  20. ras_commander-0.33.0/ras_commander/RasUtils.py +0 -310
  21. ras_commander-0.33.0/ras_commander.egg-info/PKG-INFO +0 -4
  22. ras_commander-0.33.0/setup.py +0 -8
  23. {ras_commander-0.33.0 → ras_commander-0.35.0}/LICENSE +0 -0
  24. {ras_commander-0.33.0 → ras_commander-0.35.0}/pyproject.toml +0 -0
  25. {ras_commander-0.33.0 → ras_commander-0.35.0}/ras_commander/_version.py +0 -0
  26. {ras_commander-0.33.0 → ras_commander-0.35.0}/ras_commander.egg-info/dependency_links.txt +0 -0
  27. {ras_commander-0.33.0 → ras_commander-0.35.0}/ras_commander.egg-info/top_level.txt +0 -0
  28. {ras_commander-0.33.0 → ras_commander-0.35.0}/setup.cfg +0 -0
@@ -0,0 +1,319 @@
1
+ Metadata-Version: 2.1
2
+ Name: ras-commander
3
+ Version: 0.35.0
4
+ Summary: A Python library for automating HEC-RAS operations
5
+ Home-page: https://github.com/billk-FM/ras-commander
6
+ Author: William M. Katzenmeyer
7
+ Author-email: billk@fenstermaker.com
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: pandas>=1.0.0
16
+ Requires-Dist: numpy>=1.18.0
17
+ Requires-Dist: h5py>=3.1.0
18
+ Requires-Dist: requests>=2.25.0
19
+ Requires-Dist: scipy>=1.5.0
20
+ Requires-Dist: matplotlib>=3.3.0
21
+ Requires-Dist: tqdm>=4.50.0
22
+ Requires-Dist: psutil>=5.7.0
23
+ Provides-Extra: dev
24
+ Requires-Dist: pytest>=6.2.0; extra == "dev"
25
+ Requires-Dist: flake8>=3.9.0; extra == "dev"
26
+ Requires-Dist: black>=21.5b1; extra == "dev"
27
+ Requires-Dist: sphinx>=3.5.0; extra == "dev"
28
+ Requires-Dist: sphinx-rtd-theme>=0.5.0; extra == "dev"
29
+ Requires-Dist: twine>=3.3.0; extra == "dev"
30
+
31
+ # RAS Commander (ras-commander)
32
+
33
+ RAS Commander is a Python library for automating HEC-RAS operations, providing a set of tools to interact with HEC-RAS project files, execute simulations, and manage project data. This library is an evolution of the RASCommander 1.0 Python Notebook Application previously released under the [HEC-Commander tools repository](https://github.com/billk-FM/HEC-Commander).
34
+
35
+ ## Contributors:
36
+ William Katzenmeyer, P.E., C.F.M. - billk@fenstermaker.com
37
+
38
+ Sean Micek, P.E., C.F.M. - smicek@fenstermaker.com
39
+
40
+ Aaron Nichols, P.E., C.F.M. - anichols@fenstermaker.com
41
+
42
+ (Additional Contributors Here)
43
+
44
+
45
+ ## Background
46
+ The ras-commander library emerged from the initial test-bed of AI-driven coding represented by the HEC-Commander tools Python notebooks. These notebooks served as a proof of concept, demonstrating the value proposition of automating HEC-RAS operations. The transition from notebooks to a structured library aims to provide a more robust, maintainable, and extensible solution for water resources engineers.
47
+
48
+ ## Features
49
+
50
+ - Automate HEC-RAS project management and simulations
51
+ - Support for both single and multiple project instances
52
+ - Parallel execution of HEC-RAS plans
53
+ - Utilities for managing geometry, plan, and unsteady flow files
54
+ - Example project management for testing and development
55
+ - Two primary operation modes: "Run Missing" and "Build from DSS"
56
+
57
+ ## AI-Driven Coding Experience
58
+
59
+ ras-commander provides several AI-powered tools to enhance the coding experience:
60
+
61
+ 1. **ChatGPT Assistant: [RAS Commander Library Assistant](https://chatgpt.com/g/g-TZRPR3oAO-ras-commander-library-assistant)**: A specialized GPT model trained on the ras-commander codebase, available for answering queries and providing code suggestions.
62
+
63
+ 2. **[Purpose-Built Knowledge Base Summaries](https://github.com/billk-FM/ras-commander/tree/main/ai_tools/assistant_knowledge_bases)**: Up-to-date compilations of the documentation and codebase for use with large language models like Claude or GPT-4. Look in 'ai_tools/assistant_knowledge_bases/' in the repo.
64
+
65
+ 3. **[Cursor IDE Integration](https://github.com/billk-FM/ras-commander/blob/main/.cursorrules)**: Custom rules for the Cursor IDE to provide context-aware suggestions and documentation. Just open the repository folder in Cursor. You can create your own folders "/workspace/, "/projects/", or "my_projects/" as these are already in the .gitignore, and place your custom scripts there for your projects. This will allow easy referencing of the ras-commander documents and individual repo files, the automatic loading of the .cursorrules file. Alternatvely, download the github repo into your projects folder to easily load documents and use cursor rules files.
66
+ 4. **[AI Assistant Notebook](https://github.com/billk-FM/ras-commander/blob/main/ai_tools/rascommander_code_assistant.ipynb)**: A notebook for dynamic code summarization and API interaction (bring your own API Key). Currently, this only does a single-shot message on the Claude Sonnet 3.5 API, which can be up to 50 cents per request. Future revisions will include the ability to select which knowledge base file to include, a choice of SOTA models + multi turn conversations to build automation notebooks interactively.
67
+
68
+ These tools aim to streamline development and provide intelligent assistance when modeling with, and working with and revising the ras-commander library.
69
+
70
+ ## Installation
71
+
72
+ Create a virtual environment with conda or venv (ask ChatGPT if you need help)
73
+
74
+ In your virtual environment, install ras-commander using pip:
75
+ ```
76
+ pip install pandas requests pathlib
77
+ pip install ras-commander
78
+ ```
79
+
80
+
81
+
82
+ ## Requirements
83
+
84
+ - Tested with Python 3.11
85
+ - HEC-RAS 6.2 or later (other versions may work, all testing was done with version 6.2 and above)
86
+ - Detailed project workflows and/or existing libraries and code where ras-commander can be integrated.
87
+
88
+ For a full list of dependencies, see the `requirements.txt` file.
89
+
90
+ ## Quick Start
91
+ ```
92
+ from ras_commander import init_ras_project, RasCmdr, RasPlan
93
+ ```
94
+
95
+ # Initialize a project
96
+ ```
97
+ init_ras_project(r"/path/to/project", "6.5")
98
+ ```
99
+
100
+ # Execute a single plan
101
+ ```
102
+ RasCmdr.compute_plan("01", dest_folder=r"/path/to/results", overwrite_dest=True)
103
+ ```
104
+
105
+ # Execute plans in parallel
106
+ ```
107
+ results = RasCmdr.compute_parallel(
108
+ plan_numbers=["01", "02"],
109
+ max_workers=2,
110
+ cores_per_run=2,
111
+ dest_folder=r"/path/to/results",
112
+ overwrite_dest=True
113
+ )
114
+ ```
115
+
116
+ # Modify a plan
117
+ ```
118
+ RasPlan.set_geom("01", "02")
119
+ ```
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
+
123
+ ## Key Components
124
+
125
+ - `RasPrj`: Manages HEC-RAS projects, handling initialization and data loading
126
+ - `RasCmdr`: Handles execution of HEC-RAS simulations
127
+ - `RasPlan`: Provides functions for modifying and updating plan files
128
+ - `RasGeo`: Handles operations related to geometry files
129
+ - `RasUnsteady`: Manages unsteady flow file operations
130
+ - `RasUtils`: Contains utility functions for file operations and data management
131
+ - `RasExamples`: Manages and loads HEC-RAS example projects
132
+ - `RasHdf`: Provides utilities for working with HDF files in HEC-RAS projects
133
+
134
+ ## Project Organization Diagram
135
+
136
+ ```
137
+ ras_commander
138
+ ├── .github
139
+ │ └── workflows
140
+ │ └── python-package.yml
141
+ ├── ras_commander
142
+ │ ├── __init__.py
143
+ │ ├── _version.py
144
+ │ ├── RasCmdr.py
145
+ │ ├── RasExamples.py
146
+ │ ├── RasGeo.py
147
+ │ ├── RasHdf.py
148
+ │ ├── RasPlan.py
149
+ │ ├── RasPrj.py
150
+ │ ├── RasUnsteady.py
151
+ │ └── RasUtils.py
152
+ ├── examples
153
+ │ ├── 01_project_initialization.py
154
+ │ ├── 02_plan_operations.py
155
+ │ ├── 03_geometry_operations.py
156
+ │ ├── 04_unsteady_flow_operations.py
157
+ │ ├── 05_utility_functions.py
158
+ │ ├── 06_single_plan_execution.py
159
+ │ ├── 07_sequential_plan_execution.py
160
+ │ ├── 08_parallel_execution.py
161
+ │ ├── 09_specifying_plans.py
162
+ │ ├── 10_arguments_for_compute.py
163
+ │ ├── 11_Using_RasExamples.ipynb
164
+ │ ├── 12_plan_set_execution.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
171
+ ├── tests
172
+ │ └── ... (test files)
173
+ ├── .gitignore
174
+ ├── LICENSE
175
+ ├── README.md
176
+ ├── STYLE_GUIDE.md
177
+ ├── Comprehensive_Library_Guide.md
178
+ ├── pyproject.toml
179
+ ├── setup.cfg
180
+ ├── setup.py
181
+ └── requirements.txt
182
+ ```
183
+
184
+ ## Accessing HEC Examples through RasExamples
185
+
186
+ The `RasExamples` class provides functionality for quickly loading and managing HEC-RAS example projects. This is particularly useful for testing and development purposes.
187
+
188
+ Key features:
189
+ - Download and extract HEC-RAS example projects
190
+ - List available project categories and projects
191
+ - Extract specific projects for use
192
+ - Manage example project data efficiently
193
+
194
+ Example usage:
195
+ from ras_commander import RasExamples
196
+
197
+ ```
198
+ ras_examples = RasExamples()
199
+ ras_examples.get_example_projects() # Downloads example projects if not already present
200
+ categories = ras_examples.list_categories()
201
+ projects = ras_examples.list_projects("Steady Flow")
202
+ extracted_paths = ras_examples.extract_project(["Bald Eagle Creek", "Muncie"])
203
+ ```
204
+
205
+ ## RasPrj
206
+
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.
208
+
209
+ Key features:
210
+ - Initialize HEC-RAS projects
211
+ - Load and manage project data (plans, geometries, flows, etc.)
212
+ - Provide easy access to project files and information
213
+
214
+ Note: While a global `ras` object is available for convenience, you can create multiple `RasPrj` instances to manage several projects simultaneously.
215
+
216
+ Example usage:
217
+ ```
218
+ from ras_commander import RasPrj, init_ras_project
219
+ ```
220
+
221
+ ### Using the global ras object
222
+ ```
223
+ init_ras_project("/path/to/project", "6.5")
224
+ ```
225
+
226
+ ### Creating a custom RasPrj instance
227
+ ```
228
+ custom_project = RasPrj()
229
+ init_ras_project("/path/to/another_project", "6.5", ras_instance=custom_project)
230
+ ```
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
+
254
+ ## Documentation
255
+
256
+ For detailed usage instructions and API documentation, please refer to the [Comprehensive Library Guide](Comprehensive_Library_Guide.md).
257
+
258
+ ## Examples
259
+
260
+ Check out the `examples/` directory for sample scripts demonstrating various features of ras-commander.
261
+
262
+ ## Future Development
263
+
264
+ The ras-commander library is an ongoing project. Future plans include:
265
+ - Integration of more advanced AI-driven features
266
+ - Expansion of HMS and DSS functionalities
267
+ - Enhanced GPU support for computational tasks
268
+ - Community-driven development of new modules and features
269
+
270
+ ## Related Resources
271
+
272
+ - [HEC-Commander Blog](https://github.com/billk-FM/HEC-Commander/tree/main/Blog)
273
+ - [GPT-Commander YouTube Channel](https://www.youtube.com/@GPT_Commander)
274
+ - [ChatGPT Examples for Water Resources Engineers](https://github.com/billk-FM/HEC-Commander/tree/main/ChatGPT%20Examples)
275
+
276
+
277
+ ## Contributing
278
+
279
+ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on how to submit pull requests, report issues, and suggest improvements.
280
+
281
+ ## Style Guide
282
+
283
+ This project follows a specific style guide to maintain consistency across the codebase. Please refer to the [Style Guide](STYLE_GUIDE.md) for details on coding conventions, documentation standards, and best practices.
284
+
285
+ ## License
286
+
287
+ ras-commander is released under the MIT License. See the license file for details.
288
+
289
+ ## Acknowledgments
290
+
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
+
315
+
316
+ ## Contact
317
+
318
+ For questions, suggestions, or support, please contact:
319
+ William Katzenmeyer, P.E., C.F.M. - billk@fenstermaker.com
@@ -0,0 +1,289 @@
1
+ # RAS Commander (ras-commander)
2
+
3
+ RAS Commander is a Python library for automating HEC-RAS operations, providing a set of tools to interact with HEC-RAS project files, execute simulations, and manage project data. This library is an evolution of the RASCommander 1.0 Python Notebook Application previously released under the [HEC-Commander tools repository](https://github.com/billk-FM/HEC-Commander).
4
+
5
+ ## Contributors:
6
+ William Katzenmeyer, P.E., C.F.M. - billk@fenstermaker.com
7
+
8
+ Sean Micek, P.E., C.F.M. - smicek@fenstermaker.com
9
+
10
+ Aaron Nichols, P.E., C.F.M. - anichols@fenstermaker.com
11
+
12
+ (Additional Contributors Here)
13
+
14
+
15
+ ## Background
16
+ The ras-commander library emerged from the initial test-bed of AI-driven coding represented by the HEC-Commander tools Python notebooks. These notebooks served as a proof of concept, demonstrating the value proposition of automating HEC-RAS operations. The transition from notebooks to a structured library aims to provide a more robust, maintainable, and extensible solution for water resources engineers.
17
+
18
+ ## Features
19
+
20
+ - Automate HEC-RAS project management and simulations
21
+ - Support for both single and multiple project instances
22
+ - Parallel execution of HEC-RAS plans
23
+ - Utilities for managing geometry, plan, and unsteady flow files
24
+ - Example project management for testing and development
25
+ - Two primary operation modes: "Run Missing" and "Build from DSS"
26
+
27
+ ## AI-Driven Coding Experience
28
+
29
+ ras-commander provides several AI-powered tools to enhance the coding experience:
30
+
31
+ 1. **ChatGPT Assistant: [RAS Commander Library Assistant](https://chatgpt.com/g/g-TZRPR3oAO-ras-commander-library-assistant)**: A specialized GPT model trained on the ras-commander codebase, available for answering queries and providing code suggestions.
32
+
33
+ 2. **[Purpose-Built Knowledge Base Summaries](https://github.com/billk-FM/ras-commander/tree/main/ai_tools/assistant_knowledge_bases)**: Up-to-date compilations of the documentation and codebase for use with large language models like Claude or GPT-4. Look in 'ai_tools/assistant_knowledge_bases/' in the repo.
34
+
35
+ 3. **[Cursor IDE Integration](https://github.com/billk-FM/ras-commander/blob/main/.cursorrules)**: Custom rules for the Cursor IDE to provide context-aware suggestions and documentation. Just open the repository folder in Cursor. You can create your own folders "/workspace/, "/projects/", or "my_projects/" as these are already in the .gitignore, and place your custom scripts there for your projects. This will allow easy referencing of the ras-commander documents and individual repo files, the automatic loading of the .cursorrules file. Alternatvely, download the github repo into your projects folder to easily load documents and use cursor rules files.
36
+ 4. **[AI Assistant Notebook](https://github.com/billk-FM/ras-commander/blob/main/ai_tools/rascommander_code_assistant.ipynb)**: A notebook for dynamic code summarization and API interaction (bring your own API Key). Currently, this only does a single-shot message on the Claude Sonnet 3.5 API, which can be up to 50 cents per request. Future revisions will include the ability to select which knowledge base file to include, a choice of SOTA models + multi turn conversations to build automation notebooks interactively.
37
+
38
+ These tools aim to streamline development and provide intelligent assistance when modeling with, and working with and revising the ras-commander library.
39
+
40
+ ## Installation
41
+
42
+ Create a virtual environment with conda or venv (ask ChatGPT if you need help)
43
+
44
+ In your virtual environment, install ras-commander using pip:
45
+ ```
46
+ pip install pandas requests pathlib
47
+ pip install ras-commander
48
+ ```
49
+
50
+
51
+
52
+ ## Requirements
53
+
54
+ - Tested with Python 3.11
55
+ - HEC-RAS 6.2 or later (other versions may work, all testing was done with version 6.2 and above)
56
+ - Detailed project workflows and/or existing libraries and code where ras-commander can be integrated.
57
+
58
+ For a full list of dependencies, see the `requirements.txt` file.
59
+
60
+ ## Quick Start
61
+ ```
62
+ from ras_commander import init_ras_project, RasCmdr, RasPlan
63
+ ```
64
+
65
+ # Initialize a project
66
+ ```
67
+ init_ras_project(r"/path/to/project", "6.5")
68
+ ```
69
+
70
+ # Execute a single plan
71
+ ```
72
+ RasCmdr.compute_plan("01", dest_folder=r"/path/to/results", overwrite_dest=True)
73
+ ```
74
+
75
+ # Execute plans in parallel
76
+ ```
77
+ results = RasCmdr.compute_parallel(
78
+ plan_numbers=["01", "02"],
79
+ max_workers=2,
80
+ cores_per_run=2,
81
+ dest_folder=r"/path/to/results",
82
+ overwrite_dest=True
83
+ )
84
+ ```
85
+
86
+ # Modify a plan
87
+ ```
88
+ RasPlan.set_geom("01", "02")
89
+ ```
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
+
93
+ ## Key Components
94
+
95
+ - `RasPrj`: Manages HEC-RAS projects, handling initialization and data loading
96
+ - `RasCmdr`: Handles execution of HEC-RAS simulations
97
+ - `RasPlan`: Provides functions for modifying and updating plan files
98
+ - `RasGeo`: Handles operations related to geometry files
99
+ - `RasUnsteady`: Manages unsteady flow file operations
100
+ - `RasUtils`: Contains utility functions for file operations and data management
101
+ - `RasExamples`: Manages and loads HEC-RAS example projects
102
+ - `RasHdf`: Provides utilities for working with HDF files in HEC-RAS projects
103
+
104
+ ## Project Organization Diagram
105
+
106
+ ```
107
+ ras_commander
108
+ ├── .github
109
+ │ └── workflows
110
+ │ └── python-package.yml
111
+ ├── ras_commander
112
+ │ ├── __init__.py
113
+ │ ├── _version.py
114
+ │ ├── RasCmdr.py
115
+ │ ├── RasExamples.py
116
+ │ ├── RasGeo.py
117
+ │ ├── RasHdf.py
118
+ │ ├── RasPlan.py
119
+ │ ├── RasPrj.py
120
+ │ ├── RasUnsteady.py
121
+ │ └── RasUtils.py
122
+ ├── examples
123
+ │ ├── 01_project_initialization.py
124
+ │ ├── 02_plan_operations.py
125
+ │ ├── 03_geometry_operations.py
126
+ │ ├── 04_unsteady_flow_operations.py
127
+ │ ├── 05_utility_functions.py
128
+ │ ├── 06_single_plan_execution.py
129
+ │ ├── 07_sequential_plan_execution.py
130
+ │ ├── 08_parallel_execution.py
131
+ │ ├── 09_specifying_plans.py
132
+ │ ├── 10_arguments_for_compute.py
133
+ │ ├── 11_Using_RasExamples.ipynb
134
+ │ ├── 12_plan_set_execution.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
141
+ ├── tests
142
+ │ └── ... (test files)
143
+ ├── .gitignore
144
+ ├── LICENSE
145
+ ├── README.md
146
+ ├── STYLE_GUIDE.md
147
+ ├── Comprehensive_Library_Guide.md
148
+ ├── pyproject.toml
149
+ ├── setup.cfg
150
+ ├── setup.py
151
+ └── requirements.txt
152
+ ```
153
+
154
+ ## Accessing HEC Examples through RasExamples
155
+
156
+ The `RasExamples` class provides functionality for quickly loading and managing HEC-RAS example projects. This is particularly useful for testing and development purposes.
157
+
158
+ Key features:
159
+ - Download and extract HEC-RAS example projects
160
+ - List available project categories and projects
161
+ - Extract specific projects for use
162
+ - Manage example project data efficiently
163
+
164
+ Example usage:
165
+ from ras_commander import RasExamples
166
+
167
+ ```
168
+ ras_examples = RasExamples()
169
+ ras_examples.get_example_projects() # Downloads example projects if not already present
170
+ categories = ras_examples.list_categories()
171
+ projects = ras_examples.list_projects("Steady Flow")
172
+ extracted_paths = ras_examples.extract_project(["Bald Eagle Creek", "Muncie"])
173
+ ```
174
+
175
+ ## RasPrj
176
+
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.
178
+
179
+ Key features:
180
+ - Initialize HEC-RAS projects
181
+ - Load and manage project data (plans, geometries, flows, etc.)
182
+ - Provide easy access to project files and information
183
+
184
+ Note: While a global `ras` object is available for convenience, you can create multiple `RasPrj` instances to manage several projects simultaneously.
185
+
186
+ Example usage:
187
+ ```
188
+ from ras_commander import RasPrj, init_ras_project
189
+ ```
190
+
191
+ ### Using the global ras object
192
+ ```
193
+ init_ras_project("/path/to/project", "6.5")
194
+ ```
195
+
196
+ ### Creating a custom RasPrj instance
197
+ ```
198
+ custom_project = RasPrj()
199
+ init_ras_project("/path/to/another_project", "6.5", ras_instance=custom_project)
200
+ ```
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
+
224
+ ## Documentation
225
+
226
+ For detailed usage instructions and API documentation, please refer to the [Comprehensive Library Guide](Comprehensive_Library_Guide.md).
227
+
228
+ ## Examples
229
+
230
+ Check out the `examples/` directory for sample scripts demonstrating various features of ras-commander.
231
+
232
+ ## Future Development
233
+
234
+ The ras-commander library is an ongoing project. Future plans include:
235
+ - Integration of more advanced AI-driven features
236
+ - Expansion of HMS and DSS functionalities
237
+ - Enhanced GPU support for computational tasks
238
+ - Community-driven development of new modules and features
239
+
240
+ ## Related Resources
241
+
242
+ - [HEC-Commander Blog](https://github.com/billk-FM/HEC-Commander/tree/main/Blog)
243
+ - [GPT-Commander YouTube Channel](https://www.youtube.com/@GPT_Commander)
244
+ - [ChatGPT Examples for Water Resources Engineers](https://github.com/billk-FM/HEC-Commander/tree/main/ChatGPT%20Examples)
245
+
246
+
247
+ ## Contributing
248
+
249
+ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on how to submit pull requests, report issues, and suggest improvements.
250
+
251
+ ## Style Guide
252
+
253
+ This project follows a specific style guide to maintain consistency across the codebase. Please refer to the [Style Guide](STYLE_GUIDE.md) for details on coding conventions, documentation standards, and best practices.
254
+
255
+ ## License
256
+
257
+ ras-commander is released under the MIT License. See the license file for details.
258
+
259
+ ## Acknowledgments
260
+
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
+
285
+
286
+ ## Contact
287
+
288
+ For questions, suggestions, or support, please contact:
289
+ William Katzenmeyer, P.E., C.F.M. - billk@fenstermaker.com