|
bins = np.linspace(np.min(var), np.max(var), 6) |
|
if isinstance(bins, int): |
|
bins = np.linspace(np.min(var), np.max(var), bins) |
In cases where
bins argument isn't provided by the user. Both
np.min and
np.max functions may return
nan if the
var array has
nan values. I think simply replacing them with
np.nanmin and
np.nanmax would fix this issue. Otherwise just an error message would be nice at this point because currently
matplotlib throws an error which is hard to trace to this issue.
windrose/windrose/windrose.py
Lines 373 to 375 in 47ab1b5
In cases where
binsargument isn't provided by the user. Bothnp.minandnp.maxfunctions may returnnanif thevararray hasnanvalues. I think simply replacing them withnp.nanminandnp.nanmaxwould fix this issue. Otherwise just an error message would be nice at this point because currentlymatplotlibthrows an error which is hard to trace to this issue.