Fix lazy open bug#858
Conversation
| da = obj[var] | ||
| if isinstance(da.data, Array): | ||
| array_names_to_variable_names[da.data.name] = f"{name}.{var}" | ||
| for var_name, var in obj.variables.items(): |
There was a problem hiding this comment.
I deliberately changed .data_vars to .variables here because it's totally possible to have large lazy coordinate variables.
|
Seems the This goes against my mental model here. |
Yes, mine too. Do you mind creating a separate issue for this with the code snippet that causes it? |
|
@TomNicholas I think it's worth merging this if you're happy with it as I'd like to do a release soon. Worth opening an issue or PR for the test in https://github.com/cubed-dev/cubed-xarray |
|
Sorry I won't really have much time to be more helpful here until ~2 weeks from now. |
|
I pushed a fix (9d4a089) that was causing this to fail for for I haven't been able to reproduce the original failure in #855 though. I think there may be something special about the dataset that triggers this (indexes?). Perhaps we can merge this since it fixes #855 for @TomNicholas, and we have cubed-dev/cubed-xarray#41 to track adding a test (which should be easier now we have #864). |
Fixes #855 by using
._dataas suggested.However I get another weird error with the diagnostics code:
Details
(I'm running this on Azure via a Coiled notebook)
Also doesn't have a test yet.