Update to latest version.

This commit is contained in:
Elliott Sales de Andrade
2020-07-12 20:41:41 -04:00
parent 64c9d5b495
commit 01acc30df2
9 changed files with 26 additions and 210 deletions
+2
View File
@@ -4,3 +4,5 @@
/xarray-0.12.3.tar.gz
/xarray-0.15.0.tar.gz
/xarray-0.15.1.tar.gz
/xarray-0.16.0.tar.gz
/xarray-data-5fdb22b5613ba8176b9f6fa67be783d7810643eb.tar.gz
@@ -1,7 +1,7 @@
From 75584dd2b3d7c7411220bb21ee751002d51498c7 Mon Sep 17 00:00:00 2001
From 361e61a825fb2f7e42e5428bca1b338ec061ff0f Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 15 Mar 2019 22:31:18 -0400
Subject: [PATCH 1/4] DOC: Don't download RGB.byte.tif during build.
Subject: [PATCH 1/3] DOC: Don't download RGB.byte.tif during build.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@@ -36,5 +36,5 @@ index 758d4cd3..f2a7b2db 100644
# The data is in UTM projection. We have to set it manually until
--
2.21.1
2.25.4
@@ -1,7 +1,7 @@
From bc95d0d73a1ab2f25ce7074bf0de803892eced54 Mon Sep 17 00:00:00 2001
From 909193458554ebf2f0fb42a7beb550a20ad27735 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 15 Mar 2019 22:48:25 -0400
Subject: [PATCH 2/4] DOC: Skip examples using unpackaged dependencies.
Subject: [PATCH 2/3] DOC: Skip examples using unpackaged dependencies.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@@ -9,18 +9,18 @@ Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 file changed, 2 insertions(+)
diff --git a/doc/io.rst b/doc/io.rst
index e9109432..3e95540c 100644
index 4aac5e0b..5f8d3871 100644
--- a/doc/io.rst
+++ b/doc/io.rst
@@ -498,6 +498,7 @@ installed xarray can convert a ``DataArray`` into a ``Cube`` using
@@ -504,6 +504,7 @@ installed xarray can convert a ``DataArray`` into a ``Cube`` using
:py:meth:`DataArray.to_iris`:
.. ipython:: python
+ :verbatim:
da = xr.DataArray(np.random.rand(4, 5), dims=['x', 'y'],
coords=dict(x=[10, 20, 30, 40],
@@ -510,6 +511,7 @@ Conversely, we can create a new ``DataArray`` object from a ``Cube`` using
da = xr.DataArray(
np.random.rand(4, 5),
@@ -518,6 +519,7 @@ Conversely, we can create a new ``DataArray`` object from a ``Cube`` using
:py:meth:`DataArray.from_iris`:
.. ipython:: python
@@ -29,5 +29,5 @@ index e9109432..3e95540c 100644
da_cube = xr.DataArray.from_iris(cube)
da_cube
--
2.21.1
2.25.4
@@ -1,7 +1,7 @@
From aebdf7c14a3a7df2ab45467074b4dd6dacc8d682 Mon Sep 17 00:00:00 2001
From e5a4bf1b7bc0ef02d586ec857e09f67fc1a47340 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 16 Mar 2019 02:59:15 -0400
Subject: [PATCH 3/4] DOC: Don't print out conda/pip environment.
Subject: [PATCH 3/3] DOC: Don't print out conda/pip environment.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@@ -9,10 +9,10 @@ Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 file changed, 7 deletions(-)
diff --git a/doc/conf.py b/doc/conf.py
index 578f9cf5..a23031a0 100644
index d3d126cb..8dfed5e8 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -32,13 +32,6 @@ allowed_failures = set()
@@ -38,13 +38,6 @@ allowed_failures = set()
print("python exec:", sys.executable)
print("sys.path:", sys.path)
@@ -27,5 +27,5 @@ index 578f9cf5..a23031a0 100644
with suppress(ImportError):
--
2.21.1
2.25.4
@@ -1,78 +0,0 @@
From 7c9e266e5a2460391700a54da1c14e35205536a6 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 31 Aug 2019 04:24:59 -0400
Subject: [PATCH 4/4] Use drawstyle instead of linestyle in plot.step.
Mixing the two is deprecated in Matplotlib 3.1, and breaks the doc build
if warnings are set to errors (which they are in new IPython sphinx
extensions.)
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
xarray/plot/plot.py | 18 +++++++++---------
xarray/plot/utils.py | 4 ++--
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/xarray/plot/plot.py b/xarray/plot/plot.py
index 98131887..302cac05 100644
--- a/xarray/plot/plot.py
+++ b/xarray/plot/plot.py
@@ -329,7 +329,7 @@ def line(
return primitive
-def step(darray, *args, where="pre", linestyle=None, ls=None, **kwargs):
+def step(darray, *args, where="pre", drawstyle=None, ds=None, **kwargs):
"""
Step plot of DataArray index against values
@@ -359,16 +359,16 @@ def step(darray, *args, where="pre", linestyle=None, ls=None, **kwargs):
if where not in {"pre", "post", "mid"}:
raise ValueError("'where' argument to step must be " "'pre', 'post' or 'mid'")
- if ls is not None:
- if linestyle is None:
- linestyle = ls
+ if ds is not None:
+ if drawstyle is None:
+ drawstyle = ds
else:
- raise TypeError("ls and linestyle are mutually exclusive")
- if linestyle is None:
- linestyle = ""
- linestyle = "steps-" + where + linestyle
+ raise TypeError("ds and drawstyle are mutually exclusive")
+ if drawstyle is None:
+ drawstyle = ""
+ drawstyle = "steps-" + where + drawstyle
- return line(darray, *args, linestyle=linestyle, **kwargs)
+ return line(darray, *args, drawstyle=drawstyle, **kwargs)
def hist(
diff --git a/xarray/plot/utils.py b/xarray/plot/utils.py
index cb3bef6d..e6c15037 100644
--- a/xarray/plot/utils.py
+++ b/xarray/plot/utils.py
@@ -465,7 +465,7 @@ def _resolve_intervals_1dplot(xval, yval, xlabel, ylabel, kwargs):
"""
# Is it a step plot? (see matplotlib.Axes.step)
- if kwargs.get("linestyle", "").startswith("steps-"):
+ if kwargs.get("drawstyle", "").startswith("steps-"):
# Convert intervals to double points
if _valid_other_type(np.array([xval, yval]), [pd.Interval]):
@@ -476,7 +476,7 @@ def _resolve_intervals_1dplot(xval, yval, xlabel, ylabel, kwargs):
yval, xval = _interval_to_double_bound_points(yval, xval)
# Remove steps-* to be sure that matplotlib is not confused
- del kwargs["linestyle"]
+ del kwargs["drawstyle"]
# Is it another kind of plot?
else:
--
2.21.1
-53
View File
@@ -1,53 +0,0 @@
From 67c0d933d5860088ec905a2491e952560f37e476 Mon Sep 17 00:00:00 2001
From: Spencer Clark <spencerkclark@gmail.com>
Date: Fri, 3 Apr 2020 08:03:07 -0400
Subject: [PATCH] Only fail if a specific warning occurs
---
xarray/tests/test_backends.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py
index 5f8ba83c..39178213 100644
--- a/xarray/tests/test_backends.py
+++ b/xarray/tests/test_backends.py
@@ -4333,6 +4333,12 @@ def test_source_encoding_always_present():
assert ds.encoding["source"] == tmp
+def _assert_no_dates_out_of_range_warning(record):
+ undesired_message = "dates out of range"
+ for warning in record:
+ assert undesired_message not in str(warning.message)
+
+
@requires_scipy_or_netCDF4
@pytest.mark.parametrize("calendar", _STANDARD_CALENDARS)
def test_use_cftime_standard_calendar_default_in_range(calendar):
@@ -4359,7 +4365,7 @@ def test_use_cftime_standard_calendar_default_in_range(calendar):
with open_dataset(tmp_file) as ds:
assert_identical(expected_x, ds.x)
assert_identical(expected_time, ds.time)
- assert not record
+ _assert_no_dates_out_of_range_warning(record)
@requires_cftime
@@ -4422,7 +4428,7 @@ def test_use_cftime_true(calendar, units_year):
with open_dataset(tmp_file, use_cftime=True) as ds:
assert_identical(expected_x, ds.x)
assert_identical(expected_time, ds.time)
- assert not record
+ _assert_no_dates_out_of_range_warning(record)
@requires_scipy_or_netCDF4
@@ -4451,7 +4457,7 @@ def test_use_cftime_false_standard_calendar_in_range(calendar):
with open_dataset(tmp_file, use_cftime=False) as ds:
assert_identical(expected_x, ds.x)
assert_identical(expected_time, ds.time)
- assert not record
+ _assert_no_dates_out_of_range_warning(record)
@requires_scipy_or_netCDF4
-51
View File
@@ -1,51 +0,0 @@
From b99bc4807922b72bc5506f5ac2884aeb3c2da845 Mon Sep 17 00:00:00 2001
From: Keewis <keewis@posteo.de>
Date: Wed, 24 Jun 2020 20:24:54 +0200
Subject: [PATCH] use assert_allclose in the aggregation-with-units tests
(#4174)
* use assert_allclose in the aggregation tests
* install pint using pip
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
xarray/tests/test_units.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/xarray/tests/test_units.py b/xarray/tests/test_units.py
index 2826dc24..5dd5cfaf 100644
--- a/xarray/tests/test_units.py
+++ b/xarray/tests/test_units.py
@@ -1448,7 +1448,7 @@ class TestVariable(VariableSubclassobjects):
actual = func(variable)
assert_units_equal(expected, actual)
- xr.testing.assert_identical(expected, actual)
+ assert_allclose(expected, actual)
@pytest.mark.parametrize(
"func",
@@ -2296,7 +2296,8 @@ class TestDataArray:
expected = attach_units(func(strip_units(data_array)), units)
actual = func(data_array)
- assert_equal_with_units(expected, actual)
+ assert_units_equal(expected, actual)
+ assert_allclose(expected, actual)
@pytest.mark.parametrize(
"func",
@@ -3809,7 +3810,8 @@ class TestDataset:
},
)
- assert_equal_with_units(actual, expected)
+ assert_units_equal(expected, actual)
+ assert_allclose(expected, actual)
@pytest.mark.parametrize("property", ("imag", "real"))
def test_numpy_properties(self, property, dtype):
--
2.25.4
+6 -10
View File
@@ -1,11 +1,11 @@
%global srcname xarray
%global data_commit 870b5d7a9dbfa821423f1b88056890c22341f085
%global data_commit 5fdb22b5613ba8176b9f6fa67be783d7810643eb
%bcond_with docs
Name: python-%{srcname}
Version: 0.15.1
Release: 3%{?dist}
Version: 0.16.0
Release: 1%{?dist}
Summary: N-D labeled arrays and datasets in Python
License: ASL 2.0
@@ -18,12 +18,6 @@ Source2: https://github.com/mapbox/rasterio/raw/1.0.21/tests/data/RGB.byt
Patch0001: 0001-DOC-Don-t-download-RGB.byte.tif-during-build.patch
Patch0002: 0002-DOC-Skip-examples-using-unpackaged-dependencies.patch
Patch0003: 0003-DOC-Don-t-print-out-conda-pip-environment.patch
# https://github.com/pydata/xarray/pull/3274
Patch0004: 0004-Use-drawstyle-instead-of-linestyle-in-plot.step.patch
# https://github.com/pydata/xarray/pull/3930
Patch0005: https://github.com/pydata/xarray/pull/3930.patch
# https://github.com/pydata/xarray/issues/4172
Patch0006: https://github.com/pydata/xarray/pull/4174.patch
BuildArch: noarch
@@ -80,7 +74,6 @@ BuildRequires: python3-ipython-sphinx
BuildRequires: python3dist(jupyter-client)
BuildRequires: python3dist(matplotlib)
BuildRequires: python3dist(netcdf4)
BuildRequires: python3dist(numpydoc)
BuildRequires: python3dist(rasterio)
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-gallery)
@@ -138,6 +131,9 @@ rm -rf xarray
%changelog
* Sun Jul 12 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.16.0-1
- Update to latest version
* Tue Jun 23 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.15.1-3
- Backport patch to fix tests catching too many warnings
+2 -2
View File
@@ -1,3 +1,3 @@
SHA512 (xarray-0.15.1.tar.gz) = 8a2d7e9173c51c65ffe856fa83df730e0e7de9777726c6d6e8f7f4edcc512b3a980c7dc854c19d3bc4bec50e815ad776bd433a5750680f2851a2b0b1f505ea14
SHA512 (xarray-data-870b5d7a9dbfa821423f1b88056890c22341f085.tar.gz) = 27de6e274d18d266d6d8a1f0c8f65396fff16d177cf6df41cfd4bcf839e6d083512c4f4dbc1163ab7380a8905acecfe15b7978e23b9c360bad2dd879addb421c
SHA512 (xarray-0.16.0.tar.gz) = 25a4c967d316eac97389ac4f7e43483655ba93bec0af0f338416f8cd9493dc22b6709c7c66640dc5021f70438d2e26c8f419bda178bb6f27f951b8515b2610fc
SHA512 (xarray-data-5fdb22b5613ba8176b9f6fa67be783d7810643eb.tar.gz) = a1ed7c14e9fe6a0e4327b374b1b0ecd93472cd8308b3e2bbc078172576b8f31cd27c11da4b1c557e9b1615a411beaf21db83de755ece342343a4db2773ce6d29
SHA512 (RGB.byte.tif) = 34aa1b196f6c5880530d42ec8a25193bc79db803a8427adc9b115373d222b9f4318a04f06c8b37118df7e09d96b9c470ecec543c604af18861f11b786ed6fbfd