Skip to content

Fetch ESMValTool recipes in advance#582

Merged
lewisjared merged 7 commits intoClimate-REF:mainfrom
bouweandela:fix-recipes-in-advance
Apr 11, 2026
Merged

Fetch ESMValTool recipes in advance#582
lewisjared merged 7 commits intoClimate-REF:mainfrom
bouweandela:fix-recipes-in-advance

Conversation

@bouweandela
Copy link
Copy Markdown
Contributor

@bouweandela bouweandela commented Mar 6, 2026

Description

Closes #468

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 97.67442% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...-ref-core/src/climate_ref_core/dataset_registry.py 96.42% 0 Missing and 1 partial ⚠️
Flag Coverage Δ
core 93.37% <96.42%> (+0.18%) ⬆️
providers 91.85% <100.00%> (+0.06%) ⬆️

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

Files with missing lines Coverage Δ
...-esmvaltool/src/climate_ref_esmvaltool/__init__.py 100.00% <100.00%> (ø)
...ool/src/climate_ref_esmvaltool/diagnostics/base.py 96.99% <100.00%> (+0.06%) ⬆️
...ef-esmvaltool/src/climate_ref_esmvaltool/recipe.py 86.61% <100.00%> (-0.21%) ⬇️
...-ref-core/src/climate_ref_core/dataset_registry.py 98.85% <96.42%> (-1.15%) ⬇️

... and 15 files with indirect coverage changes

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

@bouweandela bouweandela marked this pull request as ready for review March 6, 2026 17:01
@bouweandela bouweandela requested a review from lewisjared March 6, 2026 17:02
Comment thread packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/__init__.py Outdated
@lewisjared
Copy link
Copy Markdown
Contributor

I think this is ready, but I'll have to have a more careful think. I'll get this in the next release

Extract _resolve_cache_dir and _migrate_cache into DatasetRegistryManager
so registries can declare legacy cache directories. Files found at old
locations are moved to the new path on registration, avoiding
re-downloads after cache layout changes.

Wire up legacy_cache_dirs for ESMValTool datasets (previously flat under
os_cache("climate_ref")) and recipes (previously under
os_cache("climate_ref_esmvaltool")).

Also fix test_with_environment_variable for the empty-string env case.
Copy link
Copy Markdown
Contributor

@lewisjared lewisjared left a comment

Choose a reason for hiding this comment

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

The change in directory will cause users to need to redownload the data again. Informing users that a refetch (ref providers setup --provider esmvaltool) might be easier than trying to migrate the old cache. What do you think?

@lewisjared
Copy link
Copy Markdown
Contributor

It wasn't too bad to add a migration. This was required for the ilamb/pmp/sample-data registries.

The added benefit is that only the actively used files were moved to the right directory making it easy to clean up dead files

@lewisjared lewisjared merged commit 7fa0030 into Climate-REF:main Apr 11, 2026
23 checks passed
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.

ESMValTool requires access to the web to retrieve the recipes

2 participants