Conversation
- Add open_meteo.py with ensemble forecast fetching via Open-Meteo API - Add WEATHER_SOURCE, OPEN_METEO_MODEL, OPEN_METEO_ENSEMBLE_MEMBERS settings - Update dailyModelUpdate() to branch on WEATHER_SOURCE - Fix gefs.py: date bug, unbound variables, temp file leak, retrying→tenacity - Remove spurious Celery() instantiation from tasks.py - Fix bare open() encoding in tasks.py - Remove insecure SECRET_KEY and DB_PASSWORD defaults from settings.py - Update conda env: bump numpy/pandas/celery/django, drop xlrd/retrying, add tenacity/requests - Bump Dockerfile base images: node:lts-alpine, miniconda3 latest, debian:bookworm-slim - Bump black pre-commit hook to 24.10.0" Co-authored-by: simreaney <7837361+simreaney@users.noreply.github.com>
- Move defaultdict import to top of open_meteo.py - Fix Point(lat, lon) → Point(lon, lat) (GIS x/y convention) - Move gefsData.close() into finally block to prevent handle leak Co-authored-by: simreaney <7837361+simreaney@users.noreply.github.com>
Copilot
AI
changed the title
feat: Open-Meteo ensemble integration + security/bug fixes
feat: Open-Meteo ensemble integration, bug fixes, dependency updates, security hardening
Aug 7, 2026
Copilot created this pull request from a session on behalf of
simreaney
August 7, 2026 04:03
View session
…fety Co-authored-by: simreaney <7837361+simreaney@users.noreply.github.com>
simreaney
approved these changes
Aug 7, 2026
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.
Replaces the GEFS/pygrib weather pipeline with Open-Meteo ensemble forecasts (free, no API key), fixes several latent bugs in
gefs.pyandtasks.py, bumps stale/insecure dependencies, and removes hardcoded credential defaults.Open-Meteo ensemble integration
calculations/open_meteo.py— fetches all ensemble members fromhttps://ensemble-api.open-meteo.com/v1/ensemble, decomposes wind speed+direction into U/V components, derives daily min/max from hourly temperatures (stored in K for schema consistency), bulk-inserts intoNoaaForecastdailyModelUpdate()branches onWEATHER_SOURCEsetting ("open_meteo"default,"gefs"for legacy)WEATHER_SOURCE,OPEN_METEO_MODEL(defaultgfs_seamless),OPEN_METEO_ENSEMBLE_MEMBERS(0 = all)Bug fixes (
gefs.py,tasks.py)datetime.astimezone(obj, tz=...)→obj.astimezone(tz=...)(was raisingTypeErrorat runtime)Nonebefore loop; raisesValueErrornaming missing fields instead ofUnboundLocalErrortempfile.mkstemp()and deleted infinally;gefsData.close()also moved tofinallyapp = Celery()intasks.py(created a second Celery instance alongside the project-level one)open(filename)→open(filename, encoding="utf-8-sig")Dependencies (
config/manyFEWS.base.yml,Dockerfile)retrying(unmaintained since 2014) →tenacity;xlrd(.xls-only, deprecated) removednumpy>=1.24,<2,pandas>=2.0,celery>=5.4,django>=4.2,<5.1(LTS)requests,tenacitynode:alpine3.15→node:lts-alpine,miniconda3:4.12.0→ latest,debian:bullseye-slim→debian:bookworm-slimblackpre-commit:22.3.0→24.10.0Security
DB_PASSWORDandSECRET_KEYno longer have insecure hardcoded defaults — both are now required env vars (will raise at startup if unset)