-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing data fetching via pooch (#62)
### What kind of change does this PR introduce? * Added `pooch` as a hard dependency (this can be revisited) * Added `xhydro.testing.helpers.py` and `xhydro.testing.registry.txt` * Added functions: * `generate_registry`: Parses data found in package (`xhydro.testing.data`), and adds it to the `registry.txt` * `load_registry`: Loads installed (or custom) registry and returns dictionary * `populate_testing_data`: Fetches the registry and optionally caches files at a different location (helpful for `pytest-xdist`) * Added a pre-commit hook for validating NumPy docstrings, fixed a few docstrings. ### Does this PR introduce a breaking change? Yes. Testing data management is largely handled at the environment variable level: * `XHYDRO_DATA_DIR` can be used to override the default cache location set for `pooch` (on *nix: `$XDG_CACHE_HOME`; Must be an absolute path) * `XHYDRO_TESTDATA_BRANCH` can be used to override the branch that the testing data should be fetched from (default: `main`). ### Other information: https://www.fatiando.org/pooch/latest/sample-data.html Based on a similar approach taken for: https://github.com/Ouranosinc/xclim-testdata Typically, the loaded `pooch` registries are given dog names, so I landed on `DEVEREAUX` as an appropriate name for this project.
- Loading branch information
Showing
13 changed files
with
306 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ setenv = | |
PYTHONPATH = {toxinidir} | ||
passenv = | ||
CI | ||
ESMFMKFILE | ||
COVERALLS_* | ||
GITHUB_* | ||
extras = | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
"""Helpers for testing.""" | ||
"""Testing utilities and helper functions.""" | ||
|
||
from .helpers import * | ||
from .utils import * |
Oops, something went wrong.