Skip to content
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

Add analogs notebook data to main branch #26

Merged
merged 1 commit into from Sep 12, 2023
Merged

Conversation

Zeitsperre
Copy link
Contributor

  • added a .md5 checksum file generated with make_check_sums.py

This dataset is typically fetched when running tests from the xclim master branch, but it should be available within main and subsequent tags for the sake of consistency.

@Zeitsperre Zeitsperre self-assigned this Sep 12, 2023
@Zeitsperre Zeitsperre merged commit 60cd0ac into main Sep 12, 2023
@Zeitsperre Zeitsperre deleted the spatial-analogs-nb branch September 12, 2023 19:41
@Zeitsperre Zeitsperre restored the spatial-analogs-nb branch September 12, 2023 19:47
@Zeitsperre
Copy link
Contributor Author

@Ouranosinc/xclim-core

In order to prevent the existing SDBA notebook tests from outright failing in a clean environment, I'll be keeping this branch open, at least for a few releases (or until 2024?).

As a reminder, all testing data fetched from branches should be merged to the main branch and tagged here before closing your pull requests in xclim.

See: https://xclim.readthedocs.io/en/stable/contributing.html#updating-testing-data for more information

Zeitsperre added a commit to Ouranosinc/xclim that referenced this pull request Sep 12, 2023
### What kind of change does this PR introduce?

* Adds `pytest-socket` to the testing dependencies, in order to block
HTTP requests
* Adds a new pytest marker `"requires_internet"` for tests that
absolutely depend on internet access.
* Fixed an error in the pytest configuration that impeded copying of
testing data to thread safe caches of workers (this should always
occur).
* Added handling for `pytest-socket`'s `SocketBlockedError` when
attempting to fetch md5 validation files for cached testing data.
* Added a `tox` modifier for running tests without internet access (`tox
-e offline`)
* Option to call `tox -e offline-prefetch` to run the data prefetching
command before sockets are disabled in `pytest` call.
* Added a build using Python3.10 to the GitHub Workflows that uses the
new `offline` modifier in the `tox` configuration.
* For better accuracy, the `tox -e black` recipe has been renamed to
`tox -e lint`, as this configuration already included several other linting checks.
* Added a CLI command (`$ xclim prefetch_testing_data`) for manually
calling the `populate_testing_data()` command with branch
(`--branch/-b`) options.
* Updated the testing data used in the `analogs.ipynb` notebook to use
the testing data now found in `Ouranosinc/xclim-testdata`'s main branch
(see: Ouranosinc/xclim-testdata#26)

`xclim` now has a dedicated CLI command for prefetching the
`Ouranosinc/xclim-testdata`:

```
$ xclim prefetch_testing_data
# or, for a specific testdata branch
$ xclim prefetch_testing_data --branch my_testdata_branch
```

Running `pytest` will still perform the fetching of data on first run if
the user does not have an `xclim-testdata` folder in their
platform-dependent cache location (`/home/$USER/.cache/xclim-testdata`
on Linux).

### Does this PR introduce a breaking change?

Yes:

* `tox` is now configured to pass positional arguments to the `pytest`
calls directly. This gives developers much more control when
selecting/deselecting `pytest` markers. To replicate previous behaviour
(skipping `slow` tests), most `tox` invocations should resemble the
following:

```
$ tox -e pyXYZ -- -m "not slow"
```

* `xclim` development now requires the `pytest-socket` plugin (has been
explicitly added to the development requirements). This plugin allows
developers to mimic being `offline` when testing new `xclim` features or
bug fixes, if they so choose.

* For better accuracy, the `tox -e black` recipe has been renamed to
`tox -e lint`, as this configuration already included several other linting checks.

### Other information:

https://github.com/miketheman/pytest-socket

https://tox.wiki/en/latest/config.html#substitutions-for-positional-arguments-in-commands
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.

None yet

2 participants