Fix build against Matplotlib 3.1.

This commit is contained in:
Elliott Sales de Andrade
2019-08-31 04:37:26 -04:00
parent 757e1e406c
commit 6aeeebb116
7 changed files with 112 additions and 4 deletions
@@ -1,7 +1,7 @@
From 63fc5acba81601e473ead5c4e82de78b5ae61ad0 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/6] DOC: Don't download RGB.byte.tif during build.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@@ -1,7 +1,7 @@
From 90f116ffbf6eb403d4ddd44e6b9bafddced99419 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/6] DOC: Skip examples using unpackaged dependencies.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@@ -1,7 +1,7 @@
From 2b193b193b422b322a5f5e6475ce72d9a453fb9f Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 16 Mar 2019 02:42:37 -0400
Subject: [PATCH 3/4] TST: Reduce required pytest-runner version.
Subject: [PATCH 3/6] TST: Reduce required pytest-runner version.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@@ -1,7 +1,7 @@
From 46ca88294c55170c442417f7341571079f1bc2a9 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 4/4] DOC: Don't print out conda/pip environment.
Subject: [PATCH 4/6] DOC: Don't print out conda/pip environment.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@@ -0,0 +1,28 @@
From 386cd9833b20bbb566501482ceffd89b962ee975 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 31 Aug 2019 04:17:40 -0400
Subject: [PATCH 5/6] Don't set box-forced in Cartopy example.
It is deprecated in Matplotlib 2.2, removed in 3.1, and appears to have
no effect on the result.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
doc/gallery/plot_cartopy_facetgrid.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/gallery/plot_cartopy_facetgrid.py b/doc/gallery/plot_cartopy_facetgrid.py
index 3eded115..294529d1 100644
--- a/doc/gallery/plot_cartopy_facetgrid.py
+++ b/doc/gallery/plot_cartopy_facetgrid.py
@@ -39,6 +39,6 @@ for ax in p.axes.flat:
ax.set_extent([-160, -30, 5, 75])
# Without this aspect attributes the maps will look chaotic and the
# "extent" attribute above will be ignored
- ax.set_aspect('equal', 'box-forced')
+ ax.set_aspect('equal')
plt.show()
--
2.21.0
@@ -0,0 +1,76 @@
From f20d0d12197e20f0baa258347e8efdf9811f9fa1 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 6/6] 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 | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/xarray/plot/plot.py b/xarray/plot/plot.py
index 9d0bf671..55fa033b 100644
--- a/xarray/plot/plot.py
+++ b/xarray/plot/plot.py
@@ -252,16 +252,16 @@ def line(darray, *args, row=None, col=None, figsize=None, aspect=None,
# Remove pd.Intervals if contained in xplt.values.
if _valid_other_type(xplt.values, [pd.Interval]):
# Is it a step plot? (see matplotlib.Axes.step)
- if kwargs.get('linestyle', '').startswith('steps-'):
+ if kwargs.get('drawstyle', '').startswith('steps-'):
xplt_val, yplt_val = _interval_to_double_bound_points(xplt.values,
yplt.values)
# Remove steps-* to be sure that matplotlib is not confused
- kwargs['linestyle'] = (kwargs['linestyle']
+ kwargs['drawstyle'] = (kwargs['drawstyle']
.replace('steps-pre', '')
.replace('steps-post', '')
.replace('steps-mid', ''))
- if kwargs['linestyle'] == '':
- del kwargs['linestyle']
+ if kwargs['drawstyle'] == '':
+ del kwargs['drawstyle']
else:
xplt_val = _interval_to_mid_points(xplt.values)
yplt_val = yplt.values
@@ -303,7 +303,7 @@ def line(darray, *args, row=None, col=None, figsize=None, aspect=None,
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
@@ -332,16 +332,16 @@ def step(darray, *args, where='pre', linestyle=None, ls=None, **kwargs):
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(darray, figsize=None, size=None, aspect=None, ax=None,
--
2.21.0
+4
View File
@@ -17,6 +17,10 @@ Patch0001: 0001-DOC-Don-t-download-RGB.byte.tif-during-build.patch
Patch0002: 0002-DOC-Skip-examples-using-unpackaged-dependencies.patch
Patch0003: 0003-TST-Reduce-required-pytest-runner-version.patch
Patch0004: 0004-DOC-Don-t-print-out-conda-pip-environment.patch
# https://github.com/pydata/xarray/pull/3273
Patch0005: 0005-Don-t-set-box-forced-in-Cartopy-example.patch
# https://github.com/pydata/xarray/pull/3274
Patch0006: 0006-Use-drawstyle-instead-of-linestyle-in-plot.step.patch
BuildArch: noarch