Skip to content

mostlyright.core.schemas.forecast

Unified per-station forecast schema.

schema.forecast.station.v1 covers both IEM MOS rows and Open-Meteo rows in a single column set (IEM MOS rows carry source="iem.archive"). It registers via core/schemas/__init__.py.

The unified schema marks IEM MOS core columns (temp_c, dewpoint_c, etc.) as nullable because Open-Meteo may not provide all of them. Open-Meteo extras (apparent_temp_c, shortwave_radiation_wm2, cape_jkg, etc.) are always nullable — IEM MOS rows leave them null; Open-Meteo rows populate them.

Source discrimination is via the source column (e.g. iem.archive, open_meteo.previous_runs, open_meteo.live).

Temporal mapping (design.md §A):

  • event_time = valid_at
  • knowledge_time = issued_at
StationForecastSchema()schema.forecast.station.v1 — unified per-station forecast schema.

class mostlyright.core.schemas.forecast.StationForecastSchema

Section titled “class mostlyright.core.schemas.forecast.StationForecastSchema”

Bases: Schema

schema.forecast.station.v1 — unified per-station forecast schema.

Covers IEM MOS shared core + Open-Meteo extras. Source identity via the source column (iem.archive for IEM MOS rows). The canonical schema.forecast.station.v1 schema_id is the single id for both.

Imperial-mode renames apply to temperature, wind speed, and wind gusts. valid_at / issued_at / retrieved_at are model-internal timestamps and keep their canonical names.