Add examples.load
function for easily loading any example dataset
#7635
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.
Overview
New general function for loading any example dataset. The main benefit of this function is that it can load the dataset and return the file path(s) in a single function call. This is unlike
download_<name>
, which requires two separate calls (one for the mesh, one for the file). In addition, since this uses the dataset loader class internally, it reliably returns all files used for loading the example, which is not the case for theload=False
option, which usually only returns a single path.A key motivator for this is #7624 ... to make that work I think we need to use a file lock on all files to prevent multiple workers from accessing the same file at the same time. And to do this, we need all file paths.