Using results_df for Plan Results Summary¶
This notebook demonstrates the results_df DataFrame, which provides lightweight HDF-based results summaries for all plans. This enables quick access to execution status, volumetric errors, compute messages, and runtime data without opening heavy geospatial results.
Setup and Imports¶
from pathlib import Path
import sys
# Flexible imports for development vs installed package
try:
from ras_commander import init_ras_project, RasCmdr, RasExamples, ras
from ras_commander.results import ResultsParser
except ImportError:
current_file = Path(__file__).resolve()
parent_directory = current_file.parent.parent
sys.path.append(str(parent_directory))
from ras_commander import init_ras_project, RasCmdr, RasExamples, ras
from ras_commander.results import ResultsParser
2026-06-11 15:41:09 - numexpr.utils - INFO - NumExpr defaulting to 8 threads.
Extract Example Project¶
# Extract Muncie example project
project_path = RasExamples.extract_project("Muncie")
print(f"Project extracted to: {project_path}")
2026-06-11 15:41:13 - ras_commander.RasExamples - INFO - Successfully extracted project 'Muncie' to <repo>\examples\example_projects\Muncie
Project extracted to: <repo>\examples\example_projects\Muncie
Initialize Project with results_df¶
When initializing a project, results_df is automatically populated by default (load_results_summary=True).
# Initialize project - results_df is automatically loaded
init_ras_project(project_path, "6.6")
print(f"Plans in project: {len(ras.plan_df)}")
print(f"Results summaries loaded: {len(ras.results_df)}")
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 7.0 at C:\Program Files (x86)\HEC\HEC-RAS\7.0\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 6.7 Beta 5 at C:\Program Files (x86)\HEC\HEC-RAS\6.7 Beta 5\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 6.7 Beta 4 at C:\Program Files (x86)\HEC\HEC-RAS\6.7 Beta 4\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 6.6 at C:\Program Files (x86)\HEC\HEC-RAS\6.6\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 6.5 at C:\Program Files (x86)\HEC\HEC-RAS\6.5\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 6.4.1 at C:\Program Files (x86)\HEC\HEC-RAS\6.4.1\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 6.3.1 at C:\Program Files (x86)\HEC\HEC-RAS\6.3.1\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 6.3 at C:\Program Files (x86)\HEC\HEC-RAS\6.3\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 6.2 at C:\Program Files (x86)\HEC\HEC-RAS\6.2\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 6.1 at C:\Program Files (x86)\HEC\HEC-RAS\6.1\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 6.0 at C:\Program Files (x86)\HEC\HEC-RAS\6.0\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 5.0.7 at C:\Program Files (x86)\HEC\HEC-RAS\5.0.7\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 5.0.6 at C:\Program Files (x86)\HEC\HEC-RAS\5.0.6\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 5.0.5 at C:\Program Files (x86)\HEC\HEC-RAS\5.0.5\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 5.0.4 at C:\Program Files (x86)\HEC\HEC-RAS\5.0.4\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 5.0.3 at C:\Program Files (x86)\HEC\HEC-RAS\5.0.3\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 5.0.1 at C:\Program Files (x86)\HEC\HEC-RAS\5.0.1\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 5.0 at C:\Program Files (x86)\HEC\HEC-RAS\5.0\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 4.1.0 at C:\Program Files (x86)\HEC\HEC-RAS\4.1.0\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered HEC-RAS 4.0 at C:\Program Files (x86)\HEC\HEC-RAS\4.0\Ras.exe via filesystem (x86)
2026-06-11 15:41:13 - ras_commander.RasUtils - INFO - Discovered 20 installed HEC-RAS version(s)
2026-06-11 15:41:13 - ras_commander.RasPrj - INFO - HEC-RAS 6.6 found via version discovery: C:\Program Files (x86)\HEC\HEC-RAS\6.6\Ras.exe
2026-06-11 15:41:14 - ras_commander.RasMap - INFO - Successfully parsed RASMapper file: <repo>\examples\example_projects\Muncie\Muncie.rasmap
2026-06-11 15:41:14 - ras_commander.RasPrj - INFO - ras-commander v0.98.0 | An open-source project of CLB Engineering Corporation (https://clbengineering.com/) | Docs: https://rascommander.info | GitHub: https://github.com/gpt-cmdr/ras-commander
2026-06-11 15:41:14 - ras_commander.RasPrj - INFO - Project initialized: Muncie | Folder: <repo>\examples\example_projects\Muncie
2026-06-11 15:41:14 - ras_commander.RasPrj - INFO - Using HEC-RAS executable: C:\Program Files (x86)\HEC\HEC-RAS\6.6\Ras.exe
2026-06-11 15:41:14 - ras_commander.RasPrj - INFO -
═══════════════════════════════════════════════════════════════════════
ras-commander | HEC-RAS Automation Library
Docs: https://rascommander.info/
Repo: https://github.com/gpt-cmdr/ras-commander
═══════════════════════════════════════════════════════════════════════
PROJECT DATAFRAMES (single source of truth — use these, not file globbing):
ras.plan_df Plans, HDF paths, geometry/flow associations
ras.geom_df Geometry files and HDF preprocessor paths
ras.flow_df Steady flow files
ras.unsteady_df Unsteady flow files and configurations
ras.boundaries_df Boundary conditions (type, name, location)
ras.results_df Lightweight HDF results summaries
ras.rasmap_df RASMapper layers, terrain, land cover paths
KEY APIS (static classes — call directly, never instantiate):
Execution: RasCmdr.compute_plan() / compute_parallel() / compute_test_mode()
Plan Files: RasPlan.clone_plan() / clone_geom() / set_geom()
Unsteady: RasUnsteady — IC/BC management, gate openings, precipitation
Geometry: GeomCrossSection, GeomBridge, GeomStorage, GeomLateral, GeomMesh
HDF Results: HdfResultsPlan.get_wse() / get_compute_messages()
HdfResultsMesh.get_mesh_max_ws() / get_mesh_cells_timeseries()
HdfMesh.get_mesh_cell_points()
QA/QC: RasCheck.run_check() / RasFixit (geometry repair)
DSS: RasDss.get_timeseries() / check_pathname()
USGS: UsgsGaugeSpatial, GaugeMatcher, RasUsgsBoundaryGeneration
Precipitation: StormGenerator, Atlas14Storm, PrecipAorc, Atlas14Variance
Terrain: RasTerrain.create_terrain_hdf() / RasTerrainMod
MULTI-PROJECT: Pass ras_object= to all API calls when using local RasPrj instances.
EXAMPLES: 100+ notebooks in examples/ (100s=execution, 200s=geometry, 300s=unsteady,
400s=HDF results, 500s=remote, 800s=QA/QC, 900s=data integration).
Review relevant notebooks before assembling new workflows.
PLATFORM: Most HEC-RAS operations require Windows. Linux/Wine support for
headless execution, data access, geometry modification, and preprocessing
is available via RasProcess (HEC-RAS 6.6+). See ras_commander/RasProcess.py.
Remote distributed execution: ras_commander/remote/ (PsExec, Docker, SSH, cloud).
═══════════════════════════════════════════════════════════════════════
Plans in project: 3
Results summaries loaded: 3
View Initial results_df¶
Before execution, results_df shows plans with HDF files already present (if any).
# View initial results_df
print("\n=== Initial results_df ===")
cols = ['plan_number', 'plan_title', 'hdf_exists', 'completed', 'has_errors']
print(ras.results_df[cols].to_string())
=== Initial results_df ===
plan_number plan_title hdf_exists completed has_errors
0 01 Unsteady Multi 9-SA run False False False
1 03 Unsteady Run with 2D 50ft Grid False False False
2 04 Unsteady Run with 2D 50ft User n Value R False False False
Execute a Plan¶
After execution, results_df is automatically updated with fresh results.
# Execute plan 01
print("Executing plan 01...")
RasCmdr.compute_plan("01", num_cores=2)
print("Execution complete!")
2026-06-11 15:41:14 - ras_commander.RasCmdr - INFO - Using ras_object with project folder: <repo>\examples\example_projects\Muncie
2026-06-11 15:41:14 - ras_commander.RasUtils - INFO - Successfully updated file: <repo>\examples\example_projects\Muncie\Muncie.p01
2026-06-11 15:41:14 - ras_commander.RasCmdr - INFO - Set number of cores to 2 for plan: 01
2026-06-11 15:41:14 - ras_commander.RasCmdr - INFO - Running HEC-RAS from the Command Line:
2026-06-11 15:41:14 - ras_commander.RasCmdr - INFO - Running command: "C:\Program Files (x86)\HEC\HEC-RAS\6.6\Ras.exe" -c "<repo>\examples\example_projects\Muncie\Muncie.prj" "<repo>\examples\example_projects\Muncie\Muncie.p01"
2026-06-11 15:41:14 - ras_commander.RasDialogWatchdog - INFO - DialogWatchdog started — polling every 1.5s for RAS dialog windows
Executing plan 01...
2026-06-11 15:41:27 - ras_commander.RasCmdr - INFO - HEC-RAS execution completed for plan: 01
2026-06-11 15:41:27 - ras_commander.RasCmdr - INFO - Total run time for plan 01: 13.66 seconds
2026-06-11 15:41:27 - ras_commander.RasDialogWatchdog - INFO - DialogWatchdog stopped — no dialogs encountered
Execution complete!
View Updated results_df¶
The results_df is automatically refreshed after execution.
# View updated results_df
print("\n=== After Execution ===")
cols = ['plan_number', 'hdf_exists', 'completed', 'has_errors', 'has_warnings']
print(ras.results_df[cols].to_string())
=== After Execution ===
plan_number hdf_exists completed has_errors has_warnings
0 03 False False False False
1 04 False False False False
2 01 True True False False
Inspect Plan 01 Details¶
# Get plan 01 results
plan_01 = ras.results_df[ras.results_df['plan_number'] == '01'].iloc[0]
print("=== Plan 01 Summary ===")
print(f"Plan Title: {plan_01['plan_title']}")
print(f"Flow Type: {plan_01['flow_type']}")
print(f"HDF File: {Path(plan_01['hdf_path']).name}")
print(f"HDF Modified: {plan_01['hdf_file_modified']}")
print(f"RAS Version: {plan_01['ras_version']}")
print(f"\nExecution Status:")
print(f" Completed: {plan_01['completed']}")
print(f" Has Errors: {plan_01['has_errors']}")
print(f" Error Count: {plan_01['error_count']}")
print(f" Has Warnings: {plan_01['has_warnings']}")
print(f" Warning Count: {plan_01['warning_count']}")
=== Plan 01 Summary ===
Plan Title: Unsteady Multi 9-SA run
Flow Type: Unsteady
HDF File: Muncie.p01.hdf
HDF Modified: 2026-06-11 15:41:27.584749
RAS Version: 5.00
Execution Status:
Completed: True
Has Errors: False
Error Count: 0
Has Warnings: False
Warning Count: 0
Runtime Performance Data¶
# Runtime data
print("=== Runtime Performance ===")
print(f"Simulation Start: {plan_01.get('runtime_simulation_start', 'N/A')}")
print(f"Simulation End: {plan_01.get('runtime_simulation_end', 'N/A')}")
print(f"Simulation Hours: {plan_01.get('runtime_simulation_hours', 'N/A')}")
print(f"Complete Process Hours: {plan_01.get('runtime_complete_process_hours', 'N/A')}")
print(f"Unsteady Compute Hours: {plan_01.get('runtime_unsteady_compute_hours', 'N/A')}")
print(f"Complete Process Speed: {plan_01.get('runtime_complete_process_speed', 'N/A'):.1f} hr/hr")
=== Runtime Performance ===
Simulation Start: 1900-01-02 00:00:00
Simulation End: 1900-01-03 00:00:00
Simulation Hours: 24.0
Complete Process Hours: 0.003450277777777778
Unsteady Compute Hours: 0.0026258333333333333
Complete Process Speed: 6956.0 hr/hr
Volume Accounting (Unsteady Only)¶
# Volume accounting data
vol_cols = [c for c in ras.results_df.columns if c.startswith('vol_')]
if vol_cols and plan_01['flow_type'] == 'Unsteady':
print("=== Volume Accounting ===")
for col in vol_cols:
value = plan_01.get(col, 'N/A')
# Format numbers nicely
if isinstance(value, (int, float)):
print(f"{col.replace('vol_', '')}: {value:,.4f}")
else:
print(f"{col.replace('vol_', '')}: {value}")
else:
print("No volume accounting data (steady flow or data not available)")
=== Volume Accounting ===
error: -0.27747151255607605
accounting_units: Acre Feet
error_percent: 0.0007499889470636845
flux_in: 36674.50390625
flux_out: 33463.0078125
starting: 322.2446594238281
ending: 3533.462646484375
Filter Plans by Execution Status¶
# Find executed plans
executed = ras.results_df[ras.results_df['hdf_exists']]
print(f"\nExecuted plans: {executed['plan_number'].tolist()}")
# Find completed plans
completed = ras.results_df[ras.results_df['completed']]
print(f"Completed plans: {completed['plan_number'].tolist()}")
# Find plans with errors
with_errors = ras.results_df[ras.results_df['has_errors']]
if len(with_errors) > 0:
print(f"Plans with errors: {with_errors['plan_number'].tolist()}")
else:
print("No plans with errors detected")
# Find plans pending execution
pending = ras.results_df[~ras.results_df['hdf_exists']]
print(f"Plans pending execution: {pending['plan_number'].tolist()}")
Executed plans: ['01']
Completed plans: ['01']
No plans with errors detected
Plans pending execution: ['03', '04']
Execute Multiple Plans in Parallel¶
# Execute remaining plans in parallel
pending_plans = ras.results_df[~ras.results_df['hdf_exists']]['plan_number'].tolist()
if pending_plans:
print(f"\nExecuting {len(pending_plans)} plans in parallel: {pending_plans}")
RasCmdr.compute_parallel(plan_number=pending_plans, max_workers=2, num_cores=2)
print("Parallel execution complete!")
else:
print("All plans already executed")
2026-06-11 15:41:27 - ras_commander.RasCmdr - INFO - Filtered plans to execute: ['03', '04']
2026-06-11 15:41:27 - ras_commander.RasCmdr - INFO - Adjusted max_workers to 2 based on the number of plans to compute: 2
2026-06-11 15:41:28 - ras_commander.RasCmdr - INFO - Created worker folder: <repo>\examples\example_projects\Muncie [Worker 1]
Executing 2 plans in parallel: ['03', '04']
2026-06-11 15:41:28 - ras_commander.RasMap - INFO - Successfully parsed RASMapper file: <repo>\examples\example_projects\Muncie [Worker 1]\Muncie.rasmap
2026-06-11 15:41:28 - ras_commander.RasPrj - INFO - ras-commander v0.98.0 | An open-source project of CLB Engineering Corporation (https://clbengineering.com/) | Docs: https://rascommander.info | GitHub: https://github.com/gpt-cmdr/ras-commander
2026-06-11 15:41:28 - ras_commander.RasPrj - INFO - Project initialized: Muncie | Folder: <repo>\examples\example_projects\Muncie [Worker 1]
2026-06-11 15:41:28 - ras_commander.RasPrj - INFO - Using HEC-RAS executable: C:\Program Files (x86)\HEC\HEC-RAS\6.6\Ras.exe
2026-06-11 15:41:28 - ras_commander.RasPrj - INFO -
═══════════════════════════════════════════════════════════════════════
ras-commander | HEC-RAS Automation Library
Docs: https://rascommander.info/
Repo: https://github.com/gpt-cmdr/ras-commander
═══════════════════════════════════════════════════════════════════════
PROJECT DATAFRAMES (single source of truth — use these, not file globbing):
ras_object.plan_df Plans, HDF paths, geometry/flow associations
ras_object.geom_df Geometry files and HDF preprocessor paths
ras_object.flow_df Steady flow files
ras_object.unsteady_df Unsteady flow files and configurations
ras_object.boundaries_df Boundary conditions (type, name, location)
ras_object.results_df Lightweight HDF results summaries
ras_object.rasmap_df RASMapper layers, terrain, land cover paths
KEY APIS (static classes — call directly, never instantiate):
Execution: RasCmdr.compute_plan() / compute_parallel() / compute_test_mode()
Plan Files: RasPlan.clone_plan() / clone_geom() / set_geom()
Unsteady: RasUnsteady — IC/BC management, gate openings, precipitation
Geometry: GeomCrossSection, GeomBridge, GeomStorage, GeomLateral, GeomMesh
HDF Results: HdfResultsPlan.get_wse() / get_compute_messages()
HdfResultsMesh.get_mesh_max_ws() / get_mesh_cells_timeseries()
HdfMesh.get_mesh_cell_points()
QA/QC: RasCheck.run_check() / RasFixit (geometry repair)
DSS: RasDss.get_timeseries() / check_pathname()
USGS: UsgsGaugeSpatial, GaugeMatcher, RasUsgsBoundaryGeneration
Precipitation: StormGenerator, Atlas14Storm, PrecipAorc, Atlas14Variance
Terrain: RasTerrain.create_terrain_hdf() / RasTerrainMod
MULTI-PROJECT: Pass ras_object= to all API calls when using local RasPrj instances.
EXAMPLES: 100+ notebooks in examples/ (100s=execution, 200s=geometry, 300s=unsteady,
400s=HDF results, 500s=remote, 800s=QA/QC, 900s=data integration).
Review relevant notebooks before assembling new workflows.
PLATFORM: Most HEC-RAS operations require Windows. Linux/Wine support for
headless execution, data access, geometry modification, and preprocessing
is available via RasProcess (HEC-RAS 6.6+). See ras_commander/RasProcess.py.
Remote distributed execution: ras_commander/remote/ (PsExec, Docker, SSH, cloud).
═══════════════════════════════════════════════════════════════════════
2026-06-11 15:41:28 - ras_commander.RasCmdr - INFO - Created worker folder: <repo>\examples\example_projects\Muncie [Worker 2]
2026-06-11 15:41:28 - ras_commander.RasMap - INFO - Successfully parsed RASMapper file: <repo>\examples\example_projects\Muncie [Worker 2]\Muncie.rasmap
2026-06-11 15:41:28 - ras_commander.RasPrj - INFO - ras-commander v0.98.0 | An open-source project of CLB Engineering Corporation (https://clbengineering.com/) | Docs: https://rascommander.info | GitHub: https://github.com/gpt-cmdr/ras-commander
2026-06-11 15:41:28 - ras_commander.RasPrj - INFO - Project initialized: Muncie | Folder: <repo>\examples\example_projects\Muncie [Worker 2]
2026-06-11 15:41:28 - ras_commander.RasPrj - INFO - Using HEC-RAS executable: C:\Program Files (x86)\HEC\HEC-RAS\6.6\Ras.exe
2026-06-11 15:41:28 - ras_commander.RasPrj - INFO -
═══════════════════════════════════════════════════════════════════════
ras-commander | HEC-RAS Automation Library
Docs: https://rascommander.info/
Repo: https://github.com/gpt-cmdr/ras-commander
═══════════════════════════════════════════════════════════════════════
PROJECT DATAFRAMES (single source of truth — use these, not file globbing):
ras_object.plan_df Plans, HDF paths, geometry/flow associations
ras_object.geom_df Geometry files and HDF preprocessor paths
ras_object.flow_df Steady flow files
ras_object.unsteady_df Unsteady flow files and configurations
ras_object.boundaries_df Boundary conditions (type, name, location)
ras_object.results_df Lightweight HDF results summaries
ras_object.rasmap_df RASMapper layers, terrain, land cover paths
KEY APIS (static classes — call directly, never instantiate):
Execution: RasCmdr.compute_plan() / compute_parallel() / compute_test_mode()
Plan Files: RasPlan.clone_plan() / clone_geom() / set_geom()
Unsteady: RasUnsteady — IC/BC management, gate openings, precipitation
Geometry: GeomCrossSection, GeomBridge, GeomStorage, GeomLateral, GeomMesh
HDF Results: HdfResultsPlan.get_wse() / get_compute_messages()
HdfResultsMesh.get_mesh_max_ws() / get_mesh_cells_timeseries()
HdfMesh.get_mesh_cell_points()
QA/QC: RasCheck.run_check() / RasFixit (geometry repair)
DSS: RasDss.get_timeseries() / check_pathname()
USGS: UsgsGaugeSpatial, GaugeMatcher, RasUsgsBoundaryGeneration
Precipitation: StormGenerator, Atlas14Storm, PrecipAorc, Atlas14Variance
Terrain: RasTerrain.create_terrain_hdf() / RasTerrainMod
MULTI-PROJECT: Pass ras_object= to all API calls when using local RasPrj instances.
EXAMPLES: 100+ notebooks in examples/ (100s=execution, 200s=geometry, 300s=unsteady,
400s=HDF results, 500s=remote, 800s=QA/QC, 900s=data integration).
Review relevant notebooks before assembling new workflows.
PLATFORM: Most HEC-RAS operations require Windows. Linux/Wine support for
headless execution, data access, geometry modification, and preprocessing
is available via RasProcess (HEC-RAS 6.6+). See ras_commander/RasProcess.py.
Remote distributed execution: ras_commander/remote/ (PsExec, Docker, SSH, cloud).
═══════════════════════════════════════════════════════════════════════
2026-06-11 15:41:28 - ras_commander.RasCmdr - INFO - Using ras_object with project folder: <repo>\examples\example_projects\Muncie [Worker 1]
2026-06-11 15:41:28 - ras_commander.RasCmdr - INFO - Using ras_object with project folder: <repo>\examples\example_projects\Muncie [Worker 2]
2026-06-11 15:41:28 - ras_commander.RasUtils - INFO - Successfully updated file: <repo>\examples\example_projects\Muncie [Worker 1]\Muncie.p03
2026-06-11 15:41:28 - ras_commander.RasUtils - INFO - Successfully updated file: <repo>\examples\example_projects\Muncie [Worker 2]\Muncie.p04
2026-06-11 15:41:28 - ras_commander.RasCmdr - INFO - Set number of cores to 2 for plan: 03
2026-06-11 15:41:28 - ras_commander.RasCmdr - INFO - Running HEC-RAS from the Command Line:
2026-06-11 15:41:28 - ras_commander.RasCmdr - INFO - Running command: "C:\Program Files (x86)\HEC\HEC-RAS\6.6\Ras.exe" -c "<repo>\examples\example_projects\Muncie [Worker 1]\Muncie.prj" "<repo>\examples\example_projects\Muncie [Worker 1]\Muncie.p03"
2026-06-11 15:41:28 - ras_commander.RasDialogWatchdog - INFO - DialogWatchdog started — polling every 1.5s for RAS dialog windows
2026-06-11 15:41:28 - ras_commander.RasCmdr - INFO - Set number of cores to 2 for plan: 04
2026-06-11 15:41:28 - ras_commander.RasCmdr - INFO - Running HEC-RAS from the Command Line:
2026-06-11 15:41:28 - ras_commander.RasCmdr - INFO - Running command: "C:\Program Files (x86)\HEC\HEC-RAS\6.6\Ras.exe" -c "<repo>\examples\example_projects\Muncie [Worker 2]\Muncie.prj" "<repo>\examples\example_projects\Muncie [Worker 2]\Muncie.p04"
2026-06-11 15:41:28 - ras_commander.RasDialogWatchdog - INFO - DialogWatchdog started — polling every 1.5s for RAS dialog windows
2026-06-11 15:42:07 - ras_commander.RasCmdr - INFO - HEC-RAS execution completed for plan: 03
2026-06-11 15:42:07 - ras_commander.RasCmdr - INFO - Total run time for plan 03: 39.05 seconds
2026-06-11 15:42:07 - ras_commander.RasDialogWatchdog - INFO - DialogWatchdog stopped — no dialogs encountered
2026-06-11 15:42:07 - ras_commander.RasCmdr - INFO - Plan 03 executed in worker 1: Successful
2026-06-11 15:42:08 - ras_commander.RasCmdr - INFO - HEC-RAS execution completed for plan: 04
2026-06-11 15:42:08 - ras_commander.RasCmdr - INFO - Total run time for plan 04: 39.75 seconds
2026-06-11 15:42:08 - ras_commander.RasDialogWatchdog - INFO - DialogWatchdog stopped — no dialogs encountered
2026-06-11 15:42:08 - ras_commander.RasCmdr - INFO - Plan 04 executed in worker 2: Successful
2026-06-11 15:42:08 - ras_commander.RasCmdr - INFO - Consolidating results back to original project folder: <repo>\examples\example_projects\Muncie
2026-06-11 15:42:12 - ras_commander.RasCmdr - INFO - Consolidated 10 worker artifact(s) to <repo>\examples\example_projects\Muncie
2026-06-11 15:42:12 - ras_commander.RasCmdr - INFO -
Execution Results:
2026-06-11 15:42:12 - ras_commander.RasCmdr - INFO - Plan 03: Successful
2026-06-11 15:42:12 - ras_commander.RasCmdr - INFO - Plan 04: Successful
Parallel execution complete!
View Complete Results Summary¶
# Complete results summary
print("\n=== Final Results Summary ===")
summary_cols = ['plan_number', 'plan_title', 'completed', 'has_errors',
'runtime_complete_process_hours', 'runtime_complete_process_speed']
print(ras.results_df[summary_cols].to_string())
# Statistics
executed = ras.results_df[ras.results_df['hdf_exists']]
print(f"\n=== Summary Statistics ===")
print(f"Total plans: {len(ras.results_df)}")
print(f"Executed: {len(executed)}")
print(f"Completed successfully: {executed['completed'].sum()}")
print(f"With errors: {executed['has_errors'].sum()}")
print(f"With warnings: {executed['has_warnings'].sum()}")
print(f"Total compute time: {executed['runtime_complete_process_hours'].sum():.4f} hours")
=== Final Results Summary ===
plan_number plan_title completed has_errors runtime_complete_process_hours runtime_complete_process_speed
0 01 Unsteady Multi 9-SA run True False 0.003450 6955.961678
1 03 Unsteady Run with 2D 50ft Grid True False 0.010321 2325.331037
2 04 Unsteady Run with 2D 50ft User n Value R True False 0.010521 2281.188119
=== Summary Statistics ===
Total plans: 3
Executed: 3
Completed successfully: 3
With errors: 0
With warnings: 0
Total compute time: 0.0243 hours
Manual results_df Update¶
You can manually refresh results_df for specific plans or all plans.
# Manually update results_df for specific plans
ras.update_results_df(plan_numbers=['01'])
print("Updated results for plan 01")
# Or update all plans
ras.update_results_df()
print("Updated results for all plans")
Updated results for plan 01
Updated results for all plans
Using ResultsSummary Directly¶
For most workflows, ras.results_df is the preferred interface.
If you need lower-level control, you can call ResultsSummary.summarize_plans()
directly with plan metadata records, such as ras.plan_df.to_dict('records').
from ras_commander.results import ResultsSummary
# Low-level summary generation from plan metadata records
plan_entries = ras.plan_df.to_dict('records')
direct_summary = ResultsSummary.summarize_plans(plan_entries, ras.project_folder)
display_cols = [
"plan_number",
"plan_title",
"flow_type",
"hdf_exists",
"completed",
"has_errors",
]
print(direct_summary[display_cols].to_string(index=False))
plan_number plan_title flow_type hdf_exists completed has_errors
01 Unsteady Multi 9-SA run Unsteady True True False
03 Unsteady Run with 2D 50ft Grid Unsteady True True False
04 Unsteady Run with 2D 50ft User n Value R Unsteady True True False
Using ResultsParser Directly¶
You can parse compute messages directly using ResultsParser.
from ras_commander.hdf import HdfResultsPlan
# Get compute messages for a plan
plan_01_row = ras.results_df[ras.results_df['plan_number'] == '01'].iloc[0]
hdf_path = Path(plan_01_row['hdf_path'])
if hdf_path.exists():
# Extract messages using HDF-only method (no RasControl locking)
messages = HdfResultsPlan.get_compute_messages_hdf_only(hdf_path)
print(f"Compute messages length: {len(messages)} characters")
print("\nFirst 300 characters:")
print(messages[:300])
# Parse for errors/warnings
parsed = ResultsParser.parse_compute_messages(messages)
print(f"\nParsed results:")
for key, value in parsed.items():
print(f" {key}: {value}")
Compute messages length: 2577 characters
First 300 characters:
Plan: 'Unsteady Multi 9-SA run' (Muncie.p01)
Simulation started at: 11Jun2026 03:41:15 PM
Writing Plan GIS Data...
Completed Writing Plan GIS Data
Writing Geometry...
Computing Bank Lines
Bank lines generated in 57 ms
Computing Edge Lines
Edge Lines generated in 34 ms
Computing XS Interp
Parsed results:
completed: True
has_errors: False
has_warnings: False
error_count: 0
warning_count: 0
first_error_line: None
Benefits of results_df¶
- Quick Status Checks: See execution status without opening HDF files
- Error Detection: Automatically detects errors in compute messages
- Performance Metrics: Runtime data and compute speeds available
- Volume Accounting: Mass balance data for unsteady models
- No Locking Issues: Uses HDF-only methods (no RasControl/COM)
- Automatic Updates: Refreshes after compute_plan(), compute_parallel(), compute_test_mode()
Cleanup¶
# Optional: Clean up extracted project
import shutil
example_projects = project_path.parent
if example_projects.name == "example_projects":
shutil.rmtree(example_projects, ignore_errors=True)
print(f"Cleaned up: {example_projects}")
Cleaned up: <repo>\examples\example_projects