Skip to content

Add Xarray gpu support#745

Merged
sandorkertesz merged 14 commits into
developfrom
feature/xarray-gpu
Jul 18, 2025
Merged

Add Xarray gpu support#745
sandorkertesz merged 14 commits into
developfrom
feature/xarray-gpu

Conversation

@sandorkertesz

@sandorkertesz sandorkertesz commented Jul 18, 2025

Copy link
Copy Markdown
Collaborator

Requires the develop branch of earthkit-utils.

This PR:

  • added the array_backend option to to_xarray() and made the previously used array_module option deprecated
  • made the array_backend option work in to_xarray() both for generating lazy loaded and in-memory Xarrays
  • the current code internally is always using a "patched" array namespace from earthkit-utils. This should be revisited.
  • improved the dtype option for to_xarray(). Now it accepts str for all backends and internally converts it into an array-api-compat dtype object.
  • added the to_device() method to the earthkit Xarray accessor to move the array values to the specified device and array backend

New notebook: docs/examples/xarray_cupy.ipynb

@codecov-commenter

codecov-commenter commented Jul 18, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.86275% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.61%. Comparing base (6d58af7) to head (432805b).
⚠️ Report is 299 commits behind head on develop.

Files with missing lines Patch % Lines
tests/xr_engine/test_xr_torch.py 40.54% 22 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #745      +/-   ##
===========================================
- Coverage    90.76%   90.61%   -0.15%     
===========================================
  Files          171      172       +1     
  Lines        13050    13080      +30     
  Branches       625      625              
===========================================
+ Hits         11845    11853       +8     
- Misses        1015     1037      +22     
  Partials       190      190              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sandorkertesz sandorkertesz merged commit f9e7e61 into develop Jul 18, 2025
130 of 131 checks passed
@sandorkertesz sandorkertesz deleted the feature/xarray-gpu branch July 18, 2025 13:50
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.

3 participants