Skip to content

Commit 7a0e07b

Browse files
authored
Merge pull request #269 from HIKassem/main
check input bins validity issue #268
2 parents 47ab1b5 + f0134d3 commit 7a0e07b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

windrose/windrose.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,12 @@ def _init_plot(self, direction, var, **kwargs):
376376
bins = np.asarray(bins)
377377
nbins = len(bins)
378378

379+
if np.isnan(bins).any():
380+
raise ValueError(
381+
"Could not compute the bins due to the presence of NaNs in "
382+
"either the bins provided or the original data.",
383+
)
384+
379385
# Number of sectors
380386
nsector = kwargs.pop("nsector", None)
381387
if nsector is None:

0 commit comments

Comments
 (0)