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
I wanted to highlight a typing issue with xarray.core.combine.combine_by_coords where the first argument is data_objects: Iterable[Dataset | DataArray] = []. Specifically the type issue exists when a Generator which is an Iterable is passed as the data_objects argument. See the example below...
Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the Contributing Guide for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!
I think materializing it as a list would make sense. Or if it's possible to move the check closer to the code that's operating and avoiding the additional loop, that would work too.
What is your issue?
I wanted to highlight a
typing
issue withxarray.core.combine.combine_by_coords
where the first argument isdata_objects: Iterable[Dataset | DataArray] = []
. Specifically the type issue exists when aGenerator
which is anIterable
is passed as thedata_objects
argument. See the example below...The results.
The issue arises at the head of the function where the generator is exhausted.
A simple solution would be to change the type annotations to either that of a
Sequence
or memoize thedata_objects
variable as...The text was updated successfully, but these errors were encountered: