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

remove seaborn.apionly compatibility #3749

Merged
merged 4 commits into from
Feb 5, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
remove import_seaborn
  • Loading branch information
mathause committed Feb 4, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit a6c25d70fd45003a2944ca8240d5aa976f9d1b04
22 changes: 1 addition & 21 deletions xarray/plot/utils.py
Original file line number Diff line number Diff line change
@@ -21,26 +21,6 @@
ROBUST_PERCENTILE = 2.0


def import_seaborn():
"""import seaborn and handle deprecation of apionly module"""
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
try:
import seaborn.apionly as sns

if (
w
and issubclass(w[-1].category, UserWarning)
and ("seaborn.apionly module" in str(w[-1].message))
):
raise ImportError
except ImportError:
import seaborn as sns
finally:
warnings.resetwarnings()
return sns


_registered = False


@@ -119,7 +99,7 @@ def _color_palette(cmap, n_colors):
except ValueError:
# ValueError happens when mpl doesn't like a colormap, try seaborn
try:
from seaborn.apionly import color_palette
from seaborn import color_palette

pal = color_palette(cmap, n_colors=n_colors)
except (ValueError, ImportError):