feat(nws, normalizers): add NWS hourly forecast normalization and enforce canonical float rounding
- Implement full NWS hourly forecast normalizer (raw.nws.hourly.forecast.v1 → weather.forecast.v1) - Add GeoJSON forecast types and helpers for NWS gridpoint hourly payloads - Normalize temperatures, winds, humidity, PoP, and infer WMO condition codes from forecast text/icons - Treat forecast IssuedAt as EffectiveAt for stable, dedupe-friendly event IDs - Introduce project-wide float rounding at normalization finalization - Round all float values in canonical payloads to 2 decimal places - Apply consistently across pointers, slices, maps, and nested structs - Preserve opaque structs (e.g., time.Time) unchanged - Add SchemaRawNWSHourlyForecastV1 and align schema matching/comments - Clean up NWS helper organization and comments - Update documentation to reflect numeric wire-format and normalization policies This establishes a complete, deterministic hourly forecast pipeline for NWS and improves JSON output stability across all canonical weather schemas.
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
---
|
||||
sources:
|
||||
- name: NWSObservationKSTL
|
||||
kind: observation
|
||||
driver: nws_observation
|
||||
every: 12m
|
||||
params:
|
||||
url: "https://api.weather.gov/stations/KSTL/observations/latest"
|
||||
user_agent: "HomeOps (eric@maximumdirect.net)"
|
||||
# - name: NWSObservationKSTL
|
||||
# kind: observation
|
||||
# driver: nws_observation
|
||||
# every: 12m
|
||||
# params:
|
||||
# url: "https://api.weather.gov/stations/KSTL/observations/latest"
|
||||
# user_agent: "HomeOps (eric@maximumdirect.net)"
|
||||
|
||||
- name: OpenMeteoObservation
|
||||
kind: observation
|
||||
driver: openmeteo_observation
|
||||
every: 12m
|
||||
params:
|
||||
url: "https://api.open-meteo.com/v1/forecast?latitude=38.6239&longitude=-90.3571¤t=temperature_2m,relative_humidity_2m,weather_code,wind_speed_10m,wind_direction_10m,precipitation,surface_pressure,rain,showers,snowfall,cloud_cover,apparent_temperature,is_day,wind_gusts_10m,pressure_msl&forecast_days=1"
|
||||
user_agent: "HomeOps (eric@maximumdirect.net)"
|
||||
# - name: OpenMeteoObservation
|
||||
# kind: observation
|
||||
# driver: openmeteo_observation
|
||||
# every: 12m
|
||||
# params:
|
||||
# url: "https://api.open-meteo.com/v1/forecast?latitude=38.6239&longitude=-90.3571¤t=temperature_2m,relative_humidity_2m,weather_code,wind_speed_10m,wind_direction_10m,precipitation,surface_pressure,rain,showers,snowfall,cloud_cover,apparent_temperature,is_day,wind_gusts_10m,pressure_msl&forecast_days=1"
|
||||
# user_agent: "HomeOps (eric@maximumdirect.net)"
|
||||
|
||||
- name: OpenWeatherObservation
|
||||
kind: observation
|
||||
driver: openweather_observation
|
||||
every: 12m
|
||||
params:
|
||||
url: "https://api.openweathermap.org/data/2.5/weather?lat=38.6239&lon=-90.3571&appid=c954f2566cb7ccb56b43737b52e88fc6&units=metric"
|
||||
user_agent: "HomeOps (eric@maximumdirect.net)"
|
||||
# - name: OpenWeatherObservation
|
||||
# kind: observation
|
||||
# driver: openweather_observation
|
||||
# every: 12m
|
||||
# params:
|
||||
# url: "https://api.openweathermap.org/data/2.5/weather?lat=38.6239&lon=-90.3571&appid=c954f2566cb7ccb56b43737b52e88fc6&units=metric"
|
||||
# user_agent: "HomeOps (eric@maximumdirect.net)"
|
||||
|
||||
# - name: NWSObservationKSUS
|
||||
# kind: observation
|
||||
@@ -48,13 +48,13 @@ sources:
|
||||
# url: "https://api.weather.gov/gridpoints/LSX/90,74/forecast"
|
||||
# user_agent: "HomeOps (eric@maximumdirect.net)"
|
||||
|
||||
# - name: NWSHourlyForecastSTL
|
||||
# kind: forecast
|
||||
# driver: nws_forecast
|
||||
# every: 1m
|
||||
# params:
|
||||
# url: "https://api.weather.gov/gridpoints/LSX/90,74/forecast/hourly"
|
||||
# user_agent: "HomeOps (eric@maximumdirect.net)"
|
||||
- name: NWSHourlyForecastSTL
|
||||
kind: forecast
|
||||
driver: nws_forecast
|
||||
every: 1m
|
||||
params:
|
||||
url: "https://api.weather.gov/gridpoints/LSX/90,74/forecast/hourly"
|
||||
user_agent: "HomeOps (eric@maximumdirect.net)"
|
||||
|
||||
# - name: NWSAlertsSTL
|
||||
# kind: alert
|
||||
@@ -76,7 +76,7 @@ sinks:
|
||||
|
||||
routes:
|
||||
- sink: stdout
|
||||
kinds: ["observation"]
|
||||
kinds: ["observation", "forecast", "alert"]
|
||||
|
||||
# - sink: logfile
|
||||
# kinds: ["observation", "alert", "forecast"]
|
||||
|
||||
Reference in New Issue
Block a user