ras-commander 0.46.0__tar.gz → 0.47.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.46.0/ras_commander.egg-info → ras_commander-0.47.0}/PKG-INFO +2 -2
- {ras_commander-0.46.0 → ras_commander-0.47.0}/README.md +1 -1
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfBndry.py +9 -9
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfMesh.py +18 -19
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/RasPrj.py +2 -7
- {ras_commander-0.46.0 → ras_commander-0.47.0/ras_commander.egg-info}/PKG-INFO +2 -2
- {ras_commander-0.46.0 → ras_commander-0.47.0}/setup.py +1 -1
- {ras_commander-0.46.0 → ras_commander-0.47.0}/LICENSE +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/pyproject.toml +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/Decorators.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfBase.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfFluvialPluvial.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfPipe.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfPlan.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfPump.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfResultsMesh.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfResultsPlan.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfResultsXsec.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfStruc.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfUtils.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/HdfXsec.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/LoggingConfig.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/RasCmdr.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/RasExamples.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/RasGeo.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/RasGpt.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/RasPlan.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/RasToGo.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/RasUnsteady.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/RasUtils.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander/__init__.py +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander.egg-info/SOURCES.txt +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander.egg-info/dependency_links.txt +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/ras_commander.egg-info/top_level.txt +0 -0
- {ras_commander-0.46.0 → ras_commander-0.47.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ras-commander
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.47.0
|
4
4
|
Summary: A Python library for automating HEC-RAS operations
|
5
5
|
Home-page: https://github.com/billk-FM/ras-commander
|
6
6
|
Author: William M. Katzenmeyer
|
@@ -61,7 +61,7 @@ Create a virtual environment with conda or venv (ask ChatGPT if you need help)
|
|
61
61
|
|
62
62
|
In your virtual environment, install ras-commander using pip:
|
63
63
|
```
|
64
|
-
pip install h5py numpy pandas requests tqdm scipy
|
64
|
+
pip install h5py numpy pandas requests tqdm scipy rtree pyproj shapely xarray rasterio
|
65
65
|
pip install --upgrade ras-commander
|
66
66
|
```
|
67
67
|
|
@@ -50,7 +50,7 @@ Create a virtual environment with conda or venv (ask ChatGPT if you need help)
|
|
50
50
|
|
51
51
|
In your virtual environment, install ras-commander using pip:
|
52
52
|
```
|
53
|
-
pip install h5py numpy pandas requests tqdm scipy
|
53
|
+
pip install h5py numpy pandas requests tqdm scipy rtree pyproj shapely xarray rasterio
|
54
54
|
pip install --upgrade ras-commander
|
55
55
|
```
|
56
56
|
|
@@ -70,9 +70,9 @@ class HdfBndry:
|
|
70
70
|
return gpd.GeoDataFrame(
|
71
71
|
{
|
72
72
|
"bc_line_id": bc_line_ids,
|
73
|
-
"
|
73
|
+
"Name": names,
|
74
74
|
"mesh_name": mesh_names,
|
75
|
-
"
|
75
|
+
"Type": types,
|
76
76
|
"geometry": geoms,
|
77
77
|
},
|
78
78
|
geometry="geometry",
|
@@ -110,7 +110,7 @@ class HdfBndry:
|
|
110
110
|
)
|
111
111
|
geoms = HdfBndry._get_polylines(hdf_file, breaklines_path)
|
112
112
|
return gpd.GeoDataFrame(
|
113
|
-
{"bl_id": bl_line_ids, "
|
113
|
+
{"bl_id": bl_line_ids, "Name": names, "geometry": geoms},
|
114
114
|
geometry="geometry",
|
115
115
|
crs=HdfUtils.projection(hdf_file),
|
116
116
|
)
|
@@ -158,7 +158,7 @@ class HdfBndry:
|
|
158
158
|
)
|
159
159
|
)
|
160
160
|
return gpd.GeoDataFrame(
|
161
|
-
{"rr_id": rr_ids, "
|
161
|
+
{"rr_id": rr_ids, "Name": names, "geometry": geoms},
|
162
162
|
geometry="geometry",
|
163
163
|
crs=HdfUtils.projection(hdf_file),
|
164
164
|
)
|
@@ -242,9 +242,9 @@ class HdfBndry:
|
|
242
242
|
return gpd.GeoDataFrame(
|
243
243
|
{
|
244
244
|
"refln_id": refline_ids,
|
245
|
-
"
|
246
|
-
"
|
247
|
-
"
|
245
|
+
"Name": names,
|
246
|
+
"mesh-name": mesh_names,
|
247
|
+
"Type": types,
|
248
248
|
"geometry": geoms,
|
249
249
|
},
|
250
250
|
geometry="geometry",
|
@@ -286,9 +286,9 @@ class HdfBndry:
|
|
286
286
|
return gpd.GeoDataFrame(
|
287
287
|
{
|
288
288
|
"refpt_id": range(attributes.shape[0]),
|
289
|
-
"
|
289
|
+
"Name": names,
|
290
290
|
"mesh_name": mesh_names,
|
291
|
-
"
|
291
|
+
"Cell Index": cell_id,
|
292
292
|
"geometry": list(map(Point, points)),
|
293
293
|
},
|
294
294
|
geometry="geometry",
|
@@ -64,7 +64,7 @@ class HdfMesh:
|
|
64
64
|
return list()
|
65
65
|
return list(
|
66
66
|
[
|
67
|
-
HdfUtils.convert_ras_hdf_string(n)
|
67
|
+
HdfUtils.convert_ras_hdf_string(n.decode('utf-8')) # Decode as UTF-8
|
68
68
|
for n in hdf_file["Geometry/2D Flow Areas/Attributes"][()]["Name"]
|
69
69
|
]
|
70
70
|
)
|
@@ -174,12 +174,11 @@ class HdfMesh:
|
|
174
174
|
except Exception as e:
|
175
175
|
logger.error(f"Error reading mesh cell polygons from {hdf_path}: {str(e)}")
|
176
176
|
return GeoDataFrame()
|
177
|
-
|
178
177
|
@staticmethod
|
179
178
|
@standardize_input(file_type='plan_hdf')
|
180
179
|
def mesh_cell_points(hdf_path: Path) -> GeoDataFrame:
|
181
180
|
"""
|
182
|
-
Return 2D flow mesh cell points.
|
181
|
+
Return 2D flow mesh cell center points.
|
183
182
|
|
184
183
|
Parameters
|
185
184
|
----------
|
@@ -189,29 +188,29 @@ class HdfMesh:
|
|
189
188
|
Returns
|
190
189
|
-------
|
191
190
|
GeoDataFrame
|
192
|
-
A GeoDataFrame containing the 2D flow mesh cell points.
|
191
|
+
A GeoDataFrame containing the 2D flow mesh cell center points.
|
193
192
|
"""
|
194
193
|
try:
|
195
194
|
with h5py.File(hdf_path, 'r') as hdf_file:
|
196
195
|
mesh_area_names = HdfMesh.mesh_area_names(hdf_path)
|
197
196
|
if not mesh_area_names:
|
198
197
|
return GeoDataFrame()
|
198
|
+
|
199
199
|
pnt_dict = {"mesh_name": [], "cell_id": [], "geometry": []}
|
200
|
-
for
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
]
|
205
|
-
pnt_dict["
|
206
|
-
pnt_dict["cell_id"] += range(count)
|
200
|
+
for mesh_name in mesh_area_names:
|
201
|
+
cell_center_coords = hdf_file[f"Geometry/2D Flow Areas/{mesh_name}/Cells Center Coordinate"][()]
|
202
|
+
cell_count = len(cell_center_coords)
|
203
|
+
|
204
|
+
pnt_dict["mesh_name"] += [mesh_name] * cell_count
|
205
|
+
pnt_dict["cell_id"] += range(cell_count)
|
207
206
|
pnt_dict["geometry"] += list(
|
208
207
|
np.vectorize(lambda coords: Point(coords), signature="(n)->()")(
|
209
|
-
|
208
|
+
cell_center_coords
|
210
209
|
)
|
211
210
|
)
|
212
211
|
return GeoDataFrame(pnt_dict, geometry="geometry", crs=HdfUtils.projection(hdf_path))
|
213
212
|
except Exception as e:
|
214
|
-
|
213
|
+
logger.error(f"Error reading mesh cell points from {hdf_path}: {str(e)}")
|
215
214
|
return GeoDataFrame()
|
216
215
|
|
217
216
|
@staticmethod
|
@@ -293,7 +292,7 @@ class HdfMesh:
|
|
293
292
|
try:
|
294
293
|
value = d2_flow_area[name][()]
|
295
294
|
if isinstance(value, bytes):
|
296
|
-
value = value.decode('utf-8')
|
295
|
+
value = value.decode('utf-8') # Decode as UTF-8
|
297
296
|
result[name] = value
|
298
297
|
except Exception as e:
|
299
298
|
logger.warning(f"Error converting attribute '{name}': {str(e)}")
|
@@ -340,10 +339,10 @@ class HdfMesh:
|
|
340
339
|
for z, area, wetted_perimeter, mannings_n in face_values:
|
341
340
|
face_data.append({
|
342
341
|
'Face ID': face_id,
|
343
|
-
'Z': z,
|
344
|
-
'Area': area,
|
345
|
-
'Wetted Perimeter': wetted_perimeter,
|
346
|
-
"Manning's n": mannings_n
|
342
|
+
'Z': z.decode('utf-8'), # Decode as UTF-8
|
343
|
+
'Area': area.decode('utf-8'), # Decode as UTF-8
|
344
|
+
'Wetted Perimeter': wetted_perimeter.decode('utf-8'), # Decode as UTF-8
|
345
|
+
"Manning's n": mannings_n.decode('utf-8') # Decode as UTF-8
|
347
346
|
})
|
348
347
|
|
349
348
|
result[mesh_name] = pd.DataFrame(face_data)
|
@@ -352,4 +351,4 @@ class HdfMesh:
|
|
352
351
|
|
353
352
|
except Exception as e:
|
354
353
|
logger.error(f"Error extracting face property tables from {hdf_path}: {str(e)}")
|
355
|
-
return {}
|
354
|
+
return {}
|
@@ -107,7 +107,7 @@ class RasPrj:
|
|
107
107
|
# Add Geom_File to plan_df
|
108
108
|
self.plan_df['Geom_File'] = self.plan_df.apply(lambda row: self._get_geom_file_for_plan(row['plan_number']), axis=1)
|
109
109
|
|
110
|
-
|
110
|
+
|
111
111
|
def _get_geom_file_for_plan(self, plan_number):
|
112
112
|
"""
|
113
113
|
Get the geometry file path for a given plan number.
|
@@ -133,7 +133,7 @@ class RasPrj:
|
|
133
133
|
logger.error(f"Error reading plan file for geometry: {e}")
|
134
134
|
return None
|
135
135
|
|
136
|
-
|
136
|
+
|
137
137
|
def _parse_plan_file(self, plan_file_path):
|
138
138
|
"""
|
139
139
|
Parse a plan file and extract critical information.
|
@@ -193,9 +193,6 @@ class RasPrj:
|
|
193
193
|
|
194
194
|
return plan_info
|
195
195
|
|
196
|
-
|
197
|
-
|
198
|
-
@log_call
|
199
196
|
def _get_prj_entries(self, entry_type):
|
200
197
|
"""
|
201
198
|
Extract entries of a specific type from the HEC-RAS project file.
|
@@ -242,7 +239,6 @@ class RasPrj:
|
|
242
239
|
|
243
240
|
return pd.DataFrame(entries)
|
244
241
|
|
245
|
-
@log_call
|
246
242
|
def _parse_unsteady_file(self, unsteady_file_path):
|
247
243
|
"""
|
248
244
|
Parse an unsteady flow file and extract critical information.
|
@@ -617,7 +613,6 @@ class RasPrj:
|
|
617
613
|
|
618
614
|
return merged_df
|
619
615
|
|
620
|
-
@log_call
|
621
616
|
def _parse_boundary_condition(self, block: str, unsteady_number: str, bc_number: int) -> Tuple[Dict, str]:
|
622
617
|
lines = block.split('\n')
|
623
618
|
bc_info = {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ras-commander
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.47.0
|
4
4
|
Summary: A Python library for automating HEC-RAS operations
|
5
5
|
Home-page: https://github.com/billk-FM/ras-commander
|
6
6
|
Author: William M. Katzenmeyer
|
@@ -61,7 +61,7 @@ Create a virtual environment with conda or venv (ask ChatGPT if you need help)
|
|
61
61
|
|
62
62
|
In your virtual environment, install ras-commander using pip:
|
63
63
|
```
|
64
|
-
pip install h5py numpy pandas requests tqdm scipy
|
64
|
+
pip install h5py numpy pandas requests tqdm scipy rtree pyproj shapely xarray rasterio
|
65
65
|
pip install --upgrade ras-commander
|
66
66
|
```
|
67
67
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|