Skip to content

Commit

Permalink
Satisfy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Oct 16, 2021
1 parent f62d874 commit 597cd89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions seaborn/_core/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ def setup(
# TODO should this happen upstream, or alternatively inside the norm?
data = scale.cast(data)
data = mpl.dates.date2num(data.dropna())
prepare = lambda x: mpl.dates.date2num(pd.to_datetime(x))

def prepare(x):
return mpl.dates.date2num(pd.to_datetime(x))

# TODO if norm is tuple, convert to datetime and then to numbers?
# (Or handle that upstream within the DateTimeScale? Probably do this.)
Expand Down Expand Up @@ -301,7 +303,9 @@ def setup(
# we could avoid this by defining a little scale_norm() wrapper that
# removes nas more type-agnostically
data = pd.Series(mpl.dates.date2num(data), index=data.index)
prepare = lambda x: mpl.dates.date2num(pd.to_datetime(x))

def prepare(x):
return mpl.dates.date2num(pd.to_datetime(x))

# TODO if norm is tuple, convert to datetime and then to numbers?

Expand Down
1 change: 0 additions & 1 deletion seaborn/tests/_core/test_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def test_categorical_default_palette_large(self):

vector = pd.Series(list("abcdefghijklmnopqrstuvwxyz"))
scale = ScaleWrapper.from_inferred_type(vector)
scale = ScaleWrapper.from_inferred_type(vector)
n_colors = len(vector)
expected = dict(zip(vector, color_palette("husl", n_colors)))
m = ColorSemantic().setup(vector, scale)
Expand Down

0 comments on commit 597cd89

Please sign in to comment.