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
The type annotations of xarray.Dataset.pipe, xarray.DataArray.pipe, and xarray.DataTree.pipe should be enhanced to address the following shortcomings in terms of what type checkers cannot flag due to the imprecise typing currently in place:
Incorrect number of arguments
Incorrect argument types
Code suggestions for chaining after the pipe (only an issue for Datatree.pipe)
Note that in the case of specifying a tuple (function + keyword) as the first argument to pipe, only item 3 can be addressed because there's no way to fully specify the function's type signature when the function does not take the dataset/array/tree as its first argument.
In this case, this can be addressed by using a lambda instead. In essence, my recommendation would be for users of pipe not to use the tuple form so that more robust type checking can be performed.