ras-commander 0.59.0__py3-none-any.whl → 0.61.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.
@@ -85,20 +85,24 @@ def standardize_input(file_type: str = 'plan_hdf'):
85
85
  if Path(hdf_input).is_file():
86
86
  hdf_path = Path(hdf_input)
87
87
  # Check if it's a number (with or without 'p' prefix)
88
- elif hdf_input.isdigit() or (len(hdf_input) == 3 and hdf_input[0] == 'p' and hdf_input[1:].isdigit()):
88
+ elif hdf_input.isdigit() or (len(hdf_input) > 1 and hdf_input[0] == 'p' and hdf_input[1:].isdigit()):
89
89
  try:
90
90
  ras_obj.check_initialized()
91
91
  except Exception as e:
92
92
  raise ValueError(f"RAS object is not initialized: {str(e)}")
93
93
 
94
- number = hdf_input if hdf_input.isdigit() else hdf_input[1:]
94
+ # Extract the numeric part and convert to integer for comparison
95
+ number_str = hdf_input if hdf_input.isdigit() else hdf_input[1:]
96
+ number_int = int(number_str)
95
97
 
96
98
  if file_type == 'plan_hdf':
97
- plan_info = ras_obj.plan_df[ras_obj.plan_df['plan_number'] == number]
99
+ # Convert plan_number column to integers for comparison
100
+ plan_info = ras_obj.plan_df[ras_obj.plan_df['plan_number'].astype(int) == number_int]
98
101
  if not plan_info.empty:
99
102
  hdf_path = Path(plan_info.iloc[0]['HDF_Results_Path'])
100
103
  elif file_type == 'geom_hdf':
101
- geom_info = ras_obj.geom_df[ras_obj.geom_df['geom_number'] == number]
104
+ # Convert geom_number column to integers for comparison
105
+ geom_info = ras_obj.geom_df[ras_obj.geom_df['geom_number'].astype(int) == number_int]
102
106
  if not geom_info.empty:
103
107
  hdf_path = Path(geom_info.iloc[0]['HDF_Path'])
104
108
  else:
@@ -110,14 +114,16 @@ def standardize_input(file_type: str = 'plan_hdf'):
110
114
  except Exception as e:
111
115
  raise ValueError(f"RAS object is not initialized: {str(e)}")
112
116
 
113
- number = f"{hdf_input:02d}"
117
+ number_int = hdf_input
114
118
 
115
119
  if file_type == 'plan_hdf':
116
- plan_info = ras_obj.plan_df[ras_obj.plan_df['plan_number'] == number]
120
+ # Convert plan_number column to integers for comparison
121
+ plan_info = ras_obj.plan_df[ras_obj.plan_df['plan_number'].astype(int) == number_int]
117
122
  if not plan_info.empty:
118
123
  hdf_path = Path(plan_info.iloc[0]['HDF_Results_Path'])
119
124
  elif file_type == 'geom_hdf':
120
- geom_info = ras_obj.geom_df[ras_obj.geom_df['geom_number'] == number]
125
+ # Convert geom_number column to integers for comparison
126
+ geom_info = ras_obj.geom_df[ras_obj.geom_df['geom_number'].astype(int) == number_int]
121
127
  if not geom_info.empty:
122
128
  hdf_path = Path(geom_info.iloc[0]['HDF_Path'])
123
129
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ras-commander
3
- Version: 0.59.0
3
+ Version: 0.61.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.
@@ -119,11 +119,43 @@ It is highly suggested to fork this repository before going this route, and usin
119
119
  from ras_commander import init_ras_project, RasCmdr, RasPlan
120
120
  ```
121
121
 
122
- ### Initialize a project
122
+ ### Initialize a project (single project)
123
123
  ```
124
124
  init_ras_project(r"/path/to/project", "6.5")
125
125
  ```
126
126
 
127
+ ### Initialize a project (multiple projects)
128
+ ```
129
+ your_ras_project = RasPrj()
130
+ init_ras_project(r"/path/to/project", "6.5", ras_object=your_ras_project)
131
+ ```
132
+
133
+ ## Accessing Plan, Unsteady and Boundary Conditions Dataframes
134
+ Using the default 'ras" object, othewise substitute your_ras_project for muli-project scripts
135
+ ```
136
+ print("\nPlan Files DataFrame:")
137
+ ras.plan_df
138
+
139
+ print("\nFlow Files DataFrame:")
140
+ ras.flow_df
141
+
142
+ print("\nUnsteady Flow Files DataFrame:")
143
+ ras.unsteady_df
144
+
145
+ print("\nGeometry Files DataFrame:")
146
+ ras.geom_df
147
+
148
+ print("\nHDF Entries DataFrame:")
149
+ ras.get_hdf_entries()
150
+
151
+ print("\nBoundary Conditions DataFrame:")
152
+ ras.boundaries_df
153
+
154
+ ```
155
+
156
+
157
+
158
+
127
159
  ### Execute a single plan
128
160
  ```
129
161
  RasCmdr.compute_plan("01", dest_folder=r"/path/to/results", overwrite_dest=True)
@@ -185,8 +217,10 @@ RAS Commander allows working with multiple HEC-RAS projects simultaneously:
185
217
 
186
218
  ```python
187
219
  # Initialize multiple projects
188
- project1 = init_ras_project(path1, "6.6")
189
- project2 = init_ras_project(path2, "6.6")
220
+ project1 = RasPrj()
221
+ init_ras_project(path1, "6.6", ras_object=project1)
222
+ project2 = RasPrj()
223
+ init_ras_project(path2, "6.6", ras_object=project2)
190
224
 
191
225
  # Perform operations on each project
192
226
  RasCmdr.compute_plan("01", ras_object=project1, dest_folder=folder1)
@@ -202,7 +236,7 @@ print(f"Project 2: {project2.project_name}")
202
236
 
203
237
  This is useful for comparing different river systems, running scenario analyses across multiple watersheds, or managing a suite of related models.
204
238
 
205
- #### Key Components
239
+ #### Core HEC-RAS Automation Classes
206
240
 
207
241
  - `RasPrj`: Manages HEC-RAS projects, handling initialization and data loading
208
242
  - `RasCmdr`: Handles execution of HEC-RAS simulations
@@ -212,7 +246,7 @@ This is useful for comparing different river systems, running scenario analyses
212
246
  - `RasUtils`: Contains utility functions for file operations and data management
213
247
  - `RasExamples`: Manages and loads HEC-RAS example projects
214
248
 
215
- #### New Components:
249
+ #### HDF Data Access Classes
216
250
  - `HdfBase`: Core functionality for HDF file operations
217
251
  - `HdfBndry`: Enhanced boundary condition handling
218
252
  - `HdfMesh`: Comprehensive mesh data management
@@ -224,8 +258,7 @@ This is useful for comparing different river systems, running scenario analyses
224
258
  - `HdfPipe`: Pipe network analysis tools
225
259
  - `HdfPump`: Pump station analysis capabilities
226
260
  - `HdfFluvialPluvial`: Fluvial-pluvial boundary analysis
227
- - `RasMapper`: RASMapper interface
228
- - `RasToGo`: Go-Consequences integration
261
+ - `RasMapper`: RASMapper Functions
229
262
  - `HdfPlot` & `HdfResultsPlot`: Specialized plotting utilities
230
263
 
231
264
  ### Project Organization Diagram
@@ -1,4 +1,4 @@
1
- ras_commander/Decorators.py,sha256=v0xPvIs3LbPlRJXvSHNtMFhygWEBo7f-0j_fCp7lXnQ,6030
1
+ ras_commander/Decorators.py,sha256=0UIYc-hzmBVS7tovSLMzDp2NIhwrZvOYNrQSvETxhEE,6538
2
2
  ras_commander/HdfBase.py,sha256=Jws6Y8JFkharuiM6Br5ivp6MS64X2fL6y87FOpe3FQw,14219
3
3
  ras_commander/HdfBndry.py,sha256=m81NdCu_ER-AAZpEkQPQka7pYv3sm7vEZevq3SIt2pw,12545
4
4
  ras_commander/HdfFluvialPluvial.py,sha256=dlqoFX5i7uSA2BvuRNrV-Fg-z2JaeUxY86_fbZAdGqI,25933
@@ -27,8 +27,8 @@ ras_commander/RasToGo.py,sha256=TKujfaV1xQhFaOddF4g2ogGy6ky-CLlfelSMPD2J3Nk,1223
27
27
  ras_commander/RasUnsteady.py,sha256=KfCXAag-_bPwwS3JbPZH-s4hbaoHACO0mlRnGrzbFgA,32092
28
28
  ras_commander/RasUtils.py,sha256=P2-aBL61kdRINsjnBpstZVD6VVc7hI_D3RUXqr6ldmc,34863
29
29
  ras_commander/__init__.py,sha256=mceEWRQJkDBi1o3zVg7DpG2qMrMnKHwwuK3GwyxoVr4,2132
30
- ras_commander-0.59.0.dist-info/LICENSE,sha256=_pbd6qHnlsz1iQ-ozDW_49r86BZT6CRwO2iBtw0iN6M,457
31
- ras_commander-0.59.0.dist-info/METADATA,sha256=Ai5tJpr_j9k8uO1SDIIz0WFLJu2QhAKesqh5ZB1mPWY,24307
32
- ras_commander-0.59.0.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
33
- ras_commander-0.59.0.dist-info/top_level.txt,sha256=i76S7eKLFC8doKcXDl3aiOr9RwT06G8adI6YuKbQDaA,14
34
- ras_commander-0.59.0.dist-info/RECORD,,
30
+ ras_commander-0.61.0.dist-info/LICENSE,sha256=_pbd6qHnlsz1iQ-ozDW_49r86BZT6CRwO2iBtw0iN6M,457
31
+ ras_commander-0.61.0.dist-info/METADATA,sha256=FmTSLA-khuKDSyKxmVQYa6jX0aADR1tKmtX9k2iTOhI,25045
32
+ ras_commander-0.61.0.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
33
+ ras_commander-0.61.0.dist-info/top_level.txt,sha256=i76S7eKLFC8doKcXDl3aiOr9RwT06G8adI6YuKbQDaA,14
34
+ ras_commander-0.61.0.dist-info/RECORD,,