Skip to content

Commit

Permalink
Merge pull request #269 from HIKassem/main
Browse files Browse the repository at this point in the history
check input bins validity issue #268
  • Loading branch information
ocefpaf committed May 29, 2024
2 parents 47ab1b5 + f0134d3 commit 7a0e07b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions windrose/windrose.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,12 @@ def _init_plot(self, direction, var, **kwargs):
bins = np.asarray(bins)
nbins = len(bins)

if np.isnan(bins).any():
raise ValueError(
"Could not compute the bins due to the presence of NaNs in "
"either the bins provided or the original data.",
)

# Number of sectors
nsector = kwargs.pop("nsector", None)
if nsector is None:
Expand Down

0 comments on commit 7a0e07b

Please sign in to comment.