ras-commander 0.72.0__py3-none-any.whl → 0.74.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/RasPlan.py CHANGED
@@ -579,12 +579,12 @@ class RasPlan:
579
579
 
580
580
  @staticmethod
581
581
  @log_call
582
- def get_geom_path(geom_number: str, ras_object=None) -> Optional[str]:
582
+ def get_geom_path(geom_number: Union[str, int], ras_object=None) -> Optional[str]:
583
583
  """
584
584
  Return the full path for a given geometry number.
585
585
 
586
586
  Args:
587
- geom_number (str): The geometry number to search for.
587
+ geom_number (Union[str, int]): The geometry number to search for.
588
588
  ras_object (RasPrj, optional): Specific RAS object to use. If None, uses the global ras instance.
589
589
 
590
590
  Returns:
@@ -601,17 +601,51 @@ class RasPlan:
601
601
  ... else:
602
602
  ... print("Geometry file not found.")
603
603
  """
604
- ras_obj = ras_object or ras
605
- ras_obj.check_initialized()
606
-
607
- # Use updated geom dataframe
608
- ras_obj.geom_df = ras_obj.get_prj_entries('Geom')
604
+ logger = get_logger(__name__)
609
605
 
610
- geom_path = ras_obj.geom_df[ras_obj.geom_df['geom_number'] == geom_number]
611
- if not geom_path.empty:
612
- full_path = geom_path['full_path'].iloc[0]
613
- return full_path
614
- else:
606
+ if geom_number is None:
607
+ logger.warning("Provided geometry number is None")
608
+ return None
609
+
610
+ try:
611
+ ras_obj = ras_object or ras
612
+ ras_obj.check_initialized()
613
+
614
+ # Ensure geom_number is a string with proper formatting
615
+ if isinstance(geom_number, int):
616
+ geom_number = f"{geom_number:02d}"
617
+ elif isinstance(geom_number, str):
618
+ # Strip any leading zeros and reformat
619
+ stripped = geom_number.lstrip('0')
620
+ if not stripped: # Handle case where input was '0' or '00'
621
+ geom_number = '00'
622
+ else:
623
+ geom_number = f"{int(stripped):02d}"
624
+ else:
625
+ # Handle unexpected types
626
+ logger.warning(f"Unexpected type for geom_number: {type(geom_number)}")
627
+ return None
628
+
629
+ # Use updated geom dataframe
630
+ ras_obj.geom_df = ras_obj.get_prj_entries('Geom')
631
+
632
+ # Find the geometry file path
633
+ geom_path = ras_obj.geom_df[ras_obj.geom_df['geom_number'] == geom_number]
634
+ if not geom_path.empty:
635
+ if 'full_path' in geom_path.columns and pd.notna(geom_path['full_path'].iloc[0]):
636
+ full_path = geom_path['full_path'].iloc[0]
637
+ logger.info(f"Found geometry path: {full_path}")
638
+ return full_path
639
+ else:
640
+ # Fallback to constructing path
641
+ constructed_path = str(ras_obj.project_folder / f"{ras_obj.project_name}.g{geom_number}")
642
+ logger.info(f"Constructed geometry path: {constructed_path}")
643
+ return constructed_path
644
+ else:
645
+ logger.warning(f"No geometry file found with number: {geom_number}")
646
+ return None
647
+ except Exception as e:
648
+ logger.error(f"Error in get_geom_path: {str(e)}")
615
649
  return None
616
650
 
617
651
  # Clone Functions to copy unsteady, flow, and geometry files from templates
ras_commander/__init__.py CHANGED
@@ -10,7 +10,7 @@ try:
10
10
  __version__ = version("ras-commander")
11
11
  except PackageNotFoundError:
12
12
  # package is not installed
13
- __version__ = "0.72.0"
13
+ __version__ = "0.74.0"
14
14
 
15
15
  # Set up logging
16
16
  setup_logging()
@@ -23,6 +23,7 @@ from .RasUnsteady import RasUnsteady
23
23
  from .RasUtils import RasUtils
24
24
  from .RasExamples import RasExamples
25
25
  from .RasCmdr import RasCmdr
26
+ from .RasMap import RasMap
26
27
  from .HdfFluvialPluvial import HdfFluvialPluvial
27
28
 
28
29
  # HDF handling
@@ -49,7 +50,7 @@ __all__ = [
49
50
  # Core functionality
50
51
  'RasPrj', 'init_ras_project', 'get_ras_exe', 'ras',
51
52
  'RasPlan', 'RasGeo', 'RasUnsteady', 'RasUtils',
52
- 'RasExamples', 'RasCmdr', 'HdfFluvialPluvial',
53
+ 'RasExamples', 'RasCmdr', 'RasMap', 'HdfFluvialPluvial',
53
54
 
54
55
  # HDF handling
55
56
  'HdfBase', 'HdfBndry', 'HdfMesh', 'HdfPlan',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ras-commander
3
- Version: 0.72.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
@@ -1,14 +1,14 @@
1
- ras_commander/Decorators.py,sha256=EOYi20fyV6JgArpHO3lQEVAU6LPHbpa3wGlmIYS40K0,10115
1
+ ras_commander/Decorators.py,sha256=mhfM6A8jJTZ9b0srybB3u4DIaDnwweVQqYHERLR62Ck,14527
2
2
  ras_commander/HdfBase.py,sha256=Jws6Y8JFkharuiM6Br5ivp6MS64X2fL6y87FOpe3FQw,14219
3
3
  ras_commander/HdfBndry.py,sha256=FBNFoTz4sXVB-MOsbHJBP8P0dMqJUfBROloKTaxmzCo,16377
4
4
  ras_commander/HdfFluvialPluvial.py,sha256=dlqoFX5i7uSA2BvuRNrV-Fg-z2JaeUxY86_fbZAdGqI,25933
5
- ras_commander/HdfInfiltration.py,sha256=Dm6WbOg0VWDuVrzflaIEzd9JM5gU_PrgKUgpF4s8tOY,27280
5
+ ras_commander/HdfInfiltration.py,sha256=HiifhbzgUs4kdtJkKfhxo1IsE-FBp5XspKkrJnnCDuc,66171
6
6
  ras_commander/HdfMesh.py,sha256=zI_4AqxDxb2_31G9RUmWibyld6KDMGhDpI3F8qwzVAw,19139
7
7
  ras_commander/HdfPipe.py,sha256=m-yvPL2GIP23NKt2tcwzOlS7khvgcDPGAshlTPMUAeI,32154
8
- ras_commander/HdfPlan.py,sha256=_KIWMoMpAftUp2wc2PQ9psl78IvW0disN0yKt7sNfqU,11807
8
+ ras_commander/HdfPlan.py,sha256=WINI3lp865cE99QXztgvKKIhVUTOqu4X41ZPBfhYJGU,12145
9
9
  ras_commander/HdfPlot.py,sha256=7MNI5T9qIz-Ava1RdlnB6O9oJElE5BEB29QVF5Y2Xuc,3401
10
10
  ras_commander/HdfPump.py,sha256=Vc2ff16kRISR7jwtnaAqxI0p-gfBSuZKzR3rQbBLQoE,12951
11
- ras_commander/HdfResultsMesh.py,sha256=kjk5zXowgfscayiyKmSFdTDXa8-kPUI4SYKJ2okw3F0,31738
11
+ ras_commander/HdfResultsMesh.py,sha256=MKnSJxcWVDccHaRRGgAK0szm7B-VtrKBtgL1Uz0kAiw,44662
12
12
  ras_commander/HdfResultsPlan.py,sha256=L3IOdF6R3XiA7mbFAyLdczrZJQJogd8hhl7UYJWT5fY,16246
13
13
  ras_commander/HdfResultsPlot.py,sha256=ylzfT78CfgoDO0XAlRwlgMNRzvNQYBMn9eyXyBfjv_w,7660
14
14
  ras_commander/HdfResultsXsec.py,sha256=-P7nXnbjOLAeUnrdSC_lJQSfzrlWKmDF9Z5gEjmxbJY,13031
@@ -18,15 +18,15 @@ ras_commander/HdfXsec.py,sha256=flREnFFrIZu4SSKGRQeX9w3SS49q0UWPJnq4zO7DbUM,2734
18
18
  ras_commander/LoggingConfig.py,sha256=gWe5K5XTmMQpSczsTysAqpC9my24i_IyM8dvD85fxYg,2704
19
19
  ras_commander/RasCmdr.py,sha256=37GnchoQ0fIAkPnssnCr1mRUXY8gm-hIMTmuHZlnYP8,34591
20
20
  ras_commander/RasExamples.py,sha256=6IZ96LcAsk5LYFehdD0zDW5wyZWxQa6OQu2N9upxWXA,17536
21
- ras_commander/RasGeo.py,sha256=hHurT_jsAfWu0Nto7cTPTgT1H6TZB7JD_v-tdzr8r_A,21742
21
+ ras_commander/RasGeo.py,sha256=CQ1VjJ4uWWyXC9KsoVStbhlRf_5AiDm8yWvtDM3l4ac,21675
22
22
  ras_commander/RasMap.py,sha256=4cVzaaQure-CXdXB1BY29iE20S00eldUqoL96PvJPbw,10635
23
- ras_commander/RasPlan.py,sha256=7cgwsKjD40ZSj9uOnsHd-OfmBJFxkS2xFhWmlHQflak,62179
23
+ ras_commander/RasPlan.py,sha256=GhAeUSvWRuBcYcOtBCo-qZGUefEWOlhw4ASJQHTGWzU,63872
24
24
  ras_commander/RasPrj.py,sha256=ivAHB3vexH6GQi-Aa4kqAabRwdthllMkTp8xphh5Ldc,57655
25
25
  ras_commander/RasUnsteady.py,sha256=TO08CT2GC4G5rcXO_Wbia2t4PhiWRu9-nC9F0IW7Gyo,37187
26
26
  ras_commander/RasUtils.py,sha256=0fm4IIs0LH1dgDj3pGd66mR82DhWLEkRKUvIo2M_5X0,35886
27
- ras_commander/__init__.py,sha256=JclW9xzKI5BVqPu2lxrp6uAcyoDiBaZPxmhCc23ISds,2001
28
- ras_commander-0.72.0.dist-info/licenses/LICENSE,sha256=_pbd6qHnlsz1iQ-ozDW_49r86BZT6CRwO2iBtw0iN6M,457
29
- ras_commander-0.72.0.dist-info/METADATA,sha256=0R0x1oIIkBVnDXXHSh5DIoX5S8xrefdOvZgryQQz0zQ,26654
30
- ras_commander-0.72.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
31
- ras_commander-0.72.0.dist-info/top_level.txt,sha256=i76S7eKLFC8doKcXDl3aiOr9RwT06G8adI6YuKbQDaA,14
32
- ras_commander-0.72.0.dist-info/RECORD,,
27
+ ras_commander/__init__.py,sha256=K6g6-GMFHnDKhLYvht8voqlGfY3N86UNS6ZQKvne3Mc,2039
28
+ ras_commander-0.74.0.dist-info/licenses/LICENSE,sha256=_pbd6qHnlsz1iQ-ozDW_49r86BZT6CRwO2iBtw0iN6M,457
29
+ ras_commander-0.74.0.dist-info/METADATA,sha256=qoAaqX8Z5ZCA88r1KAhcvatAh1WyAX75H0FK8HmC-8Y,27365
30
+ ras_commander-0.74.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
31
+ ras_commander-0.74.0.dist-info/top_level.txt,sha256=i76S7eKLFC8doKcXDl3aiOr9RwT06G8adI6YuKbQDaA,14
32
+ ras_commander-0.74.0.dist-info/RECORD,,