ras-commander 0.33.0__py3-none-any.whl → 0.35.0__py3-none-any.whl

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.
@@ -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,15 @@
1
+ ras_commander/RasCmdr.py,sha256=fX_rh_IcBuJYEbGXfUc7Fge6cdJAAGKN_V5sGZgIJT4,24447
2
+ ras_commander/RasExamples.py,sha256=VgjBcB56u5gzzzYzz0YXj5rKWk3u7oRoja97_3ArJHc,24127
3
+ ras_commander/RasGeo.py,sha256=6DO5utVBjkIhqJ_WYQSeU4i74Bv_pZO3pmWdVf-jj3U,5137
4
+ ras_commander/RasHdf.py,sha256=z5PZDZ44jS6dYNc1AdDyVqt2YqaMGulR72yBLQYoIeI,83927
5
+ ras_commander/RasPlan.py,sha256=Aa3qhPA8EvEEfSSibeQq2UYawU5kMRCJOgonjBwn8uU,53718
6
+ ras_commander/RasPrj.py,sha256=246bvWbjRCEt-4L1sMovCyNmPWQ6t2uGHkecs9Nro4E,30594
7
+ ras_commander/RasUnsteady.py,sha256=jgV3gqGFsIMV0c9eFaXjVM5pqAb82Du_7ObiIPnemJs,4077
8
+ ras_commander/RasUtils.py,sha256=ESsjQNjPsojZ8SINnMbMZDDWeyBqF6owaPV8brtS3S8,24435
9
+ ras_commander/__init__.py,sha256=7H3JDR5VmTo6P0fJFJe9mTozMWp-owrrHjy7lADVA6Q,1167
10
+ ras_commander/_version.py,sha256=BReLomJ164W3bJhfQJi0gbNKc3DXCzwusmCheUzClB8,478
11
+ ras_commander-0.35.0.dist-info/LICENSE,sha256=_pbd6qHnlsz1iQ-ozDW_49r86BZT6CRwO2iBtw0iN6M,457
12
+ ras_commander-0.35.0.dist-info/METADATA,sha256=k4I3IpZXFOHaMK0Y9CUPuaZ8IlGjBLF5ot4dElRytOQ,15325
13
+ ras_commander-0.35.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
14
+ ras_commander-0.35.0.dist-info/top_level.txt,sha256=i76S7eKLFC8doKcXDl3aiOr9RwT06G8adI6YuKbQDaA,14
15
+ ras_commander-0.35.0.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: ras-commander
3
- Version: 0.33.0
4
- License-File: LICENSE
5
-
@@ -1,14 +0,0 @@
1
- ras_commander/RasCmdr.py,sha256=ue-9RAZnv_qRvYnn6gxN0wthuYOuHuviNYxwcfkcCfE,22047
2
- ras_commander/RasExamples.py,sha256=usNS8FNgNS2VxbUiQvRB77SC-1E7qw6pLk0Hr3pv80Y,13852
3
- ras_commander/RasGeo.py,sha256=rQQZQEc8zn-Sur3KGcHn8Sif38eNzl5fsM3VXH_mUAI,4021
4
- ras_commander/RasPlan.py,sha256=H0JrMsukn-qWZO0xgOkQpfQ3HtUeh0w7MwJpReDI6iw,53055
5
- ras_commander/RasPrj.py,sha256=5RLj4jP1JYWZS-aTAxubz7_81rZV4Ie7yKO_LGC3YzI,15557
6
- ras_commander/RasUnsteady.py,sha256=lyX_L7HD-Z1QnM-f-248a_rDvRPVlKERdsP7cdgYFqA,2995
7
- ras_commander/RasUtils.py,sha256=HZK5n_6eK8hC_BPqB6u3nu1smmFQ95ft7oPJ9wNltVI,12054
8
- ras_commander/__init__.py,sha256=uY-IIzmE36WvC1IwQR1OSvll0SY7COcb7rhVw6uvuoA,1050
9
- ras_commander/_version.py,sha256=BReLomJ164W3bJhfQJi0gbNKc3DXCzwusmCheUzClB8,478
10
- ras_commander-0.33.0.dist-info/LICENSE,sha256=_pbd6qHnlsz1iQ-ozDW_49r86BZT6CRwO2iBtw0iN6M,457
11
- ras_commander-0.33.0.dist-info/METADATA,sha256=nuqhc4qkPQZ07RoyYMN6-TlrR4FjDbYQu5HW3lJQrZY,86
12
- ras_commander-0.33.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
13
- ras_commander-0.33.0.dist-info/top_level.txt,sha256=i76S7eKLFC8doKcXDl3aiOr9RwT06G8adI6YuKbQDaA,14
14
- ras_commander-0.33.0.dist-info/RECORD,,