Redesign eeweather around a location-first, source-agnostic API - #104
Open
travis-recurve wants to merge 5 commits into
Open
Redesign eeweather around a location-first, source-agnostic API#104travis-recurve wants to merge 5 commits into
travis-recurve wants to merge 5 commits into
Conversation
travis-recurve
force-pushed
the
feature/architecture-reshape
branch
from
July 25, 2026 01:20
00a4ac4 to
a21982b
Compare
Normalized identifier/metadata/quality/summary/zone tables under registry/, reading packaged identifiers.db and geography packs; replaces database.py, geo.py, and the top-level summaries module. Signed-off-by: Travis Sikes <124101151+travis-recurve@users.noreply.github.com>
build/ downloads the current NOAA station list and inventory and writes the registry via migrate/refresh; station country comes from the source ISO_CODE, staleness is per source, and the in-place swap is crash-safe via a commit marker. Removes the ad-hoc download scripts. Signed-off-by: Travis Sikes <124101151+travis-recurve@users.noreply.github.com>
WeatherStation plus an engine routing GHCNh/TMY3/CZ2010 through one interface with runtime source and vocabulary registration, catalog-less estimation (grid) sources, and per-variable resampling; register() validates the per-kind contract and the engine NaN-fills missing feed columns. Replaces stations.py, ranking.py, the single-file ghcnh source, and the CLI. Signed-off-by: Travis Sikes <124101151+travis-recurve@users.noreply.github.com>
WeatherLocation resolves weather at a lat/lon through the configured sources (rejecting normals sources from the preference tuple), pins its station from provenance for reproducible replay, and serializes via to_dict/from_dict; the package exposes only WeatherLocation and WeatherStation. Signed-off-by: Travis Sikes <124101151+travis-recurve@users.noreply.github.com>
Adds docs/ (api, example, methodology, matching, adding-a-source incl. the grid-source contract, vocabulary); rewrites README/CONTRIBUTING/CHANGELOG and refreshes packaging and CI. Signed-off-by: Travis Sikes <124101151+travis-recurve@users.noreply.github.com>
travis-recurve
force-pushed
the
feature/architecture-reshape
branch
from
July 25, 2026 01:28
e7f5716 to
61b5649
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
master.pytest -o addopts= -p no:xdist).CHANGELOG.mdupdated under the Development section.docs/(the sphinx build is retired — thedocs/*.mdset is the source for the eeweather section of opendsm.energy).Signed-off-by.Description
A ground-up 1.0 redesign. This is a breaking release: the public API is not compatible with 0.3.x, so the change is consolidated rather than aliased. Delivered as five dependency-ordered commits (registry schema → rebuild/refresh → source-agnostic engine +
WeatherStation→WeatherLocation→ docs/packaging).WeatherLocation(latitude, longitude)(orWeatherLocation.from_place("zcta", code)) is the primary entry point: weather at a point, estimated by configurable sources.location.candidates()ranks nearby stations andlocation.zonesgives its climate zones.WeatherStationkeys on a station id when the station is already known.load_data(start, end, frequency, variables, source=)returns(DataFrame, warnings)with per-source provenance on the frame'sattrsand on the object. Each requested variable routes to the first configured source that serves it; typical-year sources ("tmy3","cz2010") are reachable only by an explicitsource=pin.usaf/wban/icao/wmoare aliases that translate to it (WeatherStation.from_usaf(...),translate(...),search(...)).eeweather.sources.register) — station feeds, normals, or location-keyed estimation (grid) sources — without changing the library.to_dict/to_json+from_dict/from_jsoncarry that state across processes, so a reporting-period load reuses the same station as its baseline.EEWEATHER_AUTO_UPDATE=0disables it. The in-place swap is crash-safe via a commit marker — readers fall back to the packaged pair if a swap is interrupted.Migration from 0.3.x
ISDStation(usaf_id)WeatherStation.from_usaf(usaf_id)(orWeatherStation(station_id))load_isd_hourly_temp_data(...)/load_isd_daily_temp_data(...)WeatherStation(...).load_data(start, end, frequency="h"/"D")load_cached_isd_*/load_cached_gsod_*load_data(..., fetch_from_web=False)load_cached_tmy3_*/load_cached_cz2010_*load_data(..., source="tmy3"/"cz2010")rank_stations(lat, lng, ...)WeatherLocation(lat, lng).candidates(...)combine_ranked_stations,select_stationeeweather.sources.matching)zcta_to_lat_long(zcta)+ rankingWeatherLocation.from_place("zcta", code)get_lat_long_climate_zones(lat, lng)WeatherLocation(lat, lng).zonesplot_station_mapping(...)Deferred / known limitations
register()accepts location-keyed estimation (Source) sources, but no built-in grid adapter ships in this PR, and gridded sources do not participate in station ranking (candidates()is station-only). International coverage via a gridded reanalysis source (ERA5 / MERRA-2) and wider GHCNh station admission are a follow-up source-expansion PR.python -m eeweather.registry.updateracing it is the unguarded case. Readers stay consistent regardless (the commit marker never certifies a torn pair).refresh-registryworkflow advances it, and a few registry-count test pins move with it by design.Validation
306 tests, fully offline (the suite fails any unmocked network call). Engine behavior, parsers, resampling, the update state machine, and registry invariants are pinned to real captured values, not just shapes. GHCNh's equivalence to the retired ISD/GSOD feeds was established by the overlap validation in the preceding migration (#103).