Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default value of weights kwarg in spatial_avg() #147

Closed
tomvothecoder opened this issue Nov 10, 2021 · 1 comment · Fixed by #154
Closed

Update default value of weights kwarg in spatial_avg() #147

tomvothecoder opened this issue Nov 10, 2021 · 1 comment · Fixed by #154
Labels
type: enhancement New enhancement request

Comments

@tomvothecoder
Copy link
Collaborator

tomvothecoder commented Nov 10, 2021

Is your feature request related to a problem? If yes, Please describe

Related issue: xCDAT/xcdat-validation#23 (comment)

weights defaults to None, which can confuse the user and make it seem like weights aren't automatically generated.
It should be set to weights="generated", which performs the same behavior as if it were None.

Also, does it make sense to handle a np.array of weights in spatial_avg()? Currently, it requires custom weights to be a DataArray with the same spatial axis dimensions and sizes as the data variable DataArray. If we want to accept np.array we'd have to implement a method that creates the weights DataArray from this array so that it can be correctly applied to the data variable (still have to think more about the implementation if it makes sense or is possible).

Describe your proposed solution

Describe alternatives solutions you've considered

Additional context

@tomvothecoder
Copy link
Collaborator Author

Closed in #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New enhancement request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant