Basin Models¶
Working with HEC-HMS basin model files (.basin) - subbasins, junctions, reaches, and parameters.
Overview¶
The HmsBasin class provides methods for reading and modifying basin model files. All operations work directly with HMS text files using static methods.
Quick Examples¶
Get Subbasins¶
from hms_commander import HmsBasin
# Read all subbasins
subbasins_df = HmsBasin.get_subbasins("path/to/model.basin")
print(subbasins_df)
Modify Loss Parameters¶
Clone Basin (Non-Destructive)¶
# Create new basin from template
HmsBasin.clone_basin(
template="ExistingBasin",
new_name="UpdatedBasin",
description="Modified parameters for sensitivity analysis"
)
Key Operations¶
- Read elements -
get_subbasins(),get_junctions(),get_reaches() - Get parameters -
get_loss_parameters(),get_transform_parameters(),get_routing_parameters() - Set parameters -
set_loss_parameters()and other setters - Clone workflow -
clone_basin()for non-destructive modifications
LLM Forward Principles¶
Basin operations follow the LLM Forward approach: - ✅ GUI Verifiable - Changes visible in HEC-HMS GUI - ✅ Non-Destructive - Clone operations preserve originals - ✅ Traceable - Parameter changes logged
Related Topics¶
- API Reference: HmsBasin - Complete method documentation
- Clone Workflows - Non-destructive modification patterns
- Data Formats: Basin File - HMS .basin file format
For complete API documentation, see HmsBasin API Reference