ras-commander 0.57.0__tar.gz → 0.59.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 (40) hide show
  1. {ras_commander-0.57.0/ras_commander.egg-info → ras_commander-0.59.0}/PKG-INFO +103 -59
  2. {ras_commander-0.57.0 → ras_commander-0.59.0}/README.md +103 -59
  3. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/RasExamples.py +12 -3
  4. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/RasPrj.py +14 -5
  5. {ras_commander-0.57.0 → ras_commander-0.59.0/ras_commander.egg-info}/PKG-INFO +103 -59
  6. {ras_commander-0.57.0 → ras_commander-0.59.0}/setup.py +1 -1
  7. {ras_commander-0.57.0 → ras_commander-0.59.0}/LICENSE +0 -0
  8. {ras_commander-0.57.0 → ras_commander-0.59.0}/pyproject.toml +0 -0
  9. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/Decorators.py +0 -0
  10. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfBase.py +0 -0
  11. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfBndry.py +0 -0
  12. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfFluvialPluvial.py +0 -0
  13. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfInfiltration.py +0 -0
  14. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfMesh.py +0 -0
  15. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfPipe.py +0 -0
  16. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfPlan.py +0 -0
  17. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfPlot.py +0 -0
  18. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfPump.py +0 -0
  19. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfResultsMesh.py +0 -0
  20. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfResultsPlan.py +0 -0
  21. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfResultsPlot.py +0 -0
  22. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfResultsXsec.py +0 -0
  23. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfStruc.py +0 -0
  24. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfUtils.py +0 -0
  25. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/HdfXsec.py +0 -0
  26. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/LoggingConfig.py +0 -0
  27. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/RasCmdr.py +0 -0
  28. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/RasGeo.py +0 -0
  29. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/RasGpt.py +0 -0
  30. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/RasMapper.py +0 -0
  31. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/RasPlan.py +0 -0
  32. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/RasToGo.py +0 -0
  33. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/RasUnsteady.py +0 -0
  34. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/RasUtils.py +0 -0
  35. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander/__init__.py +0 -0
  36. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander.egg-info/SOURCES.txt +0 -0
  37. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander.egg-info/dependency_links.txt +0 -0
  38. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander.egg-info/requires.txt +0 -0
  39. {ras_commander-0.57.0 → ras_commander-0.59.0}/ras_commander.egg-info/top_level.txt +0 -0
  40. {ras_commander-0.57.0 → ras_commander-0.59.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ras-commander
3
- Version: 0.57.0
3
+ Version: 0.59.0
4
4
  Summary: A Python library for automating HEC-RAS 6.x operations
5
5
  Home-page: https://github.com/gpt-cmdr/ras-commander
6
6
  Author: William M. Katzenmeyer, P.E., C.F.M.
@@ -34,27 +34,20 @@ Dynamic: summary
34
34
 
35
35
  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 was initially conceptualized in the Australian Water School course "AI Tools for Modelling Innovation", and subsequently expanded to cover the basic functionality of the HECRASController COM32 interface using open-source python libraries. This library uses a Test Driven Development strategy, leveraging the publicly-available HEC-RAS Example projects to create repeatable demonstration examples. The "Commmander" moniker is inspired by the "Command Line is All You Need" approach to HEC-RAS automation that was first implemented in the HEC-Commander Tools repository.
36
36
 
37
- ## Contributors:
38
- William Katzenmeyer, P.E., C.F.M.
37
+ ## Repository Author:
38
+ (William Katzenmeyer, P.E., C.F.M.)[https://engineeringwithllms.info]
39
39
 
40
- Sean Micek, P.E., C.F.M.
41
-
42
- Aaron Nichols, P.E., C.F.M.
43
-
44
- (Additional Contributors Here)
45
-
46
- ## Don't Ask Me, Ask ChatGPT!
40
+ ## Don't Ask Me, Ask GPT!
47
41
 
48
42
  This repository has several methods of interaction with Large Language Models and LLM-Assisted Coding built right in:
49
43
 
50
44
  1. **[RAS Commander Library Assistant GPT](https://chatgpt.com/g/g-TZRPR3oAO-ras-commander-library-assistant)**: A specialized GPT model with access to the ras-commander codebase and library, available for answering queries and providing code suggestions. You can even upload your own plan, unsteady and HDF files to inspect and help determine how to automate your workflows or visualize your results, although this ability is still limited by OpenAI's GPT frameworks and may not be useful for long conversations.
51
45
 
52
- 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. The repo's codebase (without documentation and examples) has been curated to stay within the current ~200k context window limitations of frontier models, and for tasks that do not need an understanding of the underlying code, the Comprehensive Library Guide and any relevant examples from the example folder should be adequate context for leveraging the ras-commander API to complete tasks.
46
+ 2. **[Purpose-Built Knowledge Base Summaries](https://github.com/gpt-cmdr/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. The repo's codebase (without documentation and examples) has been curated to stay within the current ~200k context window limitations of frontier models, and for tasks that do not need an understanding of the underlying code, the Comprehensive Library Guide and any relevant examples from the example folder should be adequate context for leveraging the ras-commander API to complete tasks.
53
47
 
54
- 3. **[Cursor IDE Integration](https://github.com/billk-FM/ras-commander/blob/main/.cursorrules)**: Custom rules(.cursorrules) for the Cursor IDE to provide context-aware suggestions and documentation. Just open the repository folder in Cursor to recognize these instructions. 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.
55
-
56
- 5. **[RAS-Commander Library Assistant](https://github.com/billk-FM/ras-commander/blob/main/library_assistant)**: A full-featured interface for multi-turn conversations, using your own API keys and the ras-commander library for context. The library assistant allows you to load your own scripts and chat with specific examples and/or function classes in the RAS-Commander library to effectively utilize the library's functions in your workflow. To reduce hallucinations, a file browser is included which adds full files to the conversation to ensure grounded responses. A dashboard shows you the total context and estimated cost of each request. **Now with support for OpenAI's o1 and o3-mini, and Deepseek V3 and R1 models using US-based Together.ai**
48
+ 3. **[Cursor IDE Integration](https://github.com/gpt-cmdr/ras-commander/blob/main/.cursorrules)**: Custom rules(.cursorrules) for the Cursor IDE to provide context-aware suggestions and documentation. Just open the repository folder in Cursor to recognize these instructions. 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.
57
49
 
50
+ 5. **[RAS-Commander Library Assistant](https://github.com/gpt-cmdr/ras-commander/blob/main/library_assistant)**: A full-featured interface for multi-turn conversations, using your own API keys and the ras-commander library for context. The library assistant allows you to load your own scripts and chat with specific examples and/or function classes in the RAS-Commander library to effectively utilize the library's functions in your workflow. To reduce hallucinations, a file browser is included which adds full files to the conversation to ensure grounded responses. A dashboard shows you the total context and estimated cost of each request. **Now with support for OpenAI's o1 and o3-mini, and Deepseek V3 and R1 models using US-based Together.ai**
58
51
 
59
52
  ## Background
60
53
  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.
@@ -71,8 +64,6 @@ HEC-RAS Project Management & Execution
71
64
  - Progress tracking and logging
72
65
  - Execution error handling and recovery
73
66
 
74
-
75
-
76
67
  HDF Data Access & Analysis
77
68
  - 2D mesh results processing (depths, velocities, WSE)
78
69
  - Cross-section data extraction
@@ -82,7 +73,6 @@ HDF Data Access & Analysis
82
73
  - Fluvial-pluvial boundary calculations
83
74
  - Infiltration and precipitation data handling
84
75
 
85
-
86
76
  RAS ASCII File Operations
87
77
  - Plan file creation and modification
88
78
  - Geometry file parsing examples
@@ -99,7 +89,6 @@ First, create a virtual environment with conda or venv (ask ChatGPT if you need
99
89
 
100
90
  In your virtual environment, install ras-commander using pip:
101
91
  ```
102
- pip install h5py numpy pandas requests tqdm scipy xarray geopandas matplotlib ipython tqdm psutil shapely fiona pathlib rtree rasterstats
103
92
  pip install --upgrade ras-commander
104
93
  ```
105
94
  If you have dependency issues with pip (especially if you have errors with numpy), try clearing your local pip packages 'C:\Users\your_username\AppData\Roaming\Python\' and then creating a new virtual environment.
@@ -124,10 +113,6 @@ except ImportError:
124
113
  ```
125
114
  It is highly suggested to fork this repository before going this route, and using Git to manage your changes! This allows any revisions to the ras-commander classes and functions to be actively edited and developed by end users. The folders "/workspace/, "/projects/", or "my_projects/" are included in the .gitignore, so users can place you custom scripts there for any project data they don't want to be tracked by git.
126
115
 
127
-
128
-
129
-
130
-
131
116
  ## Quick Start Guide
132
117
 
133
118
  ```
@@ -147,9 +132,9 @@ RasCmdr.compute_plan("01", dest_folder=r"/path/to/results", overwrite_dest=True)
147
132
  ### Execute plans in parallel
148
133
  ```
149
134
  results = RasCmdr.compute_parallel(
150
- plan_numbers=["01", "02"],
135
+ plan_number=["01", "02"],
151
136
  max_workers=2,
152
- cores_per_run=2,
137
+ num_cores=2,
153
138
  dest_folder=r"/path/to/results",
154
139
  overwrite_dest=True
155
140
  )
@@ -160,7 +145,62 @@ results = RasCmdr.compute_parallel(
160
145
  RasPlan.set_geom("01", "02")
161
146
  ```
162
147
 
163
- 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.
148
+ ### Execution Modes
149
+
150
+ RAS Commander provides three methods for executing HEC-RAS plans:
151
+
152
+ #### Single Plan Execution
153
+ ```python
154
+ # Execute a single plan
155
+ success = RasCmdr.compute_plan("01", dest_folder=r"/path/to/results")
156
+ print(f"Plan execution {'successful' if success else 'failed'}")
157
+ ```
158
+
159
+ #### Sequential Execution of Multiple Plans
160
+ ```python
161
+ # Execute multiple plans in sequence in a test folder
162
+ results = RasCmdr.compute_test_mode(
163
+ plan_number=["01", "02", "03"],
164
+ dest_folder_suffix="[Test]"
165
+ )
166
+ for plan, success in results.items():
167
+ print(f"Plan {plan}: {'Successful' if success else 'Failed'}")
168
+ ```
169
+
170
+ #### Parallel Execution of Multiple Plans
171
+ ```python
172
+ # Execute multiple plans concurrently
173
+ results = RasCmdr.compute_parallel(
174
+ plan_number=["01", "02", "03"],
175
+ max_workers=3,
176
+ num_cores=2
177
+ )
178
+ for plan, success in results.items():
179
+ print(f"Plan {plan}: {'Successful' if success else 'Failed'}")
180
+ ```
181
+
182
+ ### Working with Multiple Projects
183
+
184
+ RAS Commander allows working with multiple HEC-RAS projects simultaneously:
185
+
186
+ ```python
187
+ # Initialize multiple projects
188
+ project1 = init_ras_project(path1, "6.6")
189
+ project2 = init_ras_project(path2, "6.6")
190
+
191
+ # Perform operations on each project
192
+ RasCmdr.compute_plan("01", ras_object=project1, dest_folder=folder1)
193
+ RasCmdr.compute_plan("01", ras_object=project2, dest_folder=folder2)
194
+
195
+ # Compare results between projects
196
+ print(f"Project 1: {project1.project_name}")
197
+ print(f"Project 2: {project2.project_name}")
198
+
199
+ # Always specify the ras_object parameter when working with multiple projects
200
+ # to avoid confusion with the global 'ras' object
201
+ ```
202
+
203
+ This is useful for comparing different river systems, running scenario analyses across multiple watersheds, or managing a suite of related models.
164
204
 
165
205
  #### Key Components
166
206
 
@@ -190,8 +230,6 @@ Certainly! I'll provide you with an updated Key Components section and Project O
190
230
 
191
231
  ### Project Organization Diagram
192
232
 
193
- ### Project Organization Diagram
194
-
195
233
  ```
196
234
  ras_commander
197
235
  ├── ras_commander
@@ -222,24 +260,16 @@ ras_commander
222
260
  │ ├── HdfPlot.py
223
261
  │ └── HdfResultsPlot.py
224
262
  ├── examples
225
- │ ├── 01_project_initialization.py
226
- │ ├── 02_plan_operations.py
227
- │ ├── 03_geometry_operations.py
228
- │ ├── 04_unsteady_flow_operations.py
229
- │ ├── 05_utility_functions.py
230
- │ ├── 06_single_plan_execution.py
231
- │ ├── 07_sequential_plan_execution.py
232
- │ ├── 08_parallel_execution.py
233
- │ ├── 09_specifying_plans.py
234
- │ ├── 10_arguments_for_compute.py
235
- │ ├── 11_Using_RasExamples.ipynb
236
- │ ├── 12_plan_set_execution.py
237
- │ ├── 13_multiple_project_operations.py
238
- │ ├── 14_Core_Sensitivity.ipynb
239
- │ ├── 15_plan_key_operations.py
240
- │ ├── 16_scanning_ras_project_info.py
241
- │ ├── 17_parallel_execution_ble.py
242
- │ └── HEC_RAS_2D_HDF_Analysis.ipynb
263
+ │ ├── 00_Using_RasExamples.ipynb
264
+ │ ├── 01_project_initialization.ipynb
265
+ │ ├── 02_plan_and_geometry_operations.ipynb
266
+ │ ├── 03_unsteady_flow_operations.ipynb
267
+ │ ├── 04_multiple_project_operations.ipynb
268
+ │ ├── 05_single_plan_execution.ipynb
269
+ │ ├── 06_executing_plan_sets.ipynb
270
+ │ ├── 07_sequential_plan_execution.ipynb
271
+ │ ├── 08_parallel_execution.ipynb
272
+ │ └── 09_plan_parameter_operations.ipynb
243
273
  ├── tests
244
274
  │ └── ... (test files)
245
275
  ├── .gitignore
@@ -267,8 +297,6 @@ Example usage:
267
297
  from ras_commander import RasExamples
268
298
 
269
299
  ```
270
- ras_examples = RasExamples()
271
- ras_examples.get_example_projects() # Downloads example projects if not already present
272
300
  categories = ras_examples.list_categories()
273
301
  projects = ras_examples.list_projects("Steady Flow")
274
302
  extracted_paths = ras_examples.extract_project(["Bald Eagle Creek", "Muncie"])
@@ -321,7 +349,6 @@ print(runtime_data)
321
349
  ```
322
350
  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.
323
351
 
324
-
325
352
  #### Infrastructure Analysis
326
353
  ```python
327
354
  from ras_commander import HdfPipe, HdfPump
@@ -358,13 +385,33 @@ boundary = HdfFluvialPluvial.calculate_fluvial_pluvial_boundary(
358
385
  )
359
386
  ```
360
387
 
361
- ## Documentation
388
+ ## Examples
362
389
 
363
- For detailed usage instructions and API documentation, please refer to the [Comprehensive Library Guide](Comprehensive_Library_Guide.md).
390
+ Check out the examples in the repository to learn how to use RAS Commander:
364
391
 
365
- ## Examples
392
+ ### Project Setup
393
+ - `00_Using_RasExamples.ipynb`: Download and extract HEC-RAS example projects
394
+ - `01_project_initialization.ipynb`: Initialize HEC-RAS projects and explore their components
395
+
396
+ ### File Operations
397
+ - `02_plan_and_geometry_operations.ipynb`: Clone and modify plan and geometry files
398
+ - `03_unsteady_flow_operations.ipynb`: Extract and modify boundary conditions
399
+ - `09_plan_parameter_operations.ipynb`: Retrieve and update plan parameters
400
+
401
+ ### Execution Modes
402
+ - `05_single_plan_execution.ipynb`: Execute a single plan with specific options
403
+ - `06_executing_plan_sets.ipynb`: Different ways to specify and execute plan sets
404
+ - `07_sequential_plan_execution.ipynb`: Run multiple plans in sequence
405
+ - `08_parallel_execution.ipynb`: Run multiple plans in parallel
366
406
 
367
- Check out the `examples/` directory for sample scripts demonstrating various features of ras-commander.
407
+ ### Advanced Operations
408
+ - `04_multiple_project_operations.ipynb`: Work with multiple HEC-RAS projects simultaneously
409
+
410
+ These examples demonstrate practical applications of RAS Commander for automating HEC-RAS workflows, from basic operations to advanced scenarios.
411
+
412
+ ## Documentation
413
+
414
+ For detailed usage instructions and API documentation, please refer to the [Comprehensive Library Guide](Comprehensive_Library_Guide.md).
368
415
 
369
416
  ## Future Development
370
417
 
@@ -375,10 +422,9 @@ The ras-commander library is an ongoing project. Future plans include:
375
422
 
376
423
  ## Related Resources
377
424
 
378
- - [HEC-Commander Blog](https://github.com/billk-FM/HEC-Commander/tree/main/Blog)
425
+ - [HEC-Commander Blog](https://github.com/gpt-cmdr/HEC-Commander/tree/main/Blog)
379
426
  - [GPT-Commander YouTube Channel](https://www.youtube.com/@GPT_Commander)
380
- - [ChatGPT Examples for Water Resources Engineers](https://github.com/billk-FM/HEC-Commander/tree/main/ChatGPT%20Examples)
381
-
427
+ - [ChatGPT Examples for Water Resources Engineers](https://github.com/gpt-cmdr/HEC-Commander/tree/main/ChatGPT%20Examples)
382
428
 
383
429
  ## Contributing
384
430
 
@@ -415,8 +461,7 @@ These acknowledgments recognize the contributions and inspirations that have hel
415
461
 
416
462
  4. 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.
417
463
 
418
- 5. [HEC-Commander Tools](https://github.com/billk-FM/HEC-Commander) - Inspiration and initial code base for the development of RAS Commander.
419
-
464
+ 5. [HEC-Commander Tools](https://github.com/gpt-cmdr/HEC-Commander) - Inspiration and initial code base for the development of RAS Commander.
420
465
 
421
466
  ## Official RAS Commander AI-Generated Songs:
422
467
 
@@ -426,14 +471,13 @@ These acknowledgments recognize the contributions and inspirations that have hel
426
471
 
427
472
  ## Other Resources
428
473
 
429
- Notebook version of RAS-Commander: [RAS-Commander Notebook in the HEC-Commander Tools Repository](https://github.com/billk-FM/HEC-Commander/tree/main/RAS-Commander)
474
+ Notebook version of RAS-Commander: [RAS-Commander Notebook in the HEC-Commander Tools Repository](https://github.com/gpt-cmdr/HEC-Commander/tree/main/RAS-Commander)
430
475
  Youtube Tutorials for HEC-Commander Tools and RAS-Commander: [GPT-Commander on YouTube](https://www.youtube.com/@GPT_Commander/videos)
431
476
 
432
477
  ## LICENSE
433
478
 
434
479
  This software is released under the MIT license.
435
480
 
436
-
437
481
  ## Contact
438
482
 
439
483
  For questions, suggestions, or support, please contact:
@@ -2,27 +2,20 @@
2
2
 
3
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 was initially conceptualized in the Australian Water School course "AI Tools for Modelling Innovation", and subsequently expanded to cover the basic functionality of the HECRASController COM32 interface using open-source python libraries. This library uses a Test Driven Development strategy, leveraging the publicly-available HEC-RAS Example projects to create repeatable demonstration examples. The "Commmander" moniker is inspired by the "Command Line is All You Need" approach to HEC-RAS automation that was first implemented in the HEC-Commander Tools repository.
4
4
 
5
- ## Contributors:
6
- William Katzenmeyer, P.E., C.F.M.
5
+ ## Repository Author:
6
+ (William Katzenmeyer, P.E., C.F.M.)[https://engineeringwithllms.info]
7
7
 
8
- Sean Micek, P.E., C.F.M.
9
-
10
- Aaron Nichols, P.E., C.F.M.
11
-
12
- (Additional Contributors Here)
13
-
14
- ## Don't Ask Me, Ask ChatGPT!
8
+ ## Don't Ask Me, Ask GPT!
15
9
 
16
10
  This repository has several methods of interaction with Large Language Models and LLM-Assisted Coding built right in:
17
11
 
18
12
  1. **[RAS Commander Library Assistant GPT](https://chatgpt.com/g/g-TZRPR3oAO-ras-commander-library-assistant)**: A specialized GPT model with access to the ras-commander codebase and library, available for answering queries and providing code suggestions. You can even upload your own plan, unsteady and HDF files to inspect and help determine how to automate your workflows or visualize your results, although this ability is still limited by OpenAI's GPT frameworks and may not be useful for long conversations.
19
13
 
20
- 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. The repo's codebase (without documentation and examples) has been curated to stay within the current ~200k context window limitations of frontier models, and for tasks that do not need an understanding of the underlying code, the Comprehensive Library Guide and any relevant examples from the example folder should be adequate context for leveraging the ras-commander API to complete tasks.
14
+ 2. **[Purpose-Built Knowledge Base Summaries](https://github.com/gpt-cmdr/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. The repo's codebase (without documentation and examples) has been curated to stay within the current ~200k context window limitations of frontier models, and for tasks that do not need an understanding of the underlying code, the Comprehensive Library Guide and any relevant examples from the example folder should be adequate context for leveraging the ras-commander API to complete tasks.
21
15
 
22
- 3. **[Cursor IDE Integration](https://github.com/billk-FM/ras-commander/blob/main/.cursorrules)**: Custom rules(.cursorrules) for the Cursor IDE to provide context-aware suggestions and documentation. Just open the repository folder in Cursor to recognize these instructions. 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.
23
-
24
- 5. **[RAS-Commander Library Assistant](https://github.com/billk-FM/ras-commander/blob/main/library_assistant)**: A full-featured interface for multi-turn conversations, using your own API keys and the ras-commander library for context. The library assistant allows you to load your own scripts and chat with specific examples and/or function classes in the RAS-Commander library to effectively utilize the library's functions in your workflow. To reduce hallucinations, a file browser is included which adds full files to the conversation to ensure grounded responses. A dashboard shows you the total context and estimated cost of each request. **Now with support for OpenAI's o1 and o3-mini, and Deepseek V3 and R1 models using US-based Together.ai**
16
+ 3. **[Cursor IDE Integration](https://github.com/gpt-cmdr/ras-commander/blob/main/.cursorrules)**: Custom rules(.cursorrules) for the Cursor IDE to provide context-aware suggestions and documentation. Just open the repository folder in Cursor to recognize these instructions. 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.
25
17
 
18
+ 5. **[RAS-Commander Library Assistant](https://github.com/gpt-cmdr/ras-commander/blob/main/library_assistant)**: A full-featured interface for multi-turn conversations, using your own API keys and the ras-commander library for context. The library assistant allows you to load your own scripts and chat with specific examples and/or function classes in the RAS-Commander library to effectively utilize the library's functions in your workflow. To reduce hallucinations, a file browser is included which adds full files to the conversation to ensure grounded responses. A dashboard shows you the total context and estimated cost of each request. **Now with support for OpenAI's o1 and o3-mini, and Deepseek V3 and R1 models using US-based Together.ai**
26
19
 
27
20
  ## Background
28
21
  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.
@@ -39,8 +32,6 @@ HEC-RAS Project Management & Execution
39
32
  - Progress tracking and logging
40
33
  - Execution error handling and recovery
41
34
 
42
-
43
-
44
35
  HDF Data Access & Analysis
45
36
  - 2D mesh results processing (depths, velocities, WSE)
46
37
  - Cross-section data extraction
@@ -50,7 +41,6 @@ HDF Data Access & Analysis
50
41
  - Fluvial-pluvial boundary calculations
51
42
  - Infiltration and precipitation data handling
52
43
 
53
-
54
44
  RAS ASCII File Operations
55
45
  - Plan file creation and modification
56
46
  - Geometry file parsing examples
@@ -67,7 +57,6 @@ First, create a virtual environment with conda or venv (ask ChatGPT if you need
67
57
 
68
58
  In your virtual environment, install ras-commander using pip:
69
59
  ```
70
- pip install h5py numpy pandas requests tqdm scipy xarray geopandas matplotlib ipython tqdm psutil shapely fiona pathlib rtree rasterstats
71
60
  pip install --upgrade ras-commander
72
61
  ```
73
62
  If you have dependency issues with pip (especially if you have errors with numpy), try clearing your local pip packages 'C:\Users\your_username\AppData\Roaming\Python\' and then creating a new virtual environment.
@@ -92,10 +81,6 @@ except ImportError:
92
81
  ```
93
82
  It is highly suggested to fork this repository before going this route, and using Git to manage your changes! This allows any revisions to the ras-commander classes and functions to be actively edited and developed by end users. The folders "/workspace/, "/projects/", or "my_projects/" are included in the .gitignore, so users can place you custom scripts there for any project data they don't want to be tracked by git.
94
83
 
95
-
96
-
97
-
98
-
99
84
  ## Quick Start Guide
100
85
 
101
86
  ```
@@ -115,9 +100,9 @@ RasCmdr.compute_plan("01", dest_folder=r"/path/to/results", overwrite_dest=True)
115
100
  ### Execute plans in parallel
116
101
  ```
117
102
  results = RasCmdr.compute_parallel(
118
- plan_numbers=["01", "02"],
103
+ plan_number=["01", "02"],
119
104
  max_workers=2,
120
- cores_per_run=2,
105
+ num_cores=2,
121
106
  dest_folder=r"/path/to/results",
122
107
  overwrite_dest=True
123
108
  )
@@ -128,7 +113,62 @@ results = RasCmdr.compute_parallel(
128
113
  RasPlan.set_geom("01", "02")
129
114
  ```
130
115
 
131
- 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.
116
+ ### Execution Modes
117
+
118
+ RAS Commander provides three methods for executing HEC-RAS plans:
119
+
120
+ #### Single Plan Execution
121
+ ```python
122
+ # Execute a single plan
123
+ success = RasCmdr.compute_plan("01", dest_folder=r"/path/to/results")
124
+ print(f"Plan execution {'successful' if success else 'failed'}")
125
+ ```
126
+
127
+ #### Sequential Execution of Multiple Plans
128
+ ```python
129
+ # Execute multiple plans in sequence in a test folder
130
+ results = RasCmdr.compute_test_mode(
131
+ plan_number=["01", "02", "03"],
132
+ dest_folder_suffix="[Test]"
133
+ )
134
+ for plan, success in results.items():
135
+ print(f"Plan {plan}: {'Successful' if success else 'Failed'}")
136
+ ```
137
+
138
+ #### Parallel Execution of Multiple Plans
139
+ ```python
140
+ # Execute multiple plans concurrently
141
+ results = RasCmdr.compute_parallel(
142
+ plan_number=["01", "02", "03"],
143
+ max_workers=3,
144
+ num_cores=2
145
+ )
146
+ for plan, success in results.items():
147
+ print(f"Plan {plan}: {'Successful' if success else 'Failed'}")
148
+ ```
149
+
150
+ ### Working with Multiple Projects
151
+
152
+ RAS Commander allows working with multiple HEC-RAS projects simultaneously:
153
+
154
+ ```python
155
+ # Initialize multiple projects
156
+ project1 = init_ras_project(path1, "6.6")
157
+ project2 = init_ras_project(path2, "6.6")
158
+
159
+ # Perform operations on each project
160
+ RasCmdr.compute_plan("01", ras_object=project1, dest_folder=folder1)
161
+ RasCmdr.compute_plan("01", ras_object=project2, dest_folder=folder2)
162
+
163
+ # Compare results between projects
164
+ print(f"Project 1: {project1.project_name}")
165
+ print(f"Project 2: {project2.project_name}")
166
+
167
+ # Always specify the ras_object parameter when working with multiple projects
168
+ # to avoid confusion with the global 'ras' object
169
+ ```
170
+
171
+ This is useful for comparing different river systems, running scenario analyses across multiple watersheds, or managing a suite of related models.
132
172
 
133
173
  #### Key Components
134
174
 
@@ -158,8 +198,6 @@ Certainly! I'll provide you with an updated Key Components section and Project O
158
198
 
159
199
  ### Project Organization Diagram
160
200
 
161
- ### Project Organization Diagram
162
-
163
201
  ```
164
202
  ras_commander
165
203
  ├── ras_commander
@@ -190,24 +228,16 @@ ras_commander
190
228
  │ ├── HdfPlot.py
191
229
  │ └── HdfResultsPlot.py
192
230
  ├── examples
193
- │ ├── 01_project_initialization.py
194
- │ ├── 02_plan_operations.py
195
- │ ├── 03_geometry_operations.py
196
- │ ├── 04_unsteady_flow_operations.py
197
- │ ├── 05_utility_functions.py
198
- │ ├── 06_single_plan_execution.py
199
- │ ├── 07_sequential_plan_execution.py
200
- │ ├── 08_parallel_execution.py
201
- │ ├── 09_specifying_plans.py
202
- ├── 10_arguments_for_compute.py
203
- │ ├── 11_Using_RasExamples.ipynb
204
- │ ├── 12_plan_set_execution.py
205
- │ ├── 13_multiple_project_operations.py
206
- │ ├── 14_Core_Sensitivity.ipynb
207
- │ ├── 15_plan_key_operations.py
208
- │ ├── 16_scanning_ras_project_info.py
209
- │ ├── 17_parallel_execution_ble.py
210
- │ └── HEC_RAS_2D_HDF_Analysis.ipynb
231
+ │ ├── 00_Using_RasExamples.ipynb
232
+ │ ├── 01_project_initialization.ipynb
233
+ │ ├── 02_plan_and_geometry_operations.ipynb
234
+ │ ├── 03_unsteady_flow_operations.ipynb
235
+ │ ├── 04_multiple_project_operations.ipynb
236
+ │ ├── 05_single_plan_execution.ipynb
237
+ │ ├── 06_executing_plan_sets.ipynb
238
+ │ ├── 07_sequential_plan_execution.ipynb
239
+ │ ├── 08_parallel_execution.ipynb
240
+ └── 09_plan_parameter_operations.ipynb
211
241
  ├── tests
212
242
  │ └── ... (test files)
213
243
  ├── .gitignore
@@ -235,8 +265,6 @@ Example usage:
235
265
  from ras_commander import RasExamples
236
266
 
237
267
  ```
238
- ras_examples = RasExamples()
239
- ras_examples.get_example_projects() # Downloads example projects if not already present
240
268
  categories = ras_examples.list_categories()
241
269
  projects = ras_examples.list_projects("Steady Flow")
242
270
  extracted_paths = ras_examples.extract_project(["Bald Eagle Creek", "Muncie"])
@@ -289,7 +317,6 @@ print(runtime_data)
289
317
  ```
290
318
  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.
291
319
 
292
-
293
320
  #### Infrastructure Analysis
294
321
  ```python
295
322
  from ras_commander import HdfPipe, HdfPump
@@ -326,13 +353,33 @@ boundary = HdfFluvialPluvial.calculate_fluvial_pluvial_boundary(
326
353
  )
327
354
  ```
328
355
 
329
- ## Documentation
356
+ ## Examples
330
357
 
331
- For detailed usage instructions and API documentation, please refer to the [Comprehensive Library Guide](Comprehensive_Library_Guide.md).
358
+ Check out the examples in the repository to learn how to use RAS Commander:
332
359
 
333
- ## Examples
360
+ ### Project Setup
361
+ - `00_Using_RasExamples.ipynb`: Download and extract HEC-RAS example projects
362
+ - `01_project_initialization.ipynb`: Initialize HEC-RAS projects and explore their components
363
+
364
+ ### File Operations
365
+ - `02_plan_and_geometry_operations.ipynb`: Clone and modify plan and geometry files
366
+ - `03_unsteady_flow_operations.ipynb`: Extract and modify boundary conditions
367
+ - `09_plan_parameter_operations.ipynb`: Retrieve and update plan parameters
368
+
369
+ ### Execution Modes
370
+ - `05_single_plan_execution.ipynb`: Execute a single plan with specific options
371
+ - `06_executing_plan_sets.ipynb`: Different ways to specify and execute plan sets
372
+ - `07_sequential_plan_execution.ipynb`: Run multiple plans in sequence
373
+ - `08_parallel_execution.ipynb`: Run multiple plans in parallel
334
374
 
335
- Check out the `examples/` directory for sample scripts demonstrating various features of ras-commander.
375
+ ### Advanced Operations
376
+ - `04_multiple_project_operations.ipynb`: Work with multiple HEC-RAS projects simultaneously
377
+
378
+ These examples demonstrate practical applications of RAS Commander for automating HEC-RAS workflows, from basic operations to advanced scenarios.
379
+
380
+ ## Documentation
381
+
382
+ For detailed usage instructions and API documentation, please refer to the [Comprehensive Library Guide](Comprehensive_Library_Guide.md).
336
383
 
337
384
  ## Future Development
338
385
 
@@ -343,10 +390,9 @@ The ras-commander library is an ongoing project. Future plans include:
343
390
 
344
391
  ## Related Resources
345
392
 
346
- - [HEC-Commander Blog](https://github.com/billk-FM/HEC-Commander/tree/main/Blog)
393
+ - [HEC-Commander Blog](https://github.com/gpt-cmdr/HEC-Commander/tree/main/Blog)
347
394
  - [GPT-Commander YouTube Channel](https://www.youtube.com/@GPT_Commander)
348
- - [ChatGPT Examples for Water Resources Engineers](https://github.com/billk-FM/HEC-Commander/tree/main/ChatGPT%20Examples)
349
-
395
+ - [ChatGPT Examples for Water Resources Engineers](https://github.com/gpt-cmdr/HEC-Commander/tree/main/ChatGPT%20Examples)
350
396
 
351
397
  ## Contributing
352
398
 
@@ -383,8 +429,7 @@ These acknowledgments recognize the contributions and inspirations that have hel
383
429
 
384
430
  4. 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.
385
431
 
386
- 5. [HEC-Commander Tools](https://github.com/billk-FM/HEC-Commander) - Inspiration and initial code base for the development of RAS Commander.
387
-
432
+ 5. [HEC-Commander Tools](https://github.com/gpt-cmdr/HEC-Commander) - Inspiration and initial code base for the development of RAS Commander.
388
433
 
389
434
  ## Official RAS Commander AI-Generated Songs:
390
435
 
@@ -394,15 +439,14 @@ These acknowledgments recognize the contributions and inspirations that have hel
394
439
 
395
440
  ## Other Resources
396
441
 
397
- Notebook version of RAS-Commander: [RAS-Commander Notebook in the HEC-Commander Tools Repository](https://github.com/billk-FM/HEC-Commander/tree/main/RAS-Commander)
442
+ Notebook version of RAS-Commander: [RAS-Commander Notebook in the HEC-Commander Tools Repository](https://github.com/gpt-cmdr/HEC-Commander/tree/main/RAS-Commander)
398
443
  Youtube Tutorials for HEC-Commander Tools and RAS-Commander: [GPT-Commander on YouTube](https://www.youtube.com/@GPT_Commander/videos)
399
444
 
400
445
  ## LICENSE
401
446
 
402
447
  This software is released under the MIT license.
403
448
 
404
-
405
449
  ## Contact
406
450
 
407
451
  For questions, suggestions, or support, please contact:
408
- William Katzenmeyer, P.E., C.F.M. - heccommander@gmail.com
452
+ William Katzenmeyer, P.E., C.F.M. - heccommander@gmail.com
@@ -122,8 +122,16 @@ class RasExamples:
122
122
  self._save_to_csv()
123
123
 
124
124
  @classmethod
125
- def extract_project(cls, project_names: Union[str, List[str]]):
126
- """Extract one or more specific HEC-RAS projects from the zip file."""
125
+ def extract_project(cls, project_names: Union[str, List[str]]) -> Union[Path, List[Path]]:
126
+ """Extract one or more specific HEC-RAS projects from the zip file.
127
+
128
+ Args:
129
+ project_names: Single project name as string or list of project names
130
+
131
+ Returns:
132
+ Path: Single Path object if one project extracted
133
+ List[Path]: List of Path objects if multiple projects extracted
134
+ """
127
135
  logger.debug(f"Extracting projects: {project_names}")
128
136
 
129
137
  # Initialize if needed
@@ -178,7 +186,8 @@ class RasExamples:
178
186
  except Exception as e:
179
187
  logger.error(f"An error occurred while extracting project '{project_name}': {str(e)}")
180
188
 
181
- return extracted_paths
189
+ # Return single path if only one project was extracted, otherwise return list
190
+ return extracted_paths[0] if len(project_names) == 1 else extracted_paths
182
191
 
183
192
  @classmethod
184
193
  def _find_zip_file(cls):
@@ -828,7 +828,6 @@ def init_ras_project(ras_project_folder, ras_version=None, ras_object=None):
828
828
  Initialize a RAS project.
829
829
 
830
830
  USE THIS FUNCTION TO INITIALIZE A RAS PROJECT, NOT THE INITIALIZE METHOD OF THE RasPrj CLASS.
831
- The initialize method of the RasPrj class only modifies the global 'ras' object.
832
831
 
833
832
  Parameters:
834
833
  -----------
@@ -838,8 +837,10 @@ def init_ras_project(ras_project_folder, ras_version=None, ras_object=None):
838
837
  The version of RAS to use (e.g., "6.6").
839
838
  The version can also be a full path to the Ras.exe file.
840
839
  If None, the function will attempt to use the version from the global 'ras' object or a default path.
841
- ras_object : RasPrj, optional
842
- An instance of RasPrj to initialize. If None, the global 'ras' object is used.
840
+ ras_object : RasPrj or str, optional
841
+ If None, the global 'ras' object is updated.
842
+ If a RasPrj instance, that instance is updated.
843
+ If any other value is provided, a new RasPrj instance is created and returned.
843
844
 
844
845
  Returns:
845
846
  --------
@@ -852,16 +853,24 @@ def init_ras_project(ras_project_folder, ras_version=None, ras_object=None):
852
853
 
853
854
  ras_exe_path = get_ras_exe(ras_version)
854
855
 
856
+ # Determine which RasPrj instance to use
855
857
  if ras_object is None:
858
+ # Use the global 'ras' object
856
859
  logger.info("Initializing global 'ras' object via init_ras_project function.")
857
860
  ras_object = ras
858
861
  elif not isinstance(ras_object, RasPrj):
859
- logger.error("Provided ras_object is not an instance of RasPrj.")
860
- raise TypeError("ras_object must be an instance of RasPrj or None.")
862
+ # Create a new RasPrj instance
863
+ logger.info("Creating a new RasPrj instance.")
864
+ ras_object = RasPrj()
861
865
 
862
866
  # Initialize the RasPrj instance
863
867
  ras_object.initialize(ras_project_folder, ras_exe_path)
864
868
 
869
+ # Always update the global ras object as well
870
+ if ras_object is not ras:
871
+ ras.initialize(ras_project_folder, ras_exe_path)
872
+ logger.info("Global 'ras' object also updated to match the new project.")
873
+
865
874
  logger.info(f"Project initialized. ras_object project folder: {ras_object.project_folder}")
866
875
  return ras_object
867
876
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ras-commander
3
- Version: 0.57.0
3
+ Version: 0.59.0
4
4
  Summary: A Python library for automating HEC-RAS 6.x operations
5
5
  Home-page: https://github.com/gpt-cmdr/ras-commander
6
6
  Author: William M. Katzenmeyer, P.E., C.F.M.
@@ -34,27 +34,20 @@ Dynamic: summary
34
34
 
35
35
  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 was initially conceptualized in the Australian Water School course "AI Tools for Modelling Innovation", and subsequently expanded to cover the basic functionality of the HECRASController COM32 interface using open-source python libraries. This library uses a Test Driven Development strategy, leveraging the publicly-available HEC-RAS Example projects to create repeatable demonstration examples. The "Commmander" moniker is inspired by the "Command Line is All You Need" approach to HEC-RAS automation that was first implemented in the HEC-Commander Tools repository.
36
36
 
37
- ## Contributors:
38
- William Katzenmeyer, P.E., C.F.M.
37
+ ## Repository Author:
38
+ (William Katzenmeyer, P.E., C.F.M.)[https://engineeringwithllms.info]
39
39
 
40
- Sean Micek, P.E., C.F.M.
41
-
42
- Aaron Nichols, P.E., C.F.M.
43
-
44
- (Additional Contributors Here)
45
-
46
- ## Don't Ask Me, Ask ChatGPT!
40
+ ## Don't Ask Me, Ask GPT!
47
41
 
48
42
  This repository has several methods of interaction with Large Language Models and LLM-Assisted Coding built right in:
49
43
 
50
44
  1. **[RAS Commander Library Assistant GPT](https://chatgpt.com/g/g-TZRPR3oAO-ras-commander-library-assistant)**: A specialized GPT model with access to the ras-commander codebase and library, available for answering queries and providing code suggestions. You can even upload your own plan, unsteady and HDF files to inspect and help determine how to automate your workflows or visualize your results, although this ability is still limited by OpenAI's GPT frameworks and may not be useful for long conversations.
51
45
 
52
- 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. The repo's codebase (without documentation and examples) has been curated to stay within the current ~200k context window limitations of frontier models, and for tasks that do not need an understanding of the underlying code, the Comprehensive Library Guide and any relevant examples from the example folder should be adequate context for leveraging the ras-commander API to complete tasks.
46
+ 2. **[Purpose-Built Knowledge Base Summaries](https://github.com/gpt-cmdr/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. The repo's codebase (without documentation and examples) has been curated to stay within the current ~200k context window limitations of frontier models, and for tasks that do not need an understanding of the underlying code, the Comprehensive Library Guide and any relevant examples from the example folder should be adequate context for leveraging the ras-commander API to complete tasks.
53
47
 
54
- 3. **[Cursor IDE Integration](https://github.com/billk-FM/ras-commander/blob/main/.cursorrules)**: Custom rules(.cursorrules) for the Cursor IDE to provide context-aware suggestions and documentation. Just open the repository folder in Cursor to recognize these instructions. 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.
55
-
56
- 5. **[RAS-Commander Library Assistant](https://github.com/billk-FM/ras-commander/blob/main/library_assistant)**: A full-featured interface for multi-turn conversations, using your own API keys and the ras-commander library for context. The library assistant allows you to load your own scripts and chat with specific examples and/or function classes in the RAS-Commander library to effectively utilize the library's functions in your workflow. To reduce hallucinations, a file browser is included which adds full files to the conversation to ensure grounded responses. A dashboard shows you the total context and estimated cost of each request. **Now with support for OpenAI's o1 and o3-mini, and Deepseek V3 and R1 models using US-based Together.ai**
48
+ 3. **[Cursor IDE Integration](https://github.com/gpt-cmdr/ras-commander/blob/main/.cursorrules)**: Custom rules(.cursorrules) for the Cursor IDE to provide context-aware suggestions and documentation. Just open the repository folder in Cursor to recognize these instructions. 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.
57
49
 
50
+ 5. **[RAS-Commander Library Assistant](https://github.com/gpt-cmdr/ras-commander/blob/main/library_assistant)**: A full-featured interface for multi-turn conversations, using your own API keys and the ras-commander library for context. The library assistant allows you to load your own scripts and chat with specific examples and/or function classes in the RAS-Commander library to effectively utilize the library's functions in your workflow. To reduce hallucinations, a file browser is included which adds full files to the conversation to ensure grounded responses. A dashboard shows you the total context and estimated cost of each request. **Now with support for OpenAI's o1 and o3-mini, and Deepseek V3 and R1 models using US-based Together.ai**
58
51
 
59
52
  ## Background
60
53
  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.
@@ -71,8 +64,6 @@ HEC-RAS Project Management & Execution
71
64
  - Progress tracking and logging
72
65
  - Execution error handling and recovery
73
66
 
74
-
75
-
76
67
  HDF Data Access & Analysis
77
68
  - 2D mesh results processing (depths, velocities, WSE)
78
69
  - Cross-section data extraction
@@ -82,7 +73,6 @@ HDF Data Access & Analysis
82
73
  - Fluvial-pluvial boundary calculations
83
74
  - Infiltration and precipitation data handling
84
75
 
85
-
86
76
  RAS ASCII File Operations
87
77
  - Plan file creation and modification
88
78
  - Geometry file parsing examples
@@ -99,7 +89,6 @@ First, create a virtual environment with conda or venv (ask ChatGPT if you need
99
89
 
100
90
  In your virtual environment, install ras-commander using pip:
101
91
  ```
102
- pip install h5py numpy pandas requests tqdm scipy xarray geopandas matplotlib ipython tqdm psutil shapely fiona pathlib rtree rasterstats
103
92
  pip install --upgrade ras-commander
104
93
  ```
105
94
  If you have dependency issues with pip (especially if you have errors with numpy), try clearing your local pip packages 'C:\Users\your_username\AppData\Roaming\Python\' and then creating a new virtual environment.
@@ -124,10 +113,6 @@ except ImportError:
124
113
  ```
125
114
  It is highly suggested to fork this repository before going this route, and using Git to manage your changes! This allows any revisions to the ras-commander classes and functions to be actively edited and developed by end users. The folders "/workspace/, "/projects/", or "my_projects/" are included in the .gitignore, so users can place you custom scripts there for any project data they don't want to be tracked by git.
126
115
 
127
-
128
-
129
-
130
-
131
116
  ## Quick Start Guide
132
117
 
133
118
  ```
@@ -147,9 +132,9 @@ RasCmdr.compute_plan("01", dest_folder=r"/path/to/results", overwrite_dest=True)
147
132
  ### Execute plans in parallel
148
133
  ```
149
134
  results = RasCmdr.compute_parallel(
150
- plan_numbers=["01", "02"],
135
+ plan_number=["01", "02"],
151
136
  max_workers=2,
152
- cores_per_run=2,
137
+ num_cores=2,
153
138
  dest_folder=r"/path/to/results",
154
139
  overwrite_dest=True
155
140
  )
@@ -160,7 +145,62 @@ results = RasCmdr.compute_parallel(
160
145
  RasPlan.set_geom("01", "02")
161
146
  ```
162
147
 
163
- 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.
148
+ ### Execution Modes
149
+
150
+ RAS Commander provides three methods for executing HEC-RAS plans:
151
+
152
+ #### Single Plan Execution
153
+ ```python
154
+ # Execute a single plan
155
+ success = RasCmdr.compute_plan("01", dest_folder=r"/path/to/results")
156
+ print(f"Plan execution {'successful' if success else 'failed'}")
157
+ ```
158
+
159
+ #### Sequential Execution of Multiple Plans
160
+ ```python
161
+ # Execute multiple plans in sequence in a test folder
162
+ results = RasCmdr.compute_test_mode(
163
+ plan_number=["01", "02", "03"],
164
+ dest_folder_suffix="[Test]"
165
+ )
166
+ for plan, success in results.items():
167
+ print(f"Plan {plan}: {'Successful' if success else 'Failed'}")
168
+ ```
169
+
170
+ #### Parallel Execution of Multiple Plans
171
+ ```python
172
+ # Execute multiple plans concurrently
173
+ results = RasCmdr.compute_parallel(
174
+ plan_number=["01", "02", "03"],
175
+ max_workers=3,
176
+ num_cores=2
177
+ )
178
+ for plan, success in results.items():
179
+ print(f"Plan {plan}: {'Successful' if success else 'Failed'}")
180
+ ```
181
+
182
+ ### Working with Multiple Projects
183
+
184
+ RAS Commander allows working with multiple HEC-RAS projects simultaneously:
185
+
186
+ ```python
187
+ # Initialize multiple projects
188
+ project1 = init_ras_project(path1, "6.6")
189
+ project2 = init_ras_project(path2, "6.6")
190
+
191
+ # Perform operations on each project
192
+ RasCmdr.compute_plan("01", ras_object=project1, dest_folder=folder1)
193
+ RasCmdr.compute_plan("01", ras_object=project2, dest_folder=folder2)
194
+
195
+ # Compare results between projects
196
+ print(f"Project 1: {project1.project_name}")
197
+ print(f"Project 2: {project2.project_name}")
198
+
199
+ # Always specify the ras_object parameter when working with multiple projects
200
+ # to avoid confusion with the global 'ras' object
201
+ ```
202
+
203
+ This is useful for comparing different river systems, running scenario analyses across multiple watersheds, or managing a suite of related models.
164
204
 
165
205
  #### Key Components
166
206
 
@@ -190,8 +230,6 @@ Certainly! I'll provide you with an updated Key Components section and Project O
190
230
 
191
231
  ### Project Organization Diagram
192
232
 
193
- ### Project Organization Diagram
194
-
195
233
  ```
196
234
  ras_commander
197
235
  ├── ras_commander
@@ -222,24 +260,16 @@ ras_commander
222
260
  │ ├── HdfPlot.py
223
261
  │ └── HdfResultsPlot.py
224
262
  ├── examples
225
- │ ├── 01_project_initialization.py
226
- │ ├── 02_plan_operations.py
227
- │ ├── 03_geometry_operations.py
228
- │ ├── 04_unsteady_flow_operations.py
229
- │ ├── 05_utility_functions.py
230
- │ ├── 06_single_plan_execution.py
231
- │ ├── 07_sequential_plan_execution.py
232
- │ ├── 08_parallel_execution.py
233
- │ ├── 09_specifying_plans.py
234
- │ ├── 10_arguments_for_compute.py
235
- │ ├── 11_Using_RasExamples.ipynb
236
- │ ├── 12_plan_set_execution.py
237
- │ ├── 13_multiple_project_operations.py
238
- │ ├── 14_Core_Sensitivity.ipynb
239
- │ ├── 15_plan_key_operations.py
240
- │ ├── 16_scanning_ras_project_info.py
241
- │ ├── 17_parallel_execution_ble.py
242
- │ └── HEC_RAS_2D_HDF_Analysis.ipynb
263
+ │ ├── 00_Using_RasExamples.ipynb
264
+ │ ├── 01_project_initialization.ipynb
265
+ │ ├── 02_plan_and_geometry_operations.ipynb
266
+ │ ├── 03_unsteady_flow_operations.ipynb
267
+ │ ├── 04_multiple_project_operations.ipynb
268
+ │ ├── 05_single_plan_execution.ipynb
269
+ │ ├── 06_executing_plan_sets.ipynb
270
+ │ ├── 07_sequential_plan_execution.ipynb
271
+ │ ├── 08_parallel_execution.ipynb
272
+ │ └── 09_plan_parameter_operations.ipynb
243
273
  ├── tests
244
274
  │ └── ... (test files)
245
275
  ├── .gitignore
@@ -267,8 +297,6 @@ Example usage:
267
297
  from ras_commander import RasExamples
268
298
 
269
299
  ```
270
- ras_examples = RasExamples()
271
- ras_examples.get_example_projects() # Downloads example projects if not already present
272
300
  categories = ras_examples.list_categories()
273
301
  projects = ras_examples.list_projects("Steady Flow")
274
302
  extracted_paths = ras_examples.extract_project(["Bald Eagle Creek", "Muncie"])
@@ -321,7 +349,6 @@ print(runtime_data)
321
349
  ```
322
350
  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.
323
351
 
324
-
325
352
  #### Infrastructure Analysis
326
353
  ```python
327
354
  from ras_commander import HdfPipe, HdfPump
@@ -358,13 +385,33 @@ boundary = HdfFluvialPluvial.calculate_fluvial_pluvial_boundary(
358
385
  )
359
386
  ```
360
387
 
361
- ## Documentation
388
+ ## Examples
362
389
 
363
- For detailed usage instructions and API documentation, please refer to the [Comprehensive Library Guide](Comprehensive_Library_Guide.md).
390
+ Check out the examples in the repository to learn how to use RAS Commander:
364
391
 
365
- ## Examples
392
+ ### Project Setup
393
+ - `00_Using_RasExamples.ipynb`: Download and extract HEC-RAS example projects
394
+ - `01_project_initialization.ipynb`: Initialize HEC-RAS projects and explore their components
395
+
396
+ ### File Operations
397
+ - `02_plan_and_geometry_operations.ipynb`: Clone and modify plan and geometry files
398
+ - `03_unsteady_flow_operations.ipynb`: Extract and modify boundary conditions
399
+ - `09_plan_parameter_operations.ipynb`: Retrieve and update plan parameters
400
+
401
+ ### Execution Modes
402
+ - `05_single_plan_execution.ipynb`: Execute a single plan with specific options
403
+ - `06_executing_plan_sets.ipynb`: Different ways to specify and execute plan sets
404
+ - `07_sequential_plan_execution.ipynb`: Run multiple plans in sequence
405
+ - `08_parallel_execution.ipynb`: Run multiple plans in parallel
366
406
 
367
- Check out the `examples/` directory for sample scripts demonstrating various features of ras-commander.
407
+ ### Advanced Operations
408
+ - `04_multiple_project_operations.ipynb`: Work with multiple HEC-RAS projects simultaneously
409
+
410
+ These examples demonstrate practical applications of RAS Commander for automating HEC-RAS workflows, from basic operations to advanced scenarios.
411
+
412
+ ## Documentation
413
+
414
+ For detailed usage instructions and API documentation, please refer to the [Comprehensive Library Guide](Comprehensive_Library_Guide.md).
368
415
 
369
416
  ## Future Development
370
417
 
@@ -375,10 +422,9 @@ The ras-commander library is an ongoing project. Future plans include:
375
422
 
376
423
  ## Related Resources
377
424
 
378
- - [HEC-Commander Blog](https://github.com/billk-FM/HEC-Commander/tree/main/Blog)
425
+ - [HEC-Commander Blog](https://github.com/gpt-cmdr/HEC-Commander/tree/main/Blog)
379
426
  - [GPT-Commander YouTube Channel](https://www.youtube.com/@GPT_Commander)
380
- - [ChatGPT Examples for Water Resources Engineers](https://github.com/billk-FM/HEC-Commander/tree/main/ChatGPT%20Examples)
381
-
427
+ - [ChatGPT Examples for Water Resources Engineers](https://github.com/gpt-cmdr/HEC-Commander/tree/main/ChatGPT%20Examples)
382
428
 
383
429
  ## Contributing
384
430
 
@@ -415,8 +461,7 @@ These acknowledgments recognize the contributions and inspirations that have hel
415
461
 
416
462
  4. 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.
417
463
 
418
- 5. [HEC-Commander Tools](https://github.com/billk-FM/HEC-Commander) - Inspiration and initial code base for the development of RAS Commander.
419
-
464
+ 5. [HEC-Commander Tools](https://github.com/gpt-cmdr/HEC-Commander) - Inspiration and initial code base for the development of RAS Commander.
420
465
 
421
466
  ## Official RAS Commander AI-Generated Songs:
422
467
 
@@ -426,14 +471,13 @@ These acknowledgments recognize the contributions and inspirations that have hel
426
471
 
427
472
  ## Other Resources
428
473
 
429
- Notebook version of RAS-Commander: [RAS-Commander Notebook in the HEC-Commander Tools Repository](https://github.com/billk-FM/HEC-Commander/tree/main/RAS-Commander)
474
+ Notebook version of RAS-Commander: [RAS-Commander Notebook in the HEC-Commander Tools Repository](https://github.com/gpt-cmdr/HEC-Commander/tree/main/RAS-Commander)
430
475
  Youtube Tutorials for HEC-Commander Tools and RAS-Commander: [GPT-Commander on YouTube](https://www.youtube.com/@GPT_Commander/videos)
431
476
 
432
477
  ## LICENSE
433
478
 
434
479
  This software is released under the MIT license.
435
480
 
436
-
437
481
  ## Contact
438
482
 
439
483
  For questions, suggestions, or support, please contact:
@@ -28,7 +28,7 @@ class CustomBuildPy(build_py):
28
28
 
29
29
  setup(
30
30
  name="ras-commander",
31
- version="0.57.0",
31
+ version="0.59.0",
32
32
  packages=find_packages(),
33
33
  include_package_data=True,
34
34
  python_requires='>=3.10',
File without changes
File without changes