Using RasExamples¶
# =============================================================================
# DEVELOPMENT MODE TOGGLE
# =============================================================================
# Set USE_LOCAL_SOURCE based on your setup:
# True = Use local source code (for developers editing ras-commander)
# False = Use pip-installed package (for users)
# =============================================================================
USE_LOCAL_SOURCE = False # <-- TOGGLE THIS
# -----------------------------------------------------------------------------
if USE_LOCAL_SOURCE:
import sys
from pathlib import Path
local_path = str(Path.cwd().parent) # Parent of examples/ = repo root
if local_path not in sys.path:
sys.path.insert(0, local_path) # Insert at position 0 = highest priority
print(f"📁 LOCAL SOURCE MODE: Loading from {local_path}/ras_commander")
else:
print("📦 PIP PACKAGE MODE: Loading installed ras-commander")
# Import ras-commander (will use local or pip based on toggle above)
from ras_commander import RasExamples, ras
# Verify which version loaded
import ras_commander
print(f"✓ Loaded: {ras_commander.__file__}")
📦 PIP PACKAGE MODE: Loading installed ras-commander
✓ Loaded: c:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\ras_commander\__init__.py
Prerequisites¶
Before running this notebook, ensure you have:
- ras-commander installed:
pip install ras-commander - Python 3.10+: Check with
python --version - Disk Space: ~500 MB for extracting example projects
- No HEC-RAS Required: This notebook works without HEC-RAS installed (only extracts projects)
What You'll Learn¶
This notebook demonstrates the RasExamples class, which manages example HEC-RAS projects shipped with ras-commander:
- Basic extraction: Get started quickly with
extract_project(name) - Listing projects: Browse available examples by category
- Custom locations: Extract to specific folders with
output_path - Multiple projects: Batch extraction for comparative analysis
Related Notebooks¶
- 101_project_initialization.ipynb - Initialize and work with extracted projects
- 110_single_plan_execution.ipynb - Execute plans in extracted projects
Parameters¶
Configure these values to customize the notebook for your project.
# =============================================================================
# PARAMETERS - Edit these to customize the notebook
# =============================================================================
from pathlib import Path
# Project Configuration
PROJECT_NAME = "Muncie" # Example project to extract
RAS_VERSION = "7.0" # HEC-RAS version (6.3, 6.5, 6.6, etc.)
Using RASExamples¶
Simple Method for Calling HEC-RAS Example Projects by Folder Name¶
# This Code Cell is All You Need
# This is what this Class was intended to do: Help me make repeatable workflows around HEC-RAS Example Projects for testing and demonstration purposes.
# Extract specific projects
RasExamples.extract_project(["Balde Eagle Creek", "BaldEagleCrkMulti2D", "Muncie", "Davis", "NewOrleansMetro", "BeaverLake"])
2026-01-14 11:31:19 - ras_commander.RasExamples - INFO - Found zip file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\Example_Projects_6_6.zip
2026-01-14 11:31:19 - ras_commander.RasExamples - INFO - Loading project data from CSV...
2026-01-14 11:31:19 - ras_commander.RasExamples - INFO - Loaded 68 projects from CSV.
2026-01-14 11:31:19 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:19 - ras_commander.RasExamples - INFO - Extracting project 'Balde Eagle Creek'
2026-01-14 11:31:19 - ras_commander.RasExamples - INFO - Successfully extracted project 'Balde Eagle Creek' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek
2026-01-14 11:31:19 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:19 - ras_commander.RasExamples - INFO - Extracting project 'BaldEagleCrkMulti2D'
2026-01-14 11:31:19 - ras_commander.RasExamples - INFO - Folder 'BaldEagleCrkMulti2D' already exists. Deleting existing folder...
2026-01-14 11:31:19 - ras_commander.RasExamples - INFO - Existing folder 'BaldEagleCrkMulti2D' has been deleted.
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - Successfully extracted project 'BaldEagleCrkMulti2D' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\BaldEagleCrkMulti2D
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - Extracting project 'Muncie'
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - Successfully extracted project 'Muncie' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Muncie
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - Extracting project 'Davis'
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - Successfully extracted project 'Davis' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Davis
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Special Project -----
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - Extracting special project 'NewOrleansMetro'
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - Downloading special project from: https://www.hec.usace.army.mil/confluence/rasdocs/hgt/files/latest/299502039/299502111/1/1747692522764/NewOrleansMetroPipesExample.zip
2026-01-14 11:31:21 - ras_commander.RasExamples - INFO - This may take a few moments...
2026-01-14 11:31:28 - ras_commander.RasExamples - INFO - Downloaded special project zip file to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\NewOrleansMetro_temp.zip
2026-01-14 11:31:29 - ras_commander.RasExamples - INFO - Successfully extracted special project 'NewOrleansMetro' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\NewOrleansMetro
2026-01-14 11:31:29 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Special Project -----
2026-01-14 11:31:29 - ras_commander.RasExamples - INFO - Extracting special project 'BeaverLake'
2026-01-14 11:31:29 - ras_commander.RasExamples - INFO - Downloading special project from: https://www.hec.usace.army.mil/confluence/rasdocs/hgt/files/latest/299501780/299502090/1/1747692179014/BeaverLake-SWMM-Import-Solution.zip
2026-01-14 11:31:29 - ras_commander.RasExamples - INFO - This may take a few moments...
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Downloaded special project zip file to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\BeaverLake_temp.zip
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Successfully extracted special project 'BeaverLake' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\BeaverLake
[WindowsPath('C:/Users/billk_clb/anaconda3/envs/rascmdr_piptest/Lib/site-packages/examples/example_projects/Balde Eagle Creek'),
WindowsPath('C:/Users/billk_clb/anaconda3/envs/rascmdr_piptest/Lib/site-packages/examples/example_projects/BaldEagleCrkMulti2D'),
WindowsPath('C:/Users/billk_clb/anaconda3/envs/rascmdr_piptest/Lib/site-packages/examples/example_projects/Muncie'),
WindowsPath('C:/Users/billk_clb/anaconda3/envs/rascmdr_piptest/Lib/site-packages/examples/example_projects/Davis'),
WindowsPath('C:/Users/billk_clb/anaconda3/envs/rascmdr_piptest/Lib/site-packages/examples/example_projects/NewOrleansMetro'),
WindowsPath('C:/Users/billk_clb/anaconda3/envs/rascmdr_piptest/Lib/site-packages/examples/example_projects/BeaverLake')]
Verification¶
Expected Outputs:
- ✓ Three project folders created in examples/example_projects/
- ✓ Each folder contains .prj, .g##, .p## files (HEC-RAS project structure)
- ✓ Extraction logged to console with INFO messages
Visual Check:
examples/
example_projects/
Balde Eagle Creek/
Bald Eagle Creek.prj
Bald Eagle Creek.g01
Bald Eagle Creek.p01
...
What to Review:
1. Check that extracted_paths is a list of Path objects
2. Verify each path .exists() returns True
3. Open any .prj file in HEC-RAS GUI to confirm project integrity
Audit Trail¶
The extraction process automatically logs: - Source ZIP file location - Destination folder for each project - Success/failure status
These logs provide an audit trail for reproducibility.
Why RasExamples Exists¶
Problem: New users need realistic HEC-RAS projects to test ras-commander functionality, but manually downloading/organizing example projects is tedious.
Solution: RasExamples provides:
- 68+ curated example projects from HEC-RAS 6.6
- Organized by category (1D/2D, sediment, breach, etc.)
- One-line extraction API
- Reproducible project paths for notebooks
This enables Test Driven Development with real HEC-RAS data (not mocks) - see .claude/rules/testing/tdd-approach.md
Advanced Usage¶
RasExamples will not download a new .zip file if one already exists, this allows you to replace the Example_Projects_6_x.zip with your own zip file (with the same folder format as the HEC-RAS examples) and you will be able to load them by folder name for repeatable Test Driven Development
Just make sure all project folders have unique folder names.
# Check if example projects are already downloaded
if RasExamples.projects_dir.exists():
print("Example projects are already downloaded.")
print("RasExamples._folder_df:")
display(RasExamples._folder_df)
else:
print("Downloading example projects...")
RasExamples.get_example_projects()
print("RasExamples._folder_df:")
display(RasExamples._folder_df)
Example projects are already downloaded.
RasExamples._folder_df:
| Category | Project | |
|---|---|---|
| 0 | 1D Sediment Transport | BSTEM - Simple Example |
| 1 | 1D Sediment Transport | Dredging Example |
| 2 | 1D Sediment Transport | Reservoir Video Tutorial |
| 3 | 1D Sediment Transport | SIAM Example |
| 4 | 1D Sediment Transport | Simple Sediment Transport Example |
| ... | ... | ... |
| 63 | Applications Guide | Example 7 - Multiple Plans |
| 64 | Applications Guide | Example 8 - Looped Network |
| 65 | Applications Guide | Example 9 - Mixed Flow Analysis |
| 66 | Pipes (beta) | Davis |
| 67 | Water Quality | Nutrient Example |
68 rows × 2 columns
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Available categories: 1D Sediment Transport, 1D Steady Flow Hydraulics, 1D Unsteady Flow Hydraulics, 2D Sediment Transport, 2D Unsteady Flow Hydraulics, Applications Guide, Pipes (beta), Water Quality
Available categories:
['1D Sediment Transport',
'1D Steady Flow Hydraulics',
'1D Unsteady Flow Hydraulics',
'2D Sediment Transport',
'2D Unsteady Flow Hydraulics',
'Applications Guide',
'Pipes (beta)',
'Water Quality']
# List projects in a specific category
projects = RasExamples.list_projects("1D Sediment Transport")
projects
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Projects in category '1D Sediment Transport': BSTEM - Simple Example, Dredging Example, Reservoir Video Tutorial, SIAM Example, Simple Sediment Transport Example, Unsteady Sediment with Concentration Rules, Video Tutorial (Sediment Intro)
['BSTEM - Simple Example',
'Dredging Example',
'Reservoir Video Tutorial',
'SIAM Example',
'Simple Sediment Transport Example',
'Unsteady Sediment with Concentration Rules',
'Video Tutorial (Sediment Intro)']
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - All available projects: BSTEM - Simple Example, Dredging Example, Reservoir Video Tutorial, SIAM Example, Simple Sediment Transport Example, Unsteady Sediment with Concentration Rules, Video Tutorial (Sediment Intro), Baxter RAS Mapper, Chapter 4 Example Data, ConSpan Culvert, Mixed Flow Regime Channel, Wailupe GeoRAS, Balde Eagle Creek, Bridge Hydraulics, ContractionExpansionMinorLosses, Culvert Hydraulics, Culverts with Flap Gates, Dam Breaching, Elevation Controled Gates, Inline Structure with Gated Spillways, Internal Stage and Flow Boundary Condition, JunctionHydraulics, Lateral Strcuture with Gates, Lateral Structure connected to a River Reach, Lateral Structure Overflow Weir, Lateral Structure with Culverts and Gates, Lateral Structure with Culverts, Levee Breaching, Mixed Flow Regime, Multiple Reaches with Hydraulic Structures, NavigationDam, Pumping Station with Rules, Pumping Station, Rule Operations, Simplified Physical Breaching, Storage Area Hydraulic Connection, UngagedAreaInflows, Unsteady Flow Encroachment Analysis, Chippewa_2D, Weise_2D, BaldEagleCrkMulti2D, Muncie, Example 1 - Critical Creek, Example 10 - Stream Junction, Example 11 - Bridge Scour, Example 12 - Inline Structure, Example 13 - Singler Bridge (WSPRO), Example 14 - Ice Covered River, Example 15 - Split Flow Junction with Lateral Weir, Example 16 - Channel Modification, Example 17 - Unsteady Flow Application, Example 18 - Advanced Inline Structure, Example 19 - Hydrologic Routing - ModPuls, Example 2 - Beaver Creek, Example 20 - HagerLatWeir, Example 21 - Overflow Gates, Example 22 - Groundwater Interflow, Example 23 - Urban Modeling, Example 24 - Mannings-n-Calibration, Example 3 - Single Culvert, Example 4 - Multiple Culverts, Example 5 - Multiple Openings, Example 6 - Floodway Determination, Example 7 - Multiple Plans, Example 8 - Looped Network, Example 9 - Mixed Flow Analysis, Davis, Nutrient Example, NewOrleansMetro, BeaverLake
['BSTEM - Simple Example',
'Dredging Example',
'Reservoir Video Tutorial',
'SIAM Example',
'Simple Sediment Transport Example',
'Unsteady Sediment with Concentration Rules',
'Video Tutorial (Sediment Intro)',
'Baxter RAS Mapper',
'Chapter 4 Example Data',
'ConSpan Culvert',
'Mixed Flow Regime Channel',
'Wailupe GeoRAS',
'Balde Eagle Creek',
'Bridge Hydraulics',
'ContractionExpansionMinorLosses',
'Culvert Hydraulics',
'Culverts with Flap Gates',
'Dam Breaching',
'Elevation Controled Gates',
'Inline Structure with Gated Spillways',
'Internal Stage and Flow Boundary Condition',
'JunctionHydraulics',
'Lateral Strcuture with Gates',
'Lateral Structure connected to a River Reach',
'Lateral Structure Overflow Weir',
'Lateral Structure with Culverts and Gates',
'Lateral Structure with Culverts',
'Levee Breaching',
'Mixed Flow Regime',
'Multiple Reaches with Hydraulic Structures',
'NavigationDam',
'Pumping Station with Rules',
'Pumping Station',
'Rule Operations',
'Simplified Physical Breaching',
'Storage Area Hydraulic Connection',
'UngagedAreaInflows',
'Unsteady Flow Encroachment Analysis',
'Chippewa_2D',
'Weise_2D',
'BaldEagleCrkMulti2D',
'Muncie',
'Example 1 - Critical Creek',
'Example 10 - Stream Junction',
'Example 11 - Bridge Scour',
'Example 12 - Inline Structure',
'Example 13 - Singler Bridge (WSPRO)',
'Example 14 - Ice Covered River',
'Example 15 - Split Flow Junction with Lateral Weir',
'Example 16 - Channel Modification',
'Example 17 - Unsteady Flow Application',
'Example 18 - Advanced Inline Structure',
'Example 19 - Hydrologic Routing - ModPuls',
'Example 2 - Beaver Creek',
'Example 20 - HagerLatWeir',
'Example 21 - Overflow Gates',
'Example 22 - Groundwater Interflow',
'Example 23 - Urban Modeling',
'Example 24 - Mannings-n-Calibration',
'Example 3 - Single Culvert',
'Example 4 - Multiple Culverts',
'Example 5 - Multiple Openings',
'Example 6 - Floodway Determination',
'Example 7 - Multiple Plans',
'Example 8 - Looped Network',
'Example 9 - Mixed Flow Analysis',
'Davis',
'Nutrient Example',
'NewOrleansMetro',
'BeaverLake']
# Extract specific projects
projects_to_extract = ["Balde Eagle Creek", "BaldEagleCrkMulti2D", "Muncie"]
extracted_paths = RasExamples.extract_project(projects_to_extract)
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Extracting project 'Balde Eagle Creek'
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Folder 'Balde Eagle Creek' already exists. Deleting existing folder...
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Existing folder 'Balde Eagle Creek' has been deleted.
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Successfully extracted project 'Balde Eagle Creek' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Extracting project 'BaldEagleCrkMulti2D'
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Folder 'BaldEagleCrkMulti2D' already exists. Deleting existing folder...
2026-01-14 11:31:30 - ras_commander.RasExamples - INFO - Existing folder 'BaldEagleCrkMulti2D' has been deleted.
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - Successfully extracted project 'BaldEagleCrkMulti2D' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\BaldEagleCrkMulti2D
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - Extracting project 'Muncie'
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - Folder 'Muncie' already exists. Deleting existing folder...
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - Existing folder 'Muncie' has been deleted.
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - Successfully extracted project 'Muncie' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Muncie
Note about New Pipes and Conduits Version 6.6 Example Project¶
Use project name "Davis" to explore pipes and conduits (introduced in version 6.6)
NEW Example Projects:¶
The "BeaverLake" and "NewOrleansMetro" were published to the HEC-RAS Sample Datasets page. These sample datasets are specifically for Pipe Systems introduced in HEC-RAS 6.6¶
https://www.hec.usace.army.mil/confluence/rasdocs/hgt/latest/sample-datasets/small-city-urban-drainage-davis-ca
https://www.hec.usace.army.mil/confluence/rasdocs/hgt/latest/sample-datasets/small-neighborhood-drainage-beaver-lake
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Special Project -----
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - Extracting special project 'BeaverLake'
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - Folder 'BeaverLake' already exists. Deleting existing folder...
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - Existing folder 'BeaverLake' has been deleted.
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - Downloading special project from: https://www.hec.usace.army.mil/confluence/rasdocs/hgt/files/latest/299501780/299502090/1/1747692179014/BeaverLake-SWMM-Import-Solution.zip
2026-01-14 11:31:32 - ras_commander.RasExamples - INFO - This may take a few moments...
2026-01-14 11:31:33 - ras_commander.RasExamples - INFO - Downloaded special project zip file to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\BeaverLake_temp.zip
2026-01-14 11:31:33 - ras_commander.RasExamples - INFO - Successfully extracted special project 'BeaverLake' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\BeaverLake
2026-01-14 11:31:33 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Special Project -----
2026-01-14 11:31:33 - ras_commander.RasExamples - INFO - Extracting special project 'NewOrleansMetro'
2026-01-14 11:31:33 - ras_commander.RasExamples - INFO - Folder 'NewOrleansMetro' already exists. Deleting existing folder...
2026-01-14 11:31:33 - ras_commander.RasExamples - INFO - Existing folder 'NewOrleansMetro' has been deleted.
2026-01-14 11:31:33 - ras_commander.RasExamples - INFO - Downloading special project from: https://www.hec.usace.army.mil/confluence/rasdocs/hgt/files/latest/299502039/299502111/1/1747692522764/NewOrleansMetroPipesExample.zip
2026-01-14 11:31:33 - ras_commander.RasExamples - INFO - This may take a few moments...
2026-01-14 11:31:40 - ras_commander.RasExamples - INFO - Downloaded special project zip file to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\NewOrleansMetro_temp.zip
2026-01-14 11:31:41 - ras_commander.RasExamples - INFO - Successfully extracted special project 'NewOrleansMetro' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\NewOrleansMetro
# Example 4: Special projects also work with custom output paths
# Example 4: Special projects also work with suffix
beaverlake_path = RasExamples.extract_project("BeaverLake", suffix="special")
print(f"Special project extracted to: {beaverlake_path}")
2026-01-14 11:31:41 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Special Project -----
2026-01-14 11:31:41 - ras_commander.RasExamples - INFO - Extracting special project 'BeaverLake' as 'BeaverLake_special'
2026-01-14 11:31:41 - ras_commander.RasExamples - INFO - Downloading special project from: https://www.hec.usace.army.mil/confluence/rasdocs/hgt/files/latest/299501780/299502090/1/1747692179014/BeaverLake-SWMM-Import-Solution.zip
2026-01-14 11:31:41 - ras_commander.RasExamples - INFO - This may take a few moments...
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - Downloaded special project zip file to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\BeaverLake_special_temp.zip
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - Successfully extracted special project 'BeaverLake' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\BeaverLake_special
Special project extracted to: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\BeaverLake_special
# Example 3: Extract multiple projects to a custom location
projects = ["Balde Eagle Creek", "Pumping Station"]
# Example 3: Extract multiple projects with suffix
extracted_paths = RasExamples.extract_project(projects, suffix="unsteady")
print(f"Extracted {len(extracted_paths)} projects:")
for path in extracted_paths:
print(f" - {path}")
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - Extracting project 'Balde Eagle Creek' as 'Balde Eagle Creek_unsteady'
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - Successfully extracted project 'Balde Eagle Creek' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_unsteady
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - Extracting project 'Pumping Station' as 'Pumping Station_unsteady'
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - Successfully extracted project 'Pumping Station' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Pumping Station_unsteady
Extracted 2 projects:
- C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_unsteady
- C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Pumping Station_unsteady
# Example 2: Extract with descriptive suffix - creates example_projects/Dam Breaching_breach_test/
dam_breach_path = RasExamples.extract_project("Dam Breaching", suffix="breach_test")
print(f"Extracted to: {dam_breach_path}")
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - Extracting project 'Dam Breaching' as 'Dam Breaching_breach_test'
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - Successfully extracted project 'Dam Breaching' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Dam Breaching_breach_test
Extracted to: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Dam Breaching_breach_test
# Example 1: Extract to a relative path (creates subfolder in current directory)
# Example 1: Extract with suffix (RECOMMENDED) - creates example_projects/Muncie_100/
muncie_path = RasExamples.extract_project("Muncie", suffix="100")
print(f"Extracted to: {muncie_path}")
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-14 11:31:42 - ras_commander.RasExamples - INFO - Extracting project 'Muncie' as 'Muncie_100'
2026-01-14 11:31:43 - ras_commander.RasExamples - INFO - Successfully extracted project 'Muncie' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Muncie_100
Extracted to: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Muncie_100
HEC-RAS Example Projects Reference¶
The projects managed by RasExamples come from the official HEC-RAS 6.6 installation:
- HEC-RAS Documentation: https://www.hec.usace.army.mil/software/hec-ras/documentation.aspx
- Example Projects: Installed with HEC-RAS at
C:\Program Files\HEC\HEC-RAS\6.6\Examples\ - User's Manual: Contains detailed descriptions of each example project
Categories Available¶
Run RasExamples.list_categories() to see all available project types:
- 1D Steady Flow Hydraulics
- 1D Unsteady Flow Hydraulics
- 1D/2D Unsteady Flow Hydraulics (Coupled)
- 2D Unsteady Flow Hydraulics
- Sediment Transport
- Dam and Levee Breaching
- Water Quality
- Reservoir Modeling
- And more...
LLM Forward Considerations¶
When using these projects for automated workflows: 1. Known Good Data: All projects have been validated by USACE 2. Reviewable Outputs: Extract to named folders for visual inspection 3. Reproducible: Same extraction always produces same project structure 4. Documented: Each project has associated documentation in HEC-RAS manual
Extracting Projects to Custom Locations¶
By default, projects are extracted to the example_projects subfolder. You have two options for organizing multiple extractions:
Recommended: Using suffix Parameter¶
The suffix parameter is the recommended approach - it appends a suffix to the project name, keeping projects organized in a consistent location:
# Creates: example_projects/Muncie_100/
project_path = RasExamples.extract_project("Muncie", suffix="100")
Benefits:
- Returns the correct path automatically
- Consistent location (example_projects/{project}_{suffix}/)
- No manual path construction
- Clear intent (project variant for specific purpose)
Alternative: Using output_path Parameter¶
You can also specify a completely custom output location using output_path, though this requires manual path management:
# Creates: my_custom_folder/Muncie/
project_path = RasExamples.extract_project("Muncie", output_path="my_custom_folder")
Note: When using output_path, always capture the return value to get the correct path.