Skip to content

ENH: cache downloaded atmosphere netCDF datasets (#654) - #1137

Open
thatrandomasiandev wants to merge 1 commit into
RocketPy-Team:developfrom
thatrandomasiandev:enh/654-cache-netcdf
Open

ENH: cache downloaded atmosphere netCDF datasets (#654)#1137
thatrandomasiandev wants to merge 1 commit into
RocketPy-Team:developfrom
thatrandomasiandev:enh/654-cache-netcdf

Conversation

@thatrandomasiandev

Copy link
Copy Markdown

Summary

  • Cache Forecast/Ensemble (and Reanalysis remote URLs) location-time profiles as compact .nc files under ~/.rocketpy_cache/atmosphere (override with ROCKETPY_CACHE).
  • Cache Windy JSON responses on the same path; second identical set_atmospheric_model calls reuse disk.
  • Add no_cache=False to Environment.set_atmospheric_model (and Windy processing) so callers can force a fresh download without breaking existing callers.

Notes / TODOs

OPeNDAP "Best" aggregations are virtual catalogs, not downloadable files, so this PR caches the extracted profiles RocketPy already materializes after the first fetch (same end-user outcome: reruns skip the network). Remaining follow-ups:

  • Open-Meteo / Meteomatics JSON response caching
  • Optional full-file download cache when a remote source is a concrete HTTP .nc (non-OPeNDAP)

Fixes #654

Test plan

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest tests/unit/environment/test_atmosphere_cache.py
  • Confirm Forecast shortcut reuses disk on rerun with same lat/lon/date
  • Confirm no_cache=True forces re-download

@thatrandomasiandev
thatrandomasiandev requested a review from a team as a code owner August 11, 2026 02:02
@Gui-FernandesBR Gui-FernandesBR linked an issue Aug 12, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Cache netcdf4 datasets to avoid multiple downloads

1 participant