Skip to content

Add zenodo mirroring - #297

Merged
adybbroe merged 4 commits into
pytroll:mainfrom
pnuu:feature-add-zenodo-mirroring
Sep 21, 2026
Merged

adybbroe merged 4 commits into
pytroll:mainfrom
pnuu:feature-add-zenodo-mirroring

Conversation

@pnuu

@pnuu pnuu commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

I've had problems with Zenodo throttling/blocking download of the lookup tables and spectral responses when multiple of my containers are updating at the same time. So I asked Claude for a way to mirror the files somewhere else. I haven't yet reviewed the changes.

Oh, and also preliminary AGENTS.md is here. It just desribes the repository structure.

  • Closes #xxxx
  • Tests added
  • Tests passed: Passes pytest pyspectral
  • Passes flake8 pyspectral
  • Fully documented
  • Add your name to AUTHORS.md if not there already

lahtinep and others added 2 commits September 18, 2026 13:40
The relative spectral responses and the atmospheric correction LUTs are
downloaded from zenodo.org. When many processing chains download them at
about the same time the upstream host may start limiting the traffic, and
the downloads fail.

Add the possibility to mirror the data on a web location of one's own:

* The 'PSP_DATA_BASE_URL' environment variable, or the 'download_base_url'
  configuration option that it overrides, gives the base URL to download
  from instead of zenodo.org.
* The new 'mirror_pyspectral_data.py' script, and the 'mirror_data'
  function behind it, download the tarballs into the directory layout such
  a mirror is expected to serve. The data version is part of the path, so
  one mirror can serve several versions of the data at the same time, and
  mirroring a new version does not disturb installations still using an
  older one. Only missing files are downloaded, so the script can be re-run
  from cron.

The URLs are now built by 'get_rsr_url' and 'get_rayleigh_lut_url' rather
than taken from the module level constants, which keep the zenodo.org
locations used when no mirror is configured. There is deliberately no
fallback to zenodo.org when a mirror fails, as that would defeat the
purpose and hide a broken mirror.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pnuu pnuu self-assigned this Sep 18, 2026
@pnuu pnuu changed the title Feature add zenodo mirroring Add zenodo mirroring Sep 18, 2026
@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.77%. Comparing base (7a61fdf) to head (5528332).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #297      +/-   ##
==========================================
+ Coverage   91.17%   91.77%   +0.60%     
==========================================
  Files          25       25              
  Lines        2673     2868     +195     
==========================================
+ Hits         2437     2632     +195     
  Misses        236      236              
Flag Coverage Δ
unittests 91.77% <100.00%> (+0.60%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

lahtinep and others added 2 commits September 18, 2026 14:23
The URL the relative spectral responses and the atmospheric correction
LUTs are downloaded from was logged at debug level only, so a chain
running at info level showed where the data were stored but not where
they came from. With a mirror configurable through 'PSP_DATA_BASE_URL'
this matters: an operator could not tell from normal logs whether the
mirror or zenodo.org was actually used.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pnuu

pnuu commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

I have also verified this to work with Trollflow2 chains. I've used the new download script to fetch the Rayleigh LUTs and RSRs to localhost, copied them over to a S3 bucket and referenced the location via HTTPS in PSP_DATA_BASE_URL environment variable.

@adybbroe adybbroe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for adding this feature. And thanks for testing it also in a real-time setup. Much appreciated.
LGTM.

@adybbroe
adybbroe merged commit baebebb into pytroll:main Sep 21, 2026
17 checks passed
@pnuu
pnuu deleted the feature-add-zenodo-mirroring branch September 21, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants