Skip to content
forked from pydata/xarray

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into groupby-repr
Browse files Browse the repository at this point in the history
* upstream/master:
  CI test suites with pinned minimum dependencies (pydata#3346)
  Bugfix/plot accept coord dim (pydata#3345)
  CI environments overhaul (pydata#3340)
  • Loading branch information
dcherian committed Sep 26, 2019
2 parents 5e574f0 + 16fdac9 commit d8422c0
Show file tree
Hide file tree
Showing 17 changed files with 184 additions and 98 deletions.
22 changes: 7 additions & 15 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ jobs:
- job: Linux
strategy:
matrix:
py35-min:
conda_env: py35-min
py35-bare-minimum:
conda_env: py35-bare-minimum
py36-min-all-deps:
conda_env: py36-min-all-deps
py36-min-nep18:
conda_env: py36-min-nep18
py36:
conda_env: py36
py37:
conda_env: py37
py37-upstream-dev:
conda_env: py37
upstream_dev: true
py36-flakey:
py36-flaky:
conda_env: py36
pytest_extra_flags: --run-flaky --run-network-tests
allow_failure: true
Expand Down Expand Up @@ -90,15 +94,3 @@ jobs:
cd doc
sphinx-build -n -j auto -b html -d _build/doctrees . _build/html
displayName: Build HTML docs
- job: LinuxHypothesis
variables:
conda_env: py36-hypothesis
pool:
vmImage: 'ubuntu-16.04'
steps:
- template: ci/azure/install.yml
- bash: |
source activate xarray-tests
pytest properties
displayName: Property based tests
2 changes: 1 addition & 1 deletion ci/azure/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ steps:
# https://github.com/microsoft/azure-pipelines-tasks/issues/9302
- bash: |
source activate xarray-tests
pytest xarray \
pytest \
--junitxml=junit/test-results.xml \
--cov=xarray \
--cov-report=xml \
Expand Down
File renamed without changes.
29 changes: 0 additions & 29 deletions ci/requirements/py36-hypothesis.yml

This file was deleted.

43 changes: 43 additions & 0 deletions ci/requirements/py36-min-all-deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: xarray-tests
channels:
- conda-forge
dependencies:
- python=3.6.7
- black
- boto3=1.9.235
- bottleneck=1.2.1
- cdms2=3.1.3
- cfgrib=0.9.7.2
- cftime=1.0.3.4
- coveralls
- dask=2.4.0
- distributed=2.4.0
- flake8
- h5netcdf=0.7.4
- h5py=2.10.0
- hdf5=1.10.5
- hypothesis
- iris=2.2.0
- lxml=4.4.1 # optional dep of pydap
- matplotlib=3.1.1
- mypy==0.720 # Must match .pre-commit-config.yaml
- nc-time-axis=1.2.0
- netcdf4=1.5.1.2
- numba=0.45.1
- numpy=1.17.2
- pandas=0.25.1
- pip
- pseudonetcdf=3.0.2
- pydap=3.2.2
- pynio=1.5.5
- pytest
- pytest-cov
- pytest-env
- rasterio=1.0.28
- scipy=1.3.1
- seaborn=0.9.0
# - sparse # See py36-min-nep18.yml
- toolz=0.10.0
- zarr=2.3.2
- pip:
- numbagg==0.1
17 changes: 17 additions & 0 deletions ci/requirements/py36-min-nep18.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: xarray-tests
channels:
- conda-forge
dependencies:
# Optional dependencies that require NEP18, such as sparse,
# require drastically newer packages than everything else
- python=3.6.7
- coveralls
- dask=2.4.0
- distributed=2.4.0
- numpy=1.17
- pandas=0.25
- pytest
- pytest-cov
- pytest-env
- scipy=1.3
- sparse=0.8.0
45 changes: 25 additions & 20 deletions ci/requirements/py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,41 @@ channels:
- conda-forge
dependencies:
- python=3.6
- black
- boto3
- bottleneck
- cdms2
- cfgrib>=0.9.2
- cftime
- coveralls
- dask
- distributed
- h5py
- flake8
- h5netcdf
- h5py
- hdf5
- hypothesis
- iris>=1.10
- lxml # optional dep of pydap
- matplotlib
- netcdf4
- pytest
- pytest-cov
- pytest-env
- coveralls
- flake8
- mypy==0.720 # Must match .pre-commit-config.yaml
- nc-time-axis
- netcdf4
- numba
- numpy>=1.12
- pandas>=0.19
- pip
- pseudonetcdf>=3.0.1
- pydap
- pynio
- pytest
- pytest-cov
- pytest-env
- rasterio
- scipy
- seaborn
- sparse
- toolz
- rasterio
- boto3
- bottleneck
- zarr
- pseudonetcdf>=3.0.1
- cfgrib>=0.9.2
- cdms2
# Disabled due to conflicting dependencies:
# https://github.com/pydata/xarray/issues/3154
# - pynio
- iris>=1.10
- pydap
- lxml

- pip:
- numbagg
33 changes: 25 additions & 8 deletions ci/requirements/py37-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,41 @@ channels:
- conda-forge
dependencies:
- python=3.7
- black
- boto3
- bottleneck
# - cdms2 # Not available on Windows
# - cfgrib>=0.9.2 # Causes Python interpreter crash on Windows
- cftime
- nc-time-axis
- coveralls
- dask
- distributed
- h5py
- flake8
- h5netcdf
- h5py
- hdf5
- hypothesis
- iris>=1.10
- lxml # optional dep of pydap
- matplotlib
- mypy==0.720 # Must match .pre-commit-config.yaml
- nc-time-axis
- netcdf4
- pytest
- pytest-cov
- pytest-env
- coveralls
- numba
- numpy>=1.12
- pandas>=0.19
- pip
- pseudonetcdf>=3.0.1
- pydap
# - pynio # Not available on Windows
- pytest
- pytest-cov
- pytest-env
- rasterio
- scipy
- seaborn
- sparse
- toolz
- rasterio
- boto3
- zarr
- pip:
- numbagg
37 changes: 22 additions & 15 deletions ci/requirements/py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,41 @@ channels:
- conda-forge
dependencies:
- python=3.7
- black
- boto3
- bottleneck
- cdms2
- cfgrib>=0.9.2
- cftime
- nc-time-axis
- coveralls
- dask
- distributed
- h5py
- flake8
- h5netcdf
- h5py
- hdf5
- hypothesis
- iris>=1.10
- lxml # optional dep of pydap
- matplotlib
- netcdf4
- pytest
- pytest-cov
- pytest-env
- coveralls
- flake8
- mypy==0.720 # Must match .pre-commit-config.yaml
- nc-time-axis
- netcdf4
- numba
- numpy>=1.12
- pandas>=0.19
- pip
- pseudonetcdf>=3.0.1
- pydap
- pynio
- pytest
- pytest-cov
- pytest-env
- rasterio
- scipy
- seaborn
- sparse
- toolz
- rasterio
- boto3
- bottleneck
- zarr
- pseudonetcdf>=3.0.1
- cfgrib>=0.9.2
- lxml
- pydap
- pip:
- numbagg
8 changes: 6 additions & 2 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Bug fixes
reinstated for :class:`DataArray` and :class:`Dataset` objects only. Internal xarray
objects remain unaddressable by weakref in order to save memory.
(:issue:`3317`) by `Guido Imperiale <https://github.com/crusaderky>`_.
- Line plots with the ``x`` or ``y`` argument set to a 1D non-dimensional coord
now plot the correct data for 2D DataArrays.
(:issue:`3334`). By `Tom Nicholas <http://github.com/TomNicholas>`_.

Documentation
~~~~~~~~~~~~~
Expand Down Expand Up @@ -557,8 +560,9 @@ Bug fixes
from higher frequencies to lower frequencies. Datapoints outside the bounds
of the original time coordinate are now filled with NaN (:issue:`2197`). By
`Spencer Clark <https://github.com/spencerkclark>`_.
- Line plots with the ``x`` argument set to a non-dimensional coord now plot the correct data for 1D DataArrays.
(:issue:`27251`). By `Tom Nicholas <http://github.com/TomNicholas>`_.
- Line plots with the ``x`` argument set to a non-dimensional coord now plot
the correct data for 1D DataArrays.
(:issue:`2725`). By `Tom Nicholas <http://github.com/TomNicholas>`_.
- Subtracting a scalar ``cftime.datetime`` object from a
:py:class:`CFTimeIndex` now results in a :py:class:`pandas.TimedeltaIndex`
instead of raising a ``TypeError`` (:issue:`2671`). By `Spencer Clark
Expand Down
2 changes: 1 addition & 1 deletion properties/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This directory contains property-based tests using a library
called [Hypothesis](https://github.com/HypothesisWorks/hypothesis-python).

The property tests for Xarray are a work in progress - more are always welcome.
The property tests for xarray are a work in progress - more are always welcome.
They are stored in a separate directory because they tend to run more examples
and thus take longer, and so that local development can run a test suite
without needing to `pip install hypothesis`.
Expand Down
6 changes: 6 additions & 0 deletions properties/test_encode_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
These ones pass, just as you'd hope!
"""
import pytest

pytest.importorskip("hypothesis")

import hypothesis.extra.numpy as npst
import hypothesis.strategies as st
from hypothesis import given, settings
Expand All @@ -23,6 +27,7 @@
)


@pytest.mark.slow
@given(st.data(), an_array)
def test_CFMask_coder_roundtrip(data, arr):
names = data.draw(
Expand All @@ -36,6 +41,7 @@ def test_CFMask_coder_roundtrip(data, arr):
xr.testing.assert_identical(original, roundtripped)


@pytest.mark.slow
@given(st.data(), an_array)
def test_CFScaleOffset_coder_roundtrip(data, arr):
names = data.draw(
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ universal = 1

[tool:pytest]
python_files=test_*.py
testpaths=xarray/tests
testpaths=xarray/tests properties
# Fixed upstream in https://github.com/kwgoodman/bottleneck/pull/199
filterwarnings =
ignore:Using a non-tuple sequence for multidimensional indexing is deprecated:FutureWarning
Expand Down
8 changes: 6 additions & 2 deletions xarray/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def _infer_line_data(darray, x, y, hue):
)

else:
yplt = darray.transpose(xname, huename)
xdim, = darray[xname].dims
huedim, = darray[huename].dims
yplt = darray.transpose(xdim, huedim)

else:
yname, huename = _infer_xy_labels(darray=darray, x=y, y=hue)
Expand All @@ -100,7 +102,9 @@ def _infer_line_data(darray, x, y, hue):
)

else:
xplt = darray.transpose(yname, huename)
ydim, = darray[yname].dims
huedim, = darray[huename].dims
xplt = darray.transpose(ydim, huedim)

huelabel = label_from_attrs(darray[huename])
hueplt = darray[huename]
Expand Down
Loading

0 comments on commit d8422c0

Please sign in to comment.