Skip to content

Use memory efficiently when calling xarray#795

Draft
jlmaurer wants to merge 1 commit intodbekaert:devfrom
jlmaurer:update_xarray
Draft

Use memory efficiently when calling xarray#795
jlmaurer wants to merge 1 commit intodbekaert:devfrom
jlmaurer:update_xarray

Conversation

@jlmaurer
Copy link
Copy Markdown
Collaborator

@jlmaurer jlmaurer commented Apr 15, 2026

Description

xarray makes available two methods for opening datasets, open_dataset and load_dataset. Using open_dataset allows for lazy loading and memory efficiency. This change results in much better memory performance for RAiDER.

This PR also wraps netcdf dataset opening with try/except/finally logic that ensures the datasets are closed properly.

All unit tests pass locally.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have added an explanation of what your changes do and why you'd like us to include them.
  • I have written new tests for your core changes, as applicable.
  • I have successfully ran tests with your changes locally.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant