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 a CI that tests xarray with all optional dependencies but dask #3919

Merged
merged 9 commits into from
Apr 3, 2020

Conversation

keewis
Copy link
Collaborator

@keewis keewis commented Mar 29, 2020

Was using the py38 environment the correct choice? I'm also not sure if adding a new CI was as simple as adding two lines, but that's something I will see once the CI runs 😁

Edit: dask, dask-core and distributed get pulled in by other packages, so it seems there is a bit more investigation necessary.

  • Closes all-dependencies-but-dask CI #3794
  • Tests added
  • Passes isort -rc . && black . && mypy . && flake8
  • Fully documented, including whats-new.rst for all changes and api.rst for new API

@max-sixty
Copy link
Collaborator

Doesn't py3.6-bare-minimum cover this? Or you're thinking something that has more optional dependencies but not dask?

@keewis
Copy link
Collaborator Author

keewis commented Mar 29, 2020

yes, exactly. There were a few issues we did not detect because there are code paths that are only chosen if dask is not available at all. See #3794 for a list of a few of these issues.

@keewis keewis changed the title add a CI that tests xarray without dask add a CI that tests xarray with all optional dependencies but dask Mar 29, 2020
@keewis
Copy link
Collaborator Author

keewis commented Mar 29, 2020

seems iris was the culprit that pulled in dask so I removed it.

I also renamed the CI to py38-all-but-dask but I'm not really confident in my naming abilities. If someone has a better idea I'd be happy to use that instead.

@max-sixty
Copy link
Collaborator

Ha, the naming is good!

@max-sixty
Copy link
Collaborator

This may be related: #1923

@keewis
Copy link
Collaborator Author

keewis commented Mar 29, 2020

it is related, but this PR has a different set of failures: there are a lot of zarr related failures, two rasterio and one pseudonetcdf failure and also a sparse chunking failure. The sparse test and one of the rasterio tests obviously need to be decorated with requires_dask, but I don't know about the others.

@keewis
Copy link
Collaborator Author

keewis commented Mar 30, 2020

the non-serializable lock from the failing rasterio test is from

try:
from dask.utils import SerializableLock
except ImportError:
# no need to worry about serializing the lock
SerializableLock = threading.Lock

which means the assumption that if we don't use dask we don't need to worry about serialization is incorrect (or the rasterio code uses the serializable lock in unintended ways)?

Also, the chunks parameter of open_zarr defaults to "auto", meaning it tries to chunk by default, even if dask is not available. Should we check the availability of dask and overwrite chunks="auto" with chunks=None if we can't import dask? This would reduce the number of failing zarr tests from 98 to 2. Edit: see fa37ee6

@keewis
Copy link
Collaborator Author

keewis commented Mar 30, 2020

a bit more progress:

return array.vindex[
indexing._arrayize_vectorized_indexer(key.tuple, self.shape).tuple
]

_arrayize_vectorized_indexer accepts an indexer, so we should pass key directly.

This exposes a different error: plain zarr does not seem to support negative step sizes (zarr+dask seem fine with it, though).

@keewis
Copy link
Collaborator Author

keewis commented Mar 30, 2020

it seems the slices get transformed differently depending on the data: for numpy arrays, slice(-1, 1, -1) is transformed into slice(9, 1, -1) where for dask arrays slice(-1, 1, -1) becomes something without a negative step (not sure how that looks, though).

I'd xfail these tests since I think they're bugs and open issues for them.

@keewis
Copy link
Collaborator Author

keewis commented Mar 30, 2020

I don't think I can figure out how to fix the remaining three tests. Is it okay to have the fixes for open_zarr and ZarrArrayWrapper.__getitem__ in this PR?

If it is, this should be ready for review & merge.

@max-sixty
Copy link
Collaborator

Perfect, LGTM! Thank you @keewis

@dcherian dcherian merged commit 8a1c933 into pydata:master Apr 3, 2020
@dcherian
Copy link
Contributor

dcherian commented Apr 3, 2020

Thanks @keewis. Clearly this is a useful test config to add!

@keewis keewis deleted the all-but-dask-ci branch April 3, 2020 20:32
dcherian added a commit to dcherian/xarray that referenced this pull request Apr 5, 2020
* master:
  Use divergent colormap if lowest and highest level span 0 (pydata#3913)
  Bugfix for plotting transposed 2d coords (pydata#3934)
  Allow plotting bool data (pydata#3766)
  facetgrid: fix case when vmin == vmax (pydata#3916)
  add a CI that tests xarray with all optional dependencies but dask (pydata#3919)
  Add missing_dims argument allowing isel() to ignore missing dimensions (pydata#3923)
  Only fail if a specific warning occurs (pydata#3930)
  Fix minor code quality issues (pydata#3626)
  Fix for stack+groupby+apply w/ non-increasing coord (pydata#3906)
  reactivate the macos CI (pydata#3920)
  add pint to the output of show_versions() (pydata#3918)
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.

all-dependencies-but-dask CI
3 participants