-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use pooch #1889
Use pooch #1889
Conversation
Note It appears that this Pull Request modifies the On inspection, the No further action is required. |
## Overview This PR updates the cloning of the xclim-testdata repo to reflect structural changes. ## Changes **Non-breaking changes** - Adjusts the location of the xclim-testdata data folder ## Related Issue / Discussion - Ouranosinc/xclim-testdata#29 - Ouranosinc/xclim#1889 ## CI Operations <!-- The test suite can be run using a different DACCS config with ``birdhouse_daccs_configs_branch: branch_name`` in the PR description. To globally skip the test suite regardless of the commit message use ``birdhouse_skip_ci`` set to ``true`` in the PR description. Note that using ``[skip ci]``, ``[ci skip]`` or ``[no ci]`` in the commit message will override ``birdhouse_skip_ci`` from the PR description. --> birdhouse_daccs_configs_branch: master birdhouse_skip_ci: false
…lpers.open_dataset
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
THe only change on user side is that I tried reviewing the code but there is a lot of things I don't really understand, my approval would not be much better than rubber stamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Thanks.
A suggestion and yet again a nitpicky comment on the changelog ;).
Pull Request Checklist:
pooch
and cleanup testing data xclim-testdata#29number
) and pull request (:pull:number
) has been addedWhat kind of change does this PR introduce?
pooch
._get()
).pooch
, while maintaining a relatively unchanged API for users.Does this PR introduce a breaking change?
Absolutely.
get_file
andopen_dataset
no longer fetch remote files from GitHub. Instead, a locally-storedregistry.txt
file contains all the checksums of all files needed to run the tests and returns the appropriate file from a locally-held cache. If the file checksum does not match the expected value, it will attempt to replace it from the remote storage.Additionally, the
md5
files that accompanied all testing data files are now obsolete thanks to the use of the registry. The testing data is now versioned according to thexclim-testdata
version/tag.All the
prefetch
logic baked into thepytest
calls has been removed, making the setup code much easier to follow. There is no longer a need to run$ xclim prefetch_testing_data
unless users are running on Windows (for the very first run ofpytest
only).There are now three environment variables to help developers:
xclim-testdata
.xclim-testdata
(for forks)platformdirs
is no longer a hard dependency. The default cache directory will only be determined ifpooch
is installed.Other information:
There is still a lot of potential here to tighten this up; I'd like to land on a design that is clean and easily portable to other projects.
What is unchanged is that
pytest
will still do the following on every run:pytest
creates its own copy of the test data, which is delivered by its ownpooch
instance, written to a threadsafe temporary directoryget_file()
fixture is nownimbus.fetch()
, providing the absolute paths to files, respective of platform and workers.Many tests related to testing the file accessors have been removed (as these are now out of scope), but I'd like to test the implementation a bit before merging this (for both coverage and peace of mind).