Transparent file access with pooch or local override #264
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.
This allows overriding the
get_path
function for data files to use a local file instead of downloading from pooch. Simply define the env varSCIPP_OVERRIDE_DATA_DIR=/path/to/data
and it will return paths in that folder instead of downloading anything. The code in downstream packages only needs to be updated and use the newmake_registry
function.The override folder must have the same layout as the http server. I achieved that by symlinking
/dmsc/codeshelf/ci/ess
to/nfs/www/html/groups/scipp/ess
. So any files that we use in anyess.*
package should be accessible automatically.This is a binary setting, either all files are downloaded or all files are accessed locally. I did this to indicate to us if we forget to provide a file locally and it downloads the file instead which can lead to (flaky) timeouts.
See https://git.esss.dk/dram/code-shelf/code-shelf-template/-/merge_requests/7 for how it can be used on gitlab.
I tested this on a GitLab runner. Unfortunately, I could not get it to work automatically with a dev build of essreduce because I had conflicts between conda and pip packages. But I could get it to work in an interactive session with proper
pip install
hacks.