File tree 6 files changed +8
-47
lines changed
6 files changed +8
-47
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ For plotting
59
59
60
60
- `matplotlib <http://matplotlib.org/ >`__: required for :ref: `plotting `
61
61
- `cartopy <http://scitools.org.uk/cartopy/ >`__: recommended for :ref: `plot-maps `
62
- - `seaborn <https ://stanford.edu/~mwaskom/software/ seaborn/ >`__: for better
62
+ - `seaborn <http ://seaborn.pydata.org / >`__: for better
63
63
color palettes
64
64
- `nc-time-axis <https://github.com/SciTools/nc-time-axis >`__: for plotting
65
65
cftime.datetime objects
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ using the visualization `built in to pandas itself`__ or provided by the pandas
12
12
aware libraries such as `Seaborn `__.
13
13
14
14
__ http://pandas.pydata.org/pandas-docs/stable/visualization.html
15
- __ http://stanford.edu/~mwaskom/software/ seaborn/
15
+ __ http://seaborn.pydata.org /
16
16
17
17
.. ipython :: python
18
18
:suppress:
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ Documentation
34
34
Internal Changes
35
35
~~~~~~~~~~~~~~~~
36
36
37
+ - Removed the internal ``import_seaborn `` function which handled the deprecation of
38
+ the ``seaborn.apionly `` entry point (:issue: `3747 `).
39
+ By `Mathias Hauser <https://github.com/mathause >`_.
40
+
37
41
.. _whats-new.0.15.0 :
38
42
39
43
Original file line number Diff line number Diff line change 21
21
ROBUST_PERCENTILE = 2.0
22
22
23
23
24
- def import_seaborn ():
25
- """import seaborn and handle deprecation of apionly module"""
26
- with warnings .catch_warnings (record = True ) as w :
27
- warnings .simplefilter ("always" )
28
- try :
29
- import seaborn .apionly as sns
30
-
31
- if (
32
- w
33
- and issubclass (w [- 1 ].category , UserWarning )
34
- and ("seaborn.apionly module" in str (w [- 1 ].message ))
35
- ):
36
- raise ImportError
37
- except ImportError :
38
- import seaborn as sns
39
- finally :
40
- warnings .resetwarnings ()
41
- return sns
42
-
43
-
44
24
_registered = False
45
25
46
26
@@ -119,7 +99,7 @@ def _color_palette(cmap, n_colors):
119
99
except ValueError :
120
100
# ValueError happens when mpl doesn't like a colormap, try seaborn
121
101
try :
122
- from seaborn . apionly import color_palette
102
+ from seaborn import color_palette
123
103
124
104
pal = color_palette (cmap , n_colors = n_colors )
125
105
except (ValueError , ImportError ):
Original file line number Diff line number Diff line change 16
16
from xarray .core .duck_array_ops import allclose_or_equiv # noqa: F401
17
17
from xarray .core .indexing import ExplicitlyIndexed
18
18
from xarray .core .options import set_options
19
- from xarray .plot .utils import import_seaborn
20
19
21
20
# import mpl and change the backend before other mpl imports
22
21
try :
@@ -71,19 +70,14 @@ def LooseVersion(vstring):
71
70
has_iris , requires_iris = _importorskip ("iris" )
72
71
has_cfgrib , requires_cfgrib = _importorskip ("cfgrib" )
73
72
has_numbagg , requires_numbagg = _importorskip ("numbagg" )
73
+ has_seaborn , requires_seaborn = _importorskip ("seaborn" )
74
74
has_sparse , requires_sparse = _importorskip ("sparse" )
75
75
76
76
# some special cases
77
77
has_scipy_or_netCDF4 = has_scipy or has_netCDF4
78
78
requires_scipy_or_netCDF4 = pytest .mark .skipif (
79
79
not has_scipy_or_netCDF4 , reason = "requires scipy or netCDF4"
80
80
)
81
- try :
82
- import_seaborn ()
83
- has_seaborn = True
84
- except ImportError :
85
- has_seaborn = False
86
- requires_seaborn = pytest .mark .skipif (not has_seaborn , reason = "requires seaborn" )
87
81
88
82
# change some global options for tests
89
83
set_options (warn_for_unclosed_files = True )
Original file line number Diff line number Diff line change 14
14
_build_discrete_cmap ,
15
15
_color_palette ,
16
16
_determine_cmap_params ,
17
- import_seaborn ,
18
17
label_from_attrs ,
19
18
)
20
19
@@ -2118,22 +2117,6 @@ def test_ncaxis_notinstalled_line_plot(self):
2118
2117
self .darray .plot .line ()
2119
2118
2120
2119
2121
- @requires_seaborn
2122
- def test_import_seaborn_no_warning ():
2123
- # GH1633
2124
- with pytest .warns (None ) as record :
2125
- import_seaborn ()
2126
- assert len (record ) == 0
2127
-
2128
-
2129
- @requires_matplotlib
2130
- def test_plot_seaborn_no_import_warning ():
2131
- # GH1633
2132
- with pytest .warns (None ) as record :
2133
- _color_palette ("Blues" , 4 )
2134
- assert len (record ) == 0
2135
-
2136
-
2137
2120
test_da_list = [
2138
2121
DataArray (easy_array ((10 ,))),
2139
2122
DataArray (easy_array ((10 , 3 ))),
You can’t perform that action at this time.
0 commit comments