fix overwrite lazy loaded files #242
Open
+64
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue addressed
Fixes #
Explanation
Ik zit een beetje te kijken naar die xu_open_dataset PR en ben steeds meer overtuigd dat jullie gewoon load dataset moeten gebruiken.
Is hetzelfde principe als normaal files openen in python:
of met context managers:
Dit is precies wat load_dataset() doet, alleen dan leest die de hele ds uit.
Als je maar een deel wil uitlezen, kan dat nog steeds met:
of met context manager:
De schuld ligt bij xugrid, want die openen de file en doen er daarna niks meer mee, waardoor het anders is dan wat xarray doet.
Ik heb een testje erbij geschreven in je branch met wat extra uitleg.
Belangrijk te weten dat lazy loading dus eigenlijk alleen mogelijk is in dezelfde scope als waar je de file opent.
Checklist
main
Additional Notes (optional)
Add any additional notes or information that may be helpful.