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

Fix #70 by bypassing lazy loading of datasets #71

Merged
merged 1 commit into from
Jun 28, 2023
Merged

Conversation

aazuspan
Copy link
Owner

Closes #70.

By default, rioxarray lazyily loads datasets. On Windows, this causes a PermissionError when the temporary directory containing the downloaded files is deleted, as it is still open in rioxarray. To avoid that issue, we now explicitly load the dataset into memory, allowing tempfiles to be removed. This will potentially increase memory usage in some use cases, but given the size limitations of datasets downloaded from Earth Engine, that should never be a practical problem.

By default, rioxarray lazyily loads datasets. On Windows, this causes
a PermissionError when the temporary directory containing the downloaded
files is deleted, as it is still open in rioxarray. To avoid that issue,
we now explicitly load the dataset into memory, allowing tempfiles to be
removed. This will potentially increase memory usage in some use cases, but
given the size limitations of datasets downloaded from Earth Engine, that
should never be a practical problem.
@aazuspan aazuspan added the bug Something isn't working label Jun 28, 2023
@aazuspan aazuspan self-assigned this Jun 28, 2023
@aazuspan aazuspan merged commit 77ba981 into main Jun 28, 2023
4 checks passed
@aazuspan aazuspan deleted the fix_permission_error branch June 28, 2023 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PermissionError when using to_xarray on Windows
1 participant