ras-commander 0.68.0__py3-none-any.whl → 0.71.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.
- ras_commander/RasCmdr.py +189 -40
- ras_commander/RasGeo.py +257 -15
- ras_commander/RasPlan.py +41 -26
- ras_commander/RasPrj.py +224 -78
- ras_commander/RasUnsteady.py +162 -68
- ras_commander/__init__.py +1 -1
- {ras_commander-0.68.0.dist-info → ras_commander-0.71.0.dist-info}/METADATA +15 -5
- {ras_commander-0.68.0.dist-info → ras_commander-0.71.0.dist-info}/RECORD +11 -14
- {ras_commander-0.68.0.dist-info → ras_commander-0.71.0.dist-info}/WHEEL +1 -1
- ras_commander/RasGpt.py +0 -27
- ras_commander/RasMapper.py +0 -24
- ras_commander/RasToGo.py +0 -37
- {ras_commander-0.68.0.dist-info → ras_commander-0.71.0.dist-info/licenses}/LICENSE +0 -0
- {ras_commander-0.68.0.dist-info → ras_commander-0.71.0.dist-info}/top_level.txt +0 -0
ras_commander/RasUnsteady.py
CHANGED
@@ -61,30 +61,29 @@ class RasUnsteady:
|
|
61
61
|
@log_call
|
62
62
|
def update_flow_title(unsteady_file: str, new_title: str, ras_object: Optional[Any] = None) -> None:
|
63
63
|
"""
|
64
|
-
Update the Flow Title in an unsteady flow file.
|
65
|
-
|
64
|
+
Update the Flow Title in an unsteady flow file (.u*).
|
65
|
+
|
66
|
+
The Flow Title provides a descriptive identifier for unsteady flow scenarios in HEC-RAS.
|
67
|
+
It appears in the HEC-RAS interface and helps differentiate between different flow files.
|
68
|
+
|
66
69
|
Parameters:
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
70
|
+
unsteady_file (str): Path to the unsteady flow file or unsteady flow number
|
71
|
+
new_title (str): New flow title (max 24 characters, will be truncated if longer)
|
72
|
+
ras_object (optional): Custom RAS object to use instead of the global one
|
73
|
+
|
71
74
|
Returns:
|
72
|
-
|
75
|
+
None: The function modifies the file in-place and updates the ras object's unsteady dataframe
|
73
76
|
|
74
|
-
Note:
|
75
|
-
This function updates the ras object's unsteady dataframe after modifying the unsteady flow file.
|
76
|
-
|
77
77
|
Example:
|
78
|
-
|
78
|
+
# Clone an existing unsteady flow file
|
79
|
+
new_unsteady_number = RasPlan.clone_unsteady("02")
|
79
80
|
|
80
|
-
#
|
81
|
-
|
82
|
-
ras_cmdr.init_ras_project(project_folder, ras_version)
|
81
|
+
# Get path to the new unsteady flow file
|
82
|
+
new_unsteady_file = RasPlan.get_unsteady_path(new_unsteady_number)
|
83
83
|
|
84
|
-
# Update flow title
|
85
|
-
|
86
|
-
new_title
|
87
|
-
RasUnsteady.update_flow_title(unsteady_file, new_title, ras_object=ras_cmdr.ras)
|
84
|
+
# Update the flow title
|
85
|
+
new_title = "Modified Flow Scenario"
|
86
|
+
RasUnsteady.update_flow_title(new_unsteady_file, new_title)
|
88
87
|
"""
|
89
88
|
ras_obj = ras_object or ras
|
90
89
|
ras_obj.check_initialized()
|
@@ -134,30 +133,29 @@ class RasUnsteady:
|
|
134
133
|
@log_call
|
135
134
|
def update_restart_settings(unsteady_file: str, use_restart: bool, restart_filename: Optional[str] = None, ras_object: Optional[Any] = None) -> None:
|
136
135
|
"""
|
137
|
-
Update the
|
138
|
-
|
136
|
+
Update the restart file settings in an unsteady flow file.
|
137
|
+
|
138
|
+
Restart files in HEC-RAS allow simulations to continue from a previously saved state,
|
139
|
+
which is useful for long simulations or when making downstream changes.
|
140
|
+
|
139
141
|
Parameters:
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
142
|
+
unsteady_file (str): Path to the unsteady flow file
|
143
|
+
use_restart (bool): Whether to use a restart file (True) or not (False)
|
144
|
+
restart_filename (str, optional): Path to the restart file (.rst)
|
145
|
+
Required if use_restart is True
|
146
|
+
ras_object (optional): Custom RAS object to use instead of the global one
|
147
|
+
|
145
148
|
Returns:
|
146
|
-
|
149
|
+
None: The function modifies the file in-place and updates the ras object's unsteady dataframe
|
147
150
|
|
148
|
-
Note:
|
149
|
-
This function updates the ras object's unsteady dataframe after modifying the unsteady flow file.
|
150
|
-
|
151
151
|
Example:
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
unsteady_file = r"path/to/unsteady_file.u01"
|
160
|
-
RasUnsteady.update_restart_settings(unsteady_file, True, "restartfile.rst", ras_object=ras_cmdr.ras)
|
152
|
+
# Enable restart file for an unsteady flow
|
153
|
+
unsteady_file = RasPlan.get_unsteady_path("03")
|
154
|
+
RasUnsteady.update_restart_settings(
|
155
|
+
unsteady_file,
|
156
|
+
use_restart=True,
|
157
|
+
restart_filename="model_restart.rst"
|
158
|
+
)
|
161
159
|
"""
|
162
160
|
ras_obj = ras_object or ras
|
163
161
|
ras_obj.check_initialized()
|
@@ -219,8 +217,29 @@ class RasUnsteady:
|
|
219
217
|
@log_call
|
220
218
|
def extract_boundary_and_tables(unsteady_file: str, ras_object: Optional[Any] = None) -> pd.DataFrame:
|
221
219
|
"""
|
222
|
-
|
223
|
-
|
220
|
+
Extract boundary conditions and their associated tables from an unsteady flow file.
|
221
|
+
|
222
|
+
Boundary conditions in HEC-RAS define time-varying inputs like flow hydrographs,
|
223
|
+
stage hydrographs, gate operations, and lateral inflows. This function parses these
|
224
|
+
conditions and their data tables from the unsteady flow file.
|
225
|
+
|
226
|
+
Parameters:
|
227
|
+
unsteady_file (str): Path to the unsteady flow file
|
228
|
+
ras_object (optional): Custom RAS object to use instead of the global one
|
229
|
+
|
230
|
+
Returns:
|
231
|
+
pd.DataFrame: DataFrame containing boundary conditions with the following columns:
|
232
|
+
- River Name, Reach Name, River Station: Location information
|
233
|
+
- DSS File: Associated DSS file path if any
|
234
|
+
- Tables: Dictionary containing DataFrames of time-series values
|
235
|
+
|
236
|
+
Example:
|
237
|
+
# Get the path to unsteady flow file "02"
|
238
|
+
unsteady_file = RasPlan.get_unsteady_path("02")
|
239
|
+
|
240
|
+
# Extract boundary conditions and tables
|
241
|
+
boundaries_df = RasUnsteady.extract_boundary_and_tables(unsteady_file)
|
242
|
+
print(f"Extracted {len(boundaries_df)} boundary conditions from the file.")
|
224
243
|
"""
|
225
244
|
ras_obj = ras_object or ras
|
226
245
|
ras_obj.check_initialized()
|
@@ -363,10 +382,25 @@ class RasUnsteady:
|
|
363
382
|
@log_call
|
364
383
|
def print_boundaries_and_tables(boundaries_df: pd.DataFrame) -> None:
|
365
384
|
"""
|
366
|
-
|
367
|
-
|
385
|
+
Print boundary conditions and their associated tables in a formatted, readable way.
|
386
|
+
|
387
|
+
This function is useful for quickly visualizing the complex nested structure of
|
388
|
+
boundary conditions extracted by extract_boundary_and_tables().
|
389
|
+
|
368
390
|
Parameters:
|
369
|
-
|
391
|
+
boundaries_df (pd.DataFrame): DataFrame containing boundary information and
|
392
|
+
nested tables data from extract_boundary_and_tables()
|
393
|
+
|
394
|
+
Returns:
|
395
|
+
None: Output is printed to console
|
396
|
+
|
397
|
+
Example:
|
398
|
+
# Extract boundary conditions and tables
|
399
|
+
boundaries_df = RasUnsteady.extract_boundary_and_tables(unsteady_file)
|
400
|
+
|
401
|
+
# Print in a formatted way
|
402
|
+
print("Detailed boundary conditions and tables:")
|
403
|
+
RasUnsteady.print_boundaries_and_tables(boundaries_df)
|
370
404
|
"""
|
371
405
|
pd.set_option('display.max_columns', None)
|
372
406
|
pd.set_option('display.max_rows', None)
|
@@ -396,13 +430,28 @@ class RasUnsteady:
|
|
396
430
|
@log_call
|
397
431
|
def identify_tables(lines: List[str]) -> List[Tuple[str, int, int]]:
|
398
432
|
"""
|
399
|
-
Identify the start and end of
|
400
|
-
|
433
|
+
Identify the start and end line numbers of tables in an unsteady flow file.
|
434
|
+
|
435
|
+
HEC-RAS unsteady flow files contain numeric tables in a fixed-width format.
|
436
|
+
This function locates these tables within the file and provides their positions.
|
437
|
+
|
401
438
|
Parameters:
|
402
|
-
|
403
|
-
|
439
|
+
lines (List[str]): List of file lines (typically from file.readlines())
|
440
|
+
|
404
441
|
Returns:
|
405
|
-
|
442
|
+
List[Tuple[str, int, int]]: List of tuples where each tuple contains:
|
443
|
+
- table_name (str): The type of table (e.g., 'Flow Hydrograph=')
|
444
|
+
- start_line (int): Line number where the table data begins
|
445
|
+
- end_line (int): Line number where the table data ends
|
446
|
+
|
447
|
+
Example:
|
448
|
+
# Read the unsteady flow file
|
449
|
+
with open(new_unsteady_file, 'r') as f:
|
450
|
+
lines = f.readlines()
|
451
|
+
|
452
|
+
# Identify tables in the file
|
453
|
+
tables = RasUnsteady.identify_tables(lines)
|
454
|
+
print(f"Identified {len(tables)} tables in the unsteady flow file.")
|
406
455
|
"""
|
407
456
|
table_types = [
|
408
457
|
'Flow Hydrograph=',
|
@@ -437,15 +486,26 @@ class RasUnsteady:
|
|
437
486
|
@log_call
|
438
487
|
def parse_fixed_width_table(lines: List[str], start: int, end: int) -> pd.DataFrame:
|
439
488
|
"""
|
440
|
-
Parse a fixed-width table into a pandas DataFrame.
|
441
|
-
|
489
|
+
Parse a fixed-width table from an unsteady flow file into a pandas DataFrame.
|
490
|
+
|
491
|
+
HEC-RAS uses a fixed-width format (8 characters per value) for numeric tables.
|
492
|
+
This function converts this format into a DataFrame for easier manipulation.
|
493
|
+
|
442
494
|
Parameters:
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
495
|
+
lines (List[str]): List of file lines (from file.readlines())
|
496
|
+
start (int): Starting line number for table data
|
497
|
+
end (int): Ending line number for table data
|
498
|
+
|
447
499
|
Returns:
|
448
|
-
|
500
|
+
pd.DataFrame: DataFrame with a single column 'Value' containing the parsed numeric values
|
501
|
+
|
502
|
+
Example:
|
503
|
+
# Identify tables in the file
|
504
|
+
tables = RasUnsteady.identify_tables(lines)
|
505
|
+
|
506
|
+
# Parse a specific table (e.g., first flow hydrograph)
|
507
|
+
table_name, start_line, end_line = tables[0]
|
508
|
+
table_df = RasUnsteady.parse_fixed_width_table(lines, start_line, end_line)
|
449
509
|
"""
|
450
510
|
data = []
|
451
511
|
for line in lines[start:end]:
|
@@ -489,14 +549,30 @@ class RasUnsteady:
|
|
489
549
|
@log_call
|
490
550
|
def extract_tables(unsteady_file: str, ras_object: Optional[Any] = None) -> Dict[str, pd.DataFrame]:
|
491
551
|
"""
|
492
|
-
Extract all tables from
|
493
|
-
|
552
|
+
Extract all tables from an unsteady flow file and return them as DataFrames.
|
553
|
+
|
554
|
+
This function combines identify_tables() and parse_fixed_width_table() to extract
|
555
|
+
all tables from an unsteady flow file in a single operation.
|
556
|
+
|
494
557
|
Parameters:
|
495
|
-
|
496
|
-
|
497
|
-
|
558
|
+
unsteady_file (str): Path to the unsteady flow file
|
559
|
+
ras_object (optional): Custom RAS object to use instead of the global one
|
560
|
+
|
498
561
|
Returns:
|
499
|
-
|
562
|
+
Dict[str, pd.DataFrame]: Dictionary where:
|
563
|
+
- Keys are table names (e.g., 'Flow Hydrograph=')
|
564
|
+
- Values are DataFrames with a 'Value' column containing numeric data
|
565
|
+
|
566
|
+
Example:
|
567
|
+
# Extract all tables from the unsteady flow file
|
568
|
+
all_tables = RasUnsteady.extract_tables(new_unsteady_file)
|
569
|
+
print(f"Extracted {len(all_tables)} tables from the file.")
|
570
|
+
|
571
|
+
# Access a specific table
|
572
|
+
flow_tables = [name for name in all_tables.keys() if 'Flow Hydrograph=' in name]
|
573
|
+
if flow_tables:
|
574
|
+
flow_df = all_tables[flow_tables[0]]
|
575
|
+
print(f"Flow table has {len(flow_df)} values")
|
500
576
|
"""
|
501
577
|
ras_obj = ras_object or ras
|
502
578
|
ras_obj.check_initialized()
|
@@ -529,14 +605,32 @@ class RasUnsteady:
|
|
529
605
|
def write_table_to_file(unsteady_file: str, table_name: str, df: pd.DataFrame,
|
530
606
|
start_line: int, ras_object: Optional[Any] = None) -> None:
|
531
607
|
"""
|
532
|
-
Write updated table back to file in fixed-width format.
|
533
|
-
|
608
|
+
Write an updated table back to an unsteady flow file in the required fixed-width format.
|
609
|
+
|
610
|
+
This function takes a modified DataFrame and writes it back to the unsteady flow file,
|
611
|
+
preserving the 8-character fixed-width format that HEC-RAS requires.
|
612
|
+
|
534
613
|
Parameters:
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
614
|
+
unsteady_file (str): Path to the unsteady flow file
|
615
|
+
table_name (str): Name of the table to update (e.g., 'Flow Hydrograph=')
|
616
|
+
df (pd.DataFrame): DataFrame containing the updated values with a 'Value' column
|
617
|
+
start_line (int): Line number where the table data begins in the file
|
618
|
+
ras_object (optional): Custom RAS object to use instead of the global one
|
619
|
+
|
620
|
+
Returns:
|
621
|
+
None: The function modifies the file in-place
|
622
|
+
|
623
|
+
Example:
|
624
|
+
# Identify tables in the unsteady flow file
|
625
|
+
tables = RasUnsteady.identify_tables(lines)
|
626
|
+
table_name, start_line, end_line = tables[0]
|
627
|
+
|
628
|
+
# Parse and modify the table
|
629
|
+
table_df = RasUnsteady.parse_fixed_width_table(lines, start_line, end_line)
|
630
|
+
table_df['Value'] = table_df['Value'] * 0.75 # Scale values to 75%
|
631
|
+
|
632
|
+
# Write modified table back to the file
|
633
|
+
RasUnsteady.write_table_to_file(new_unsteady_file, table_name, table_df, start_line)
|
540
634
|
"""
|
541
635
|
ras_obj = ras_object or ras
|
542
636
|
ras_obj.check_initialized()
|
ras_commander/__init__.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: ras-commander
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.71.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.
|
@@ -26,13 +26,18 @@ Dynamic: author-email
|
|
26
26
|
Dynamic: description
|
27
27
|
Dynamic: description-content-type
|
28
28
|
Dynamic: home-page
|
29
|
+
Dynamic: license-file
|
29
30
|
Dynamic: requires-dist
|
30
31
|
Dynamic: requires-python
|
31
32
|
Dynamic: summary
|
32
33
|
|
33
34
|
# RAS Commander (ras-commander)
|
34
35
|
|
35
|
-
|
36
|
+
<p align="center">
|
37
|
+
<img src="ras-commander_logo.svg" width=70%>
|
38
|
+
</p>
|
39
|
+
|
40
|
+
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 much of 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
41
|
|
37
42
|
## Repository Author:
|
38
43
|
[William Katzenmeyer, P.E., C.F.M.](https://engineeringwithllms.info)
|
@@ -46,10 +51,15 @@ This repository has several methods of interaction with Large Language Models an
|
|
46
51
|
|
47
52
|
2. **[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.
|
48
53
|
|
49
|
-
3. **[RAS-Commander Library Assistant](https://github.com/gpt-cmdr/ras-commander/
|
54
|
+
3. **[RAS-Commander Library Assistant](https://github.com/gpt-cmdr/ras-commander/blob/main/ai_tools/library_assistant/REAME.md)**:
|
55
|
+
|
56
|
+
|
57
|
+
<img align="left" width="25%" hspace="40" src="ai_tools/library_assistant/ras-commander_library_assistant.svg">
|
58
|
+
|
59
|
+
The RAS-Commander library Assistant is 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 Claude 3.7, OpenAI's o1 and o3-mini, and Deepseek V3 and R1 models using US-based Together.ai, and available as a standalone windows executable that runs within the repository**
|
50
60
|
|
51
61
|
|
52
|
-
|
62
|
+
8. **[RAS Commander Library Assistant on ChatGPT](https://chatgpt.com/g/g-TZRPR3oAO-ras-commander-library-assistant)**: A specialized ChatGPT "GPT" 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. _NOTE: GPT's are still quite limited by OpenAI's GPT frameworks and may not be useful for long conversations. Code interpreter cannot run HEC-RAS but can open and view smaller HDF files and projects for demonstration purposes_
|
53
63
|
|
54
64
|
|
55
65
|
## Background
|
@@ -16,19 +16,16 @@ ras_commander/HdfStruc.py,sha256=SznjPvBWiqNVtviZvfCdjB_iwZF4UXxlIxITD8kwjP4,137
|
|
16
16
|
ras_commander/HdfUtils.py,sha256=VkIKAXBrLwTlk2VtXSO-W3RU-NHpfHbE1QcZUZgl-t8,15248
|
17
17
|
ras_commander/HdfXsec.py,sha256=flREnFFrIZu4SSKGRQeX9w3SS49q0UWPJnq4zO7DbUM,27342
|
18
18
|
ras_commander/LoggingConfig.py,sha256=gWe5K5XTmMQpSczsTysAqpC9my24i_IyM8dvD85fxYg,2704
|
19
|
-
ras_commander/RasCmdr.py,sha256=
|
19
|
+
ras_commander/RasCmdr.py,sha256=37GnchoQ0fIAkPnssnCr1mRUXY8gm-hIMTmuHZlnYP8,34591
|
20
20
|
ras_commander/RasExamples.py,sha256=6IZ96LcAsk5LYFehdD0zDW5wyZWxQa6OQu2N9upxWXA,17536
|
21
|
-
ras_commander/RasGeo.py,sha256=
|
22
|
-
ras_commander/
|
23
|
-
ras_commander/
|
24
|
-
ras_commander/
|
25
|
-
ras_commander/RasPrj.py,sha256=uJ8jHq_Y5-ZnQW6nWhTuHFfaDGuMrJo1HQRvd1QwINQ,50228
|
26
|
-
ras_commander/RasToGo.py,sha256=TKujfaV1xQhFaOddF4g2ogGy6ky-CLlfelSMPD2J3Nk,1223
|
27
|
-
ras_commander/RasUnsteady.py,sha256=KfCXAag-_bPwwS3JbPZH-s4hbaoHACO0mlRnGrzbFgA,32092
|
21
|
+
ras_commander/RasGeo.py,sha256=Fi1APh3G6Q1FmX3H3Pc-oL_TD3Q6T8HeqN1jl31V39I,17427
|
22
|
+
ras_commander/RasPlan.py,sha256=7cgwsKjD40ZSj9uOnsHd-OfmBJFxkS2xFhWmlHQflak,62179
|
23
|
+
ras_commander/RasPrj.py,sha256=IFy5CAQdZAQtqAnKQUFUqsDx8WQtYGXiRTG9IErBUE8,56457
|
24
|
+
ras_commander/RasUnsteady.py,sha256=TO08CT2GC4G5rcXO_Wbia2t4PhiWRu9-nC9F0IW7Gyo,37187
|
28
25
|
ras_commander/RasUtils.py,sha256=0fm4IIs0LH1dgDj3pGd66mR82DhWLEkRKUvIo2M_5X0,35886
|
29
|
-
ras_commander/__init__.py,sha256=
|
30
|
-
ras_commander-0.
|
31
|
-
ras_commander-0.
|
32
|
-
ras_commander-0.
|
33
|
-
ras_commander-0.
|
34
|
-
ras_commander-0.
|
26
|
+
ras_commander/__init__.py,sha256=KI_tROSOPwLR6JNKttQZHfvcTD0m-5zXAbd35c0Knrs,2001
|
27
|
+
ras_commander-0.71.0.dist-info/licenses/LICENSE,sha256=_pbd6qHnlsz1iQ-ozDW_49r86BZT6CRwO2iBtw0iN6M,457
|
28
|
+
ras_commander-0.71.0.dist-info/METADATA,sha256=nhua8P2v_aWC8BmNnLMC6PqHNSBNoHSu5CP_QiRxrHs,26588
|
29
|
+
ras_commander-0.71.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
30
|
+
ras_commander-0.71.0.dist-info/top_level.txt,sha256=i76S7eKLFC8doKcXDl3aiOr9RwT06G8adI6YuKbQDaA,14
|
31
|
+
ras_commander-0.71.0.dist-info/RECORD,,
|
ras_commander/RasGpt.py
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
from pathlib import Path
|
3
|
-
from typing import Optional
|
4
|
-
from ras_commander import get_logger, log_call
|
5
|
-
|
6
|
-
logger = get_logger(__name__)
|
7
|
-
|
8
|
-
class RasGpt:
|
9
|
-
"""
|
10
|
-
A class containing helper functions for the RAS Commander GPT.
|
11
|
-
"""
|
12
|
-
|
13
|
-
# to be implemented later
|
14
|
-
#
|
15
|
-
# This class will contain methods to help LLM's extract useful information from HEC-RAS models in a structured format with token budget etc.
|
16
|
-
# Templates will be used to help with this, based on the example projects (1D Steady, 1D Usteady, 1D Sediment Transport, 1D Water Quality, 2D Unsteady, 2D Steady, 2D Sediment Transport, 2D Water Quality, 2D Geospatial, 3D Unsteady, 3D Steady, 3D Sediment Transport, 3D Water Quality, 3D Geospatial).
|
17
|
-
# These will simply filter the data to only include the relevant information for the area of focus.
|
18
|
-
|
19
|
-
#
|
20
|
-
# IDEAS
|
21
|
-
# 1. Package up a standard set of information for LLM analysis
|
22
|
-
# - General project information
|
23
|
-
# - Cross section information (for specific cross sections)
|
24
|
-
# - Structure information (for specific structures)
|
25
|
-
# - Include time series results and relevant HEC Guidance for LLM to reference
|
26
|
-
|
27
|
-
# 2. Use Library Assistant to call LLM
|
ras_commander/RasMapper.py
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Class: RasMapper
|
3
|
-
|
4
|
-
List of Functions:
|
5
|
-
get_raster_map(hdf_path: Path)
|
6
|
-
clip_raster_with_boundary(raster_path: Path, boundary_path: Path)
|
7
|
-
calculate_zonal_stats(boundary_path: Path, raster_data, transform, nodata)
|
8
|
-
|
9
|
-
"""
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
from pathlib import Path
|
14
|
-
import pandas as pd
|
15
|
-
import geopandas as gpd
|
16
|
-
import rasterio
|
17
|
-
from rasterio.mask import mask
|
18
|
-
import h5py
|
19
|
-
from .Decorators import log_call, standardize_input
|
20
|
-
from .HdfInfiltration import HdfInfiltration
|
21
|
-
|
22
|
-
class RasMapper:
|
23
|
-
"""Class for handling RAS Mapper operations and data extraction"""
|
24
|
-
# PLACEHOLDER FOR FUTURE DEVELOPMENT
|
ras_commander/RasToGo.py
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
RasToGo module provides functions to interface HEC-RAS with go-consequences.
|
3
|
-
This module helps prepare and format RAS data for use with go-consequences.
|
4
|
-
|
5
|
-
|
6
|
-
-----
|
7
|
-
|
8
|
-
All of the methods in this class are static and are designed to be used without instantiation.
|
9
|
-
|
10
|
-
List of Functions in RasToGo:
|
11
|
-
|
12
|
-
TO BE IMPLEMENTED:
|
13
|
-
- Adding stored maps in rasmaapper for a results file
|
14
|
-
- Editing the terrain name for stored maps, so that a reduced resolution terrain can be used for mapping
|
15
|
-
- Re-computing specific plans using the floodplain mapping option to generate stored maps
|
16
|
-
- Using the stored map output to call go-consequences and compute damages
|
17
|
-
- Comparisons of go-consequences outputs based on RAS plan number
|
18
|
-
- include optional argument with polygons defining areas of interest
|
19
|
-
|
20
|
-
"""
|
21
|
-
|
22
|
-
import logging
|
23
|
-
from pathlib import Path
|
24
|
-
from typing import Dict, List, Optional, Any, Tuple, Union
|
25
|
-
import pandas as pd
|
26
|
-
import numpy as np
|
27
|
-
|
28
|
-
from .Decorators import log_call, standardize_input
|
29
|
-
from .LoggingConfig import setup_logging, get_logger
|
30
|
-
|
31
|
-
logger = get_logger(__name__)
|
32
|
-
|
33
|
-
class RasToGo:
|
34
|
-
"""Class containing functions to interface HEC-RAS with go-consequences."""
|
35
|
-
|
36
|
-
#@staticmethod
|
37
|
-
#@log_call
|
File without changes
|
File without changes
|