Skip to content

Fix: xr_engine strict vs. aux_coords - #1030

Merged
sandorkertesz merged 2 commits into
developfrom
fix/xr_engine-strict
Jun 22, 2026
Merged

Fix: xr_engine strict vs. aux_coords#1030
sandorkertesz merged 2 commits into
developfrom
fix/xr_engine-strict

Conversation

@pawel-wolff

Copy link
Copy Markdown
Contributor

Description

This PR fixes the xr_engine handling of the aux_coords and strict arguments.

Changes

  • Invalid auxiliary coordinates are now handled consistently with the value of strict.

  • When an entry in aux_coords references a dimension that is not present in the dataset (e.g. aux_coords={"my_aux_coord": ("metadata_key", "unknown_dimension")}):

    • If strict=True, a ValueError is raised.
    • If strict=False, the invalid auxiliary coordinate is silently ignored.

Motivation

Allowing invalid auxiliary coordinates to be ignored when strict=False is particularly useful when using split_dims. In that case, an auxiliary coordinate may only be applicable to a subset of the datasets produced by the split, while being invalid for the others.

Tests

Added test coverage for both strict=True and strict=False behaviors, including a split_dims use case demonstrating that dataset-specific auxiliary coordinates are handled correctly.

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.

…when `strict=True`; otherwise the concerned aux coord is ignored. Is useful when `split_dims` and `aux_coords` may apply only to some of the datasets after the split.

Suitable tests added
@codecov-commenter

codecov-commenter commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.44%. Comparing base (a0d6492) to head (d89e54f).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1030      +/-   ##
===========================================
+ Coverage    82.43%   82.44%   +0.01%     
===========================================
  Files          237      237              
  Lines        16683    16698      +15     
  Branches       806      808       +2     
===========================================
+ Hits         13752    13767      +15     
  Misses        2694     2694              
  Partials       237      237              

☔ View full report in Codecov by Harness.
📢 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 ba7176e into develop Jun 22, 2026
136 of 137 checks passed
@sandorkertesz
sandorkertesz deleted the fix/xr_engine-strict branch June 22, 2026 15:48
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