ras-commander 0.72.0__tar.gz → 0.74.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.
- {ras_commander-0.72.0/ras_commander.egg-info → ras_commander-0.74.0}/PKG-INFO +21 -2
- {ras_commander-0.72.0 → ras_commander-0.74.0}/README.md +20 -1
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/Decorators.py +68 -17
- ras_commander-0.74.0/ras_commander/HdfInfiltration.py +1530 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfPlan.py +8 -4
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfResultsMesh.py +245 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/RasGeo.py +537 -523
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/RasPlan.py +46 -12
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/__init__.py +3 -2
- {ras_commander-0.72.0 → ras_commander-0.74.0/ras_commander.egg-info}/PKG-INFO +21 -2
- {ras_commander-0.72.0 → ras_commander-0.74.0}/setup.py +1 -1
- ras_commander-0.72.0/ras_commander/HdfInfiltration.py +0 -696
- {ras_commander-0.72.0 → ras_commander-0.74.0}/LICENSE +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/pyproject.toml +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfBase.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfBndry.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfFluvialPluvial.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfMesh.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfPipe.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfPlot.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfPump.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfResultsPlan.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfResultsPlot.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfResultsXsec.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfStruc.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfUtils.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/HdfXsec.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/LoggingConfig.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/RasCmdr.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/RasExamples.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/RasMap.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/RasPrj.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/RasUnsteady.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander/RasUtils.py +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander.egg-info/SOURCES.txt +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander.egg-info/dependency_links.txt +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander.egg-info/requires.txt +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/ras_commander.egg-info/top_level.txt +0 -0
- {ras_commander-0.72.0 → ras_commander-0.74.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ras-commander
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.74.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.
|
@@ -85,6 +85,25 @@ HDF Data Access & Analysis
|
|
85
85
|
- Pipe network and pump station analysis
|
86
86
|
- Fluvial-pluvial boundary calculations
|
87
87
|
- Infiltration and precipitation data handling
|
88
|
+
- Infiltration and soil data handling
|
89
|
+
- Land cover and terrain data integration
|
90
|
+
- Weighted parameter calculations for hydrologic modeling
|
91
|
+
|
92
|
+
RASMapper Data Integration
|
93
|
+
- RASMapper configuration parsing (.rasmap files)
|
94
|
+
- Terrain, soil, and land cover HDF paths
|
95
|
+
- Profile line paths
|
96
|
+
|
97
|
+
Manning's n Coefficient Management
|
98
|
+
- Base Manning's n table extraction and modification
|
99
|
+
- Regional overrides for spatially-varied roughness
|
100
|
+
- Direct editing of geometry file Manning values
|
101
|
+
|
102
|
+
Infiltration & Soil Analysis
|
103
|
+
- Soil statistics calculation and analysis
|
104
|
+
- Infiltration parameter management and scaling
|
105
|
+
- Weighted average parameter calculation
|
106
|
+
- Raster-based soil data processing
|
88
107
|
|
89
108
|
RAS ASCII File Operations
|
90
109
|
- Plan file creation and modification
|
@@ -266,6 +285,7 @@ This is useful for comparing different river systems, running scenario analyses
|
|
266
285
|
- `RasGeo`: Handles operations related to geometry files
|
267
286
|
- `RasUnsteady`: Manages unsteady flow file operations
|
268
287
|
- `RasUtils`: Contains utility functions for file operations and data management
|
288
|
+
- `RasMap`: Parses and manages RASMapper configuration data
|
269
289
|
- `RasExamples`: Manages and loads HEC-RAS example projects
|
270
290
|
|
271
291
|
#### HDF Data Access Classes
|
@@ -280,7 +300,6 @@ This is useful for comparing different river systems, running scenario analyses
|
|
280
300
|
- `HdfPipe`: Pipe network analysis tools
|
281
301
|
- `HdfPump`: Pump station analysis capabilities
|
282
302
|
- `HdfFluvialPluvial`: Fluvial-pluvial boundary analysis
|
283
|
-
- `RasMapper`: RASMapper Functions
|
284
303
|
- `HdfPlot` & `HdfResultsPlot`: Specialized plotting utilities
|
285
304
|
|
286
305
|
### Project Organization Diagram
|
@@ -52,6 +52,25 @@ HDF Data Access & Analysis
|
|
52
52
|
- Pipe network and pump station analysis
|
53
53
|
- Fluvial-pluvial boundary calculations
|
54
54
|
- Infiltration and precipitation data handling
|
55
|
+
- Infiltration and soil data handling
|
56
|
+
- Land cover and terrain data integration
|
57
|
+
- Weighted parameter calculations for hydrologic modeling
|
58
|
+
|
59
|
+
RASMapper Data Integration
|
60
|
+
- RASMapper configuration parsing (.rasmap files)
|
61
|
+
- Terrain, soil, and land cover HDF paths
|
62
|
+
- Profile line paths
|
63
|
+
|
64
|
+
Manning's n Coefficient Management
|
65
|
+
- Base Manning's n table extraction and modification
|
66
|
+
- Regional overrides for spatially-varied roughness
|
67
|
+
- Direct editing of geometry file Manning values
|
68
|
+
|
69
|
+
Infiltration & Soil Analysis
|
70
|
+
- Soil statistics calculation and analysis
|
71
|
+
- Infiltration parameter management and scaling
|
72
|
+
- Weighted average parameter calculation
|
73
|
+
- Raster-based soil data processing
|
55
74
|
|
56
75
|
RAS ASCII File Operations
|
57
76
|
- Plan file creation and modification
|
@@ -233,6 +252,7 @@ This is useful for comparing different river systems, running scenario analyses
|
|
233
252
|
- `RasGeo`: Handles operations related to geometry files
|
234
253
|
- `RasUnsteady`: Manages unsteady flow file operations
|
235
254
|
- `RasUtils`: Contains utility functions for file operations and data management
|
255
|
+
- `RasMap`: Parses and manages RASMapper configuration data
|
236
256
|
- `RasExamples`: Manages and loads HEC-RAS example projects
|
237
257
|
|
238
258
|
#### HDF Data Access Classes
|
@@ -247,7 +267,6 @@ This is useful for comparing different river systems, running scenario analyses
|
|
247
267
|
- `HdfPipe`: Pipe network analysis tools
|
248
268
|
- `HdfPump`: Pump station analysis capabilities
|
249
269
|
- `HdfFluvialPluvial`: Fluvial-pluvial boundary analysis
|
250
|
-
- `RasMapper`: RASMapper Functions
|
251
270
|
- `HdfPlot` & `HdfResultsPlot`: Specialized plotting utilities
|
252
271
|
|
253
272
|
### Project Organization Diagram
|
@@ -110,13 +110,17 @@ def standardize_input(file_type: str = 'plan_hdf'):
|
|
110
110
|
except Exception as e:
|
111
111
|
raise ValueError(f"RAS object is not initialized: {str(e)}")
|
112
112
|
|
113
|
+
# Extract the number part and strip leading zeros
|
113
114
|
number_str = hdf_input if hdf_input.isdigit() else hdf_input[1:]
|
114
|
-
|
115
|
+
stripped_number = number_str.lstrip('0')
|
116
|
+
if stripped_number == '': # Handle case where input was '0' or '00'
|
117
|
+
stripped_number = '0'
|
118
|
+
number_int = int(stripped_number)
|
115
119
|
|
116
120
|
if file_type == 'plan_hdf':
|
117
121
|
try:
|
118
|
-
# Convert plan_number column to integers for comparison
|
119
|
-
plan_info = ras_obj.plan_df[ras_obj.plan_df['plan_number'].astype(int) == number_int]
|
122
|
+
# Convert plan_number column to integers for comparison after stripping zeros
|
123
|
+
plan_info = ras_obj.plan_df[ras_obj.plan_df['plan_number'].str.lstrip('0').astype(int) == number_int]
|
120
124
|
if not plan_info.empty:
|
121
125
|
# Make sure HDF_Results_Path is a string and not None
|
122
126
|
hdf_path_str = plan_info.iloc[0]['HDF_Results_Path']
|
@@ -128,12 +132,35 @@ def standardize_input(file_type: str = 'plan_hdf'):
|
|
128
132
|
|
129
133
|
elif file_type == 'geom_hdf':
|
130
134
|
try:
|
131
|
-
#
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
135
|
+
# First try to get the geometry number from the plan
|
136
|
+
from ras_commander import RasPlan
|
137
|
+
plan_info = ras_obj.plan_df[ras_obj.plan_df['plan_number'].astype(int) == number_int]
|
138
|
+
if not plan_info.empty:
|
139
|
+
# Extract the geometry number from the plan
|
140
|
+
geom_number = plan_info.iloc[0]['geometry_number']
|
141
|
+
if pd.notna(geom_number) and geom_number is not None:
|
142
|
+
# Handle different types of geom_number (string or int)
|
143
|
+
try:
|
144
|
+
# Get the geometry path using RasPlan
|
145
|
+
geom_path = RasPlan.get_geom_path(str(geom_number), ras_obj)
|
146
|
+
|
147
|
+
if geom_path is not None:
|
148
|
+
# Create the HDF path by adding .hdf to the geometry path
|
149
|
+
hdf_path = Path(str(geom_path) + ".hdf")
|
150
|
+
if hdf_path.exists():
|
151
|
+
logger.info(f"Found geometry HDF file for plan {number_int}: {hdf_path}")
|
152
|
+
else:
|
153
|
+
# Try to find it in the geom_df if direct path doesn't exist
|
154
|
+
geom_info = ras_obj.geom_df[ras_obj.geom_df['full_path'] == str(geom_path)]
|
155
|
+
if not geom_info.empty and 'hdf_path' in geom_info.columns:
|
156
|
+
hdf_path_str = geom_info.iloc[0]['hdf_path']
|
157
|
+
if pd.notna(hdf_path_str):
|
158
|
+
hdf_path = Path(str(hdf_path_str))
|
159
|
+
logger.info(f"Found geometry HDF file from geom_df for plan {number_int}: {hdf_path}")
|
160
|
+
except (TypeError, ValueError) as e:
|
161
|
+
logger.warning(f"Error processing geometry number {geom_number}: {str(e)}")
|
162
|
+
else:
|
163
|
+
logger.warning(f"No valid geometry number found for plan {number_int}")
|
137
164
|
except Exception as e:
|
138
165
|
logger.warning(f"Error retrieving geometry HDF path: {str(e)}")
|
139
166
|
else:
|
@@ -153,8 +180,8 @@ def standardize_input(file_type: str = 'plan_hdf'):
|
|
153
180
|
|
154
181
|
if file_type == 'plan_hdf':
|
155
182
|
try:
|
156
|
-
# Convert plan_number column to integers for comparison
|
157
|
-
plan_info = ras_obj.plan_df[ras_obj.plan_df['plan_number'].astype(int) == number_int]
|
183
|
+
# Convert plan_number column to integers for comparison after stripping zeros
|
184
|
+
plan_info = ras_obj.plan_df[ras_obj.plan_df['plan_number'].str.lstrip('0').astype(int) == number_int]
|
158
185
|
if not plan_info.empty:
|
159
186
|
# Make sure HDF_Results_Path is a string and not None
|
160
187
|
hdf_path_str = plan_info.iloc[0]['HDF_Results_Path']
|
@@ -162,14 +189,38 @@ def standardize_input(file_type: str = 'plan_hdf'):
|
|
162
189
|
hdf_path = Path(str(hdf_path_str))
|
163
190
|
except Exception as e:
|
164
191
|
logger.warning(f"Error retrieving plan HDF path: {str(e)}")
|
192
|
+
|
165
193
|
elif file_type == 'geom_hdf':
|
166
194
|
try:
|
167
|
-
#
|
168
|
-
|
169
|
-
if not
|
170
|
-
|
171
|
-
|
172
|
-
|
195
|
+
# First try finding plan info to get geometry number
|
196
|
+
plan_info = ras_obj.plan_df[ras_obj.plan_df['plan_number'].astype(int) == number_int]
|
197
|
+
if not plan_info.empty:
|
198
|
+
# Extract the geometry number from the plan
|
199
|
+
geom_number = plan_info.iloc[0]['geometry_number']
|
200
|
+
if pd.notna(geom_number) and geom_number is not None:
|
201
|
+
# Handle different types of geom_number (string or int)
|
202
|
+
try:
|
203
|
+
# Get the geometry path using RasPlan
|
204
|
+
from ras_commander import RasPlan
|
205
|
+
geom_path = RasPlan.get_geom_path(str(geom_number), ras_obj)
|
206
|
+
|
207
|
+
if geom_path is not None:
|
208
|
+
# Create the HDF path by adding .hdf to the geometry path
|
209
|
+
hdf_path = Path(str(geom_path) + ".hdf")
|
210
|
+
if hdf_path.exists():
|
211
|
+
logger.info(f"Found geometry HDF file for plan {number_int}: {hdf_path}")
|
212
|
+
else:
|
213
|
+
# Try to find it in the geom_df if direct path doesn't exist
|
214
|
+
geom_info = ras_obj.geom_df[ras_obj.geom_df['full_path'] == str(geom_path)]
|
215
|
+
if not geom_info.empty and 'hdf_path' in geom_info.columns:
|
216
|
+
hdf_path_str = geom_info.iloc[0]['hdf_path']
|
217
|
+
if pd.notna(hdf_path_str):
|
218
|
+
hdf_path = Path(str(hdf_path_str))
|
219
|
+
logger.info(f"Found geometry HDF file from geom_df for plan {number_int}: {hdf_path}")
|
220
|
+
except (TypeError, ValueError) as e:
|
221
|
+
logger.warning(f"Error processing geometry number {geom_number}: {str(e)}")
|
222
|
+
else:
|
223
|
+
logger.warning(f"No valid geometry number found for plan {number_int}")
|
173
224
|
except Exception as e:
|
174
225
|
logger.warning(f"Error retrieving geometry HDF path: {str(e)}")
|
175
226
|
else:
|