Skip to content

Commit 8528ef5

Browse files
Do not use len() without comparison to determine if a sequence is empty
1 parent f799548 commit 8528ef5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xarray/computation/fit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def _wrapper(Y, *args, **kwargs):
474474
mask = np.all([np.any(~np.isnan(x), axis=0), ~np.isnan(y)], axis=0)
475475
x = x[:, mask]
476476
y = y[mask]
477-
if not len(y):
477+
if y.size == 0:
478478
popt = np.full([n_params], np.nan)
479479
pcov = np.full([n_params, n_params], np.nan)
480480
return popt, pcov

0 commit comments

Comments
 (0)