You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note also that the ddof argument doesn't even appear in the array API standard for std (or for var), and it appears that standard also uses ddof=0 by default right now.
This is actually currently a bug in xarray's support of the array API standard, because it seems xarray tries to pass the ddof argument explicitly. (see #6903)
I guess I would like to see ddof appear in the array API standard before we consider changing xarray's choice of it away from the default, otherwise you break API standard compatibility until it is included.
Actually it seems ddof was renamed to correction in the array API standard, and a default value of 0 was chosen (see data-apis/array-api#695).
We should therefore start supporting correction in order to pass it down to array-api-compatible libraries, but we should also support ddof for backwards compatibility (until it hopefully gets deprecated at some point in the distant future I guess). There should be a joint default for both, which I think should be 0, but we would be able to change this as you suggest @max-sixty . What's the correct place in the codebase to put that logic though? Given that it requires checking which kwarg the array type supports before calling the function?
Activity
TomNicholas commentedon Dec 21, 2023
Note also that the
ddofargument doesn't even appear in the array API standard forstd(or forvar), and it appears that standard also usesddof=0by default right now.This is actually currently a bug in xarray's support of the array API standard, because it seems xarray tries to pass the
ddofargument explicitly. (see #6903)I guess I would like to see
ddofappear in the array API standard before we consider changing xarray's choice of it away from the default, otherwise you break API standard compatibility until it is included.TomNicholas commentedon Dec 27, 2023
Actually it seems
ddofwas renamed tocorrectionin the array API standard, and a default value of 0 was chosen (see data-apis/array-api#695).We should therefore start supporting
correctionin order to pass it down to array-api-compatible libraries, but we should also supportddoffor backwards compatibility (until it hopefully gets deprecated at some point in the distant future I guess). There should be a joint default for both, which I think should be 0, but we would be able to change this as you suggest @max-sixty . What's the correct place in the codebase to put that logic though? Given that it requires checking which kwarg the array type supports before calling the function?