Skip to content

Commit

Permalink
fix(era5_aggregate): fix missing data check (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannforget authored Jan 2, 2025
1 parent 677c16f commit 2a3c6cf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions openhexa/toolbox/era5/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ def _has_missing_data(da: xr.DataArray) -> bool:
missing = False

# if da.step.size == 1, da.step is just an int so we cannot iterate over it
if da.step.size == 1 and da.isnull().all():
return True

# if da.step size > 1, da.step is an array of int (one per step)
for step in da.step:
if da.sel(step=step).isnull().all():
missing = True
if da.step.size > 1:
for step in da.step:
if da.sel(step=step).isnull().all():
missing = True
else:
missing = da.isnull().all()

return missing

Expand Down

0 comments on commit 2a3c6cf

Please sign in to comment.