Skip to content

Fix/grid consistency check#1003

Open
pawel-wolff wants to merge 3 commits into
developfrom
fix/grid-consistency-check
Open

Fix/grid consistency check#1003
pawel-wolff wants to merge 3 commits into
developfrom
fix/grid-consistency-check

Conversation

@pawel-wolff
Copy link
Copy Markdown
Contributor

@pawel-wolff pawel-wolff commented May 22, 2026

Description

This PR fixes the issue #1000.

The proposed solution enforces the grid consistency check across fields from which xr_engine is trying to build an xarray.Dataset object. The grid check is based on Field.geography.unique_grid_id().

Additionally, the following related changes have been made:

  • If the grid consistency fails, a diagnostic message is passed along with the exception.
  • src/earthkit/data/core/field.py:Field.from_components(): if no geography is given but shape_hint is known (from values or data), an EmptryGeography(shape_hint) object is attached to a constructed field rather than a bare EmptyGeography(). This allows both:

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

…ields, detailed diagnosis message added into ValueError

Some code cleaning and refactoring: the module xr_engine.splitter removed and pertinent logic incorporated into xr_engine.builder.SplitDatasetBuilder
@pawel-wolff pawel-wolff requested a review from sandorkertesz May 22, 2026 13:15
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 22, 2026

Codecov Report

❌ Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.54%. Comparing base (84aa271) to head (0ad8fb2).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
tests/netcdf/test_netcdf_output.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1003      +/-   ##
===========================================
+ Coverage    81.51%   81.54%   +0.02%     
===========================================
  Files          236      236              
  Lines        15472    15493      +21     
  Branches       756      756              
===========================================
+ Hits         12612    12633      +21     
  Misses        2634     2634              
  Partials       226      226              

☔ 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.

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.

2 participants