Skip to content

Commit

Permalink
Merge pull request #749 from ioam/ignore_nan_warning
Browse files Browse the repository at this point in the history
Ignore All-NaN warning
  • Loading branch information
jlstevens committed Jul 1, 2016
2 parents c0fba34 + f047c0c commit 0c9ff76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion holoviews/plotting/mpl/util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import re
import inspect
import warnings

import numpy as np
from matplotlib import ticker
Expand Down Expand Up @@ -54,4 +55,6 @@ def compute_ratios(ratios, normalized=True):
if normalized:
unpacked = normalize_ratios(unpacked)
sorted_ratios = sorted(unpacked.items())
return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)
with warnings.catch_warnings():
warnings.filterwarnings('ignore', r'All-NaN (slice|axis) encountered')
return np.nanmax(np.vstack([v for _, v in sorted_ratios]), axis=0)

0 comments on commit 0c9ff76

Please sign in to comment.