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

Vendorize skimage #1091

Merged
merged 7 commits into from
Mar 18, 2021
Merged

Vendorize skimage #1091

merged 7 commits into from
Mar 18, 2021

Conversation

nbren12
Copy link
Contributor

@nbren12 nbren12 commented Mar 17, 2021

Scikit-image is a difficult dependency to manage (especially since it makes strong assumptions about pooch). Even an import of scikit-image mutates the users ~/.cache folder, which can lead to hard to debug permissions errors and other issues. We work around this via careful dependency pinning, but I still frequently run into this problem when e.g. updating versions. We only use two small functions from scikit-image, so it's easy to vendorize them in this repo.

We can reimplement this using xarray.coarsen at another time (see #1048).

Added public API:

  • vcm.testing.checksum_dataarray
  • vcm.testing.checksum_dataarray_mapping

Significant internal changes:

  • rewired the coarening tests to use regression checksums instead.

Requirement changes:

  • removed scikit-image
  • I would've liked to remove pooch too, but metpy uses it too, albeit only in one module that we probably don't import.

This is generally useful for regression testing with xarray data.
Previously, the block_reduce tested the  function by duplicating its
implementation. This refactors this test to test for regressions using
checksums.
Copy link
Member

@spencerkclark spencerkclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great this was so simple to vendor over. I just have a minor comment about the modification to the test of _xarray_block_reduce_dataarray.

external/vcm/tests/test_cubedsphere.py Show resolved Hide resolved
@nbren12 nbren12 enabled auto-merge (squash) March 18, 2021 16:53
@nbren12 nbren12 merged commit 2ef7137 into master Mar 18, 2021
@nbren12 nbren12 deleted the vendorize-skimage branch March 18, 2021 18:24
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.

2 participants