Skip to content

mostlyright.weather.spine

Internal per-settlement-day weather spine constructor.

days(stations, from_date, to_date, *, tz_override=None) mints the settlement calendar for one or more weather stations and returns a bare spine (entity = station, a per-LST-settlement-day decision_time, no y columns). It is the single domain spine constructor that the weather.label.* factories build on, so the settlement calendar cannot drift between research and live. This module is internal: there is no public weather.days() verb; training_table() and the label factories are the public entry points.

  • Two positional dates, inclusive ends: days('KNYC', '2025-01-01', '2025-01-03') enumerates 3 settlement days.
  • “tz_override“ moves the settlement calendar, so the same day resolves a different decision_time instant (the market-close UTC time for that station’s LST calendar).
  • A list of “stations=“ returns a long-format panel: per-station calendars concatenated with the station column first. Rows key by entity, so there is no cross-station bleed.

The constructor mints the calendar for the stations the caller names — it is the caller’s responsibility that the named stations existed across the window.

FunctionDescription
days(stations, from_date, to_date, *[, …])Return a bare per-LST-settlement-day spine for stations.

mostlyright.weather.spine.days(stations, from_date, to_date, , tz_override=None)

Section titled “mostlyright.weather.spine.days(stations, from_date, to_date, , tz_override=None)”

Return a bare per-LST-settlement-day spine for stations.

  • Parameters:
    • stations (str | list[str] | tuple[str, …]) – A single station id ("KNYC") or a list of ids (["KNYC", "KLGA"] → a long-format panel).
    • from_date (DateLike) – Inclusive window (two positional dates). Accepts a DateLike — an ISO YYYY-MM-DD string, a date, or a UTC-aware datetime — matching every sibling verb. A bad type raises ContractError.
    • to_date (DateLike) – Inclusive window (two positional dates). Accepts a DateLike — an ISO YYYY-MM-DD string, a date, or a UTC-aware datetime — matching every sibling verb. A bad type raises ContractError.
    • tz_override (str | None) – IANA timezone override for the settlement calendar — moves the decision_time instant.
  • Return type: pd.DataFrame
  • Returns: A DataFrame with station (the resolver’s canonical ICAO — "KNYC" for a "KNYC" or "NYC" input; the same 4-letter join key every source frame, observations(), and the training_table() output carries, so align’s equality join matches), local_standard_date (the ISO local standard day, the equality-join key sources attach on), and decision_time (the market-close UTC instant for that settlement day). No y columns — this is a bare spine. An out-of-registry station (the tz_override path) keeps its id as typed.