plan¶
Read/write HEC-RAS plan files (.p**).
- class rivia.model.plan.Plan(path)[source]¶
Bases:
objectParser and editor for a HEC-RAS plan file.
Reads the file into memory once, exposes typed properties for commonly changed fields, and writes back to the source path via
save().Unknown lines and lines without an
=(e.g.Subcritical Flow) are preserved verbatim so round-trips are faithful.- Parameters:
path (str | Path)
- property computation_interval: str | None¶
Computation time step, e.g.
"2MIN","30SEC".Key:
Computation Interval=
- get(key)[source]¶
Return the raw stripped value for key, or
Noneif absent/empty.Use this for fields not exposed as typed properties.
- property instantaneous_interval: str | None¶
Instantaneous output interval (
Instantaneous Interval=).Returns
Noneif not present in the plan file.
- property is_quasi_steady: bool¶
True if this is a quasi-steady flow plan.
Determined by
Flow File=extension starting withq.
- property is_sediment: bool¶
True if this plan includes a sediment file.
Determined by
Sediment File=being present.
- property is_steady: bool¶
True if this is a steady flow plan.
Determined by
Flow File=extension starting withf.
- property is_unsteady: bool¶
True if this is an unsteady flow plan.
Determined by
Flow File=extension starting withu.
- property is_water_quality: bool¶
True if this plan includes a water quality file.
Determined by
Water Quality File=being present.
- property mapping_interval: str | None¶
Mapping output interval (
Mapping Interval=).Returns
Noneif not present in the plan file.
- property program_version: str | None¶
HEC-RAS version that wrote this plan (
Program Version=).Treat as read-only; HEC-RAS manages this field.
- set(key, value)[source]¶
Set key to value verbatim.
Raises
KeyErrorif the key does not already exist in the file. Use this for fields not exposed as typed properties.
- property simulation_window: tuple[tuple[str, str], tuple[str, str]] | None¶
Simulation start and end as
((date, time), (date, time)).Each date is
"DDMONYYYY"and each time is"HHMM"(e.g.(("18FEB1999", "0000"), ("20FEB1999", "2400"))). ReturnsNoneif the key is absent.
- property theta_warmup: float | None¶
1-D implicit weighting factor during warmup (
UNET Theta Warmup=).
- property water_quality_file: str | None¶
Water quality file extension reference, e.g.
w01(Water Quality File=).