pub struct SeasonMap {
pub cycle_type: SeasonCycleType,
pub seasons: Vec<SeasonDefinition>,
}Expand description
Complete season definitions including cycle type and all season entries.
The SeasonMap is the resolved representation of the season_definitions
section in stages.json. It provides the season-to-calendar mapping
consumed by the PAR model and inflow history aggregation.
Source: stages.json season_definitions.
See Input Scenarios §1.1.
Fields§
§cycle_type: SeasonCycleTypeCycle type controlling how season IDs map to calendar periods.
seasons: Vec<SeasonDefinition>Season entries sorted by id. Length depends on cycle_type:
12 for Monthly, 52 for Weekly, user-defined for Custom.
Implementations§
Source§impl SeasonMap
impl SeasonMap
Sourcepub fn season_for_date(&self, date: NaiveDate) -> Option<usize>
pub fn season_for_date(&self, date: NaiveDate) -> Option<usize>
Resolve a calendar date to a season ID using the cycle definition.
This mapping is purely calendar-based and does not depend on the study horizon — a date from 1931 maps to the same season as a date from 2026 if they share the same calendar position. This is essential for PAR model estimation from historical inflow data that predates the study.
Returns None only for Custom cycle types where the date does not
fall within any defined season range.