Usage¶
Installation¶
To use UrbanSurge, first install it using pip:
(.venv) $ pip install urbansurge
EPA SWMM¶
Load an EPA SWMM model with the urbansurge.swmm_model.SWMM class:
from urbansurge.swmm_model import SWMM
cfg_path = './swmm_model_cfg.yml' # Path to configuration file.
swmm = SWMM(cfg_path) # Create class instance.
swmm.configure_model() # Configure model.
swmm.run_simulation() # Run simulation.
Configuration File¶
Structure of an UrbanSurge SWMM configuration file.
# =================================================================
# Configuration file for model run.
# =================================================================
# Path to SWMM .inp file.
inp_path: ~/Path/to/swmm_model.inp
# Run from temporary .inp file. True or False.
temp_inp: True
# Verbosity. 0 or 1.
verbose: 1