Skip to content

Commit

Permalink
Ignore a separate dubious numpy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed May 23, 2020
1 parent 12b4d28 commit 2d5a0bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion seaborn/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,13 @@ def variable_type(vector, boolean_type="numeric"):
# https://github.com/numpy/numpy/issues/6784
# Because we reduce with .all(), we are agnostic about whether the
# comparison returns a scalar or vector, so we will ignore the warning.
# It triggers a separate DeprecationWarning when the vector has datetimes:
# https://github.com/numpy/numpy/issues/13548
# This is considered a bug by numpy and will likely go away.
with warnings.catch_warnings():
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.simplefilter(
action='ignore', category=(FutureWarning, DeprecationWarning)
)
if np.isin(vector, [0, 1, np.nan]).all():
return boolean_type

Expand Down

0 comments on commit 2d5a0bd

Please sign in to comment.