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

Import ABC from collections.abc for Python 3.10 compatibility. #150

Merged
merged 1 commit into from
Mar 26, 2022
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions splot/_viz_value_by_alpha_mpl.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib.pyplot as plt
from matplotlib import colors
from matplotlib import patches
import collections
import collections.abc
import matplotlib.cm as cm
import mapclassify as classify
import numpy as np
Expand Down Expand Up @@ -89,7 +89,7 @@ def value_by_alpha_cmap(x, y, cmap='GnBu', revert_alpha=False, divergent=False):
# option for cmap or colorlist input
if isinstance(cmap, str):
cmap = cm.get_cmap(cmap)
elif isinstance(cmap, collections.Sequence):
elif isinstance(cmap, collections.abc.Sequence):
cmap = colors.LinearSegmentedColormap.from_list('newmap', cmap)

rgba = cmap((x - x.min()) / (x.max() - x.min()))
Expand Down