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 repeated use of build_remapping with a patch #412

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

sandorkertesz
Copy link
Collaborator

This PR fixes the issue when repeated use of remapping with a patch lost the original remapping. Now this works as expected and in the following code r1 and r2 define the same remapping (and patches).

from earthkit.data.core.order import build_remapping
remapping = {"type": "{type}{number}"}
patch = {"type": {"cf0": "x"}}
r1 = build_remapping(remapping, patch)
r2 = build_remapping(r1)

This PR also adds tests for using remapping and patches.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.96%. Comparing base (4973af9) to head (024f32b).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #412      +/-   ##
===========================================
+ Coverage    89.92%   89.96%   +0.03%     
===========================================
  Files          120      121       +1     
  Lines         7764     7794      +30     
  Branches       675      679       +4     
===========================================
+ Hits          6982     7012      +30     
  Misses         651      651              
  Partials       131      131              

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

@sandorkertesz sandorkertesz merged commit 8000b2e into develop Jun 26, 2024
83 checks passed
@sandorkertesz sandorkertesz deleted the feature/test-remapping-patch branch June 26, 2024 12:43
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