Skip to content

Conversation

@pgeier
Copy link
Contributor

@pgeier pgeier commented Nov 18, 2025

Description

This PR creates a copy of CodesContent with the name CodesDataContent.
CodesDataContent is using the new CodesHandle API wrapper to avoid using eccodes directly.

  • The MallocCodesContent has been removed as it had wrong behaviour - after a modification to the handle in returned the old data array.
  • codesHandleFromFile has been extended with an optional offset parameter
  • new call codesHandleFromStream
  • Additional exception CodesWrongLength

Depending downstream dependencies are fdb - a separate PR (ecmwf/fdb#198) - unfortunately we can not test the CI using 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.

@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2025

Codecov Report

❌ Patch coverage is 52.29358% with 52 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.18%. Comparing base (15a0584) to head (85684a2).

Files with missing lines Patch % Lines
src/metkit/codes/CodesDataContent.cc 25.00% 42 Missing ⚠️
src/metkit/codes/api/CodesAPI.cc 76.66% 7 Missing ⚠️
src/metkit/codes/BufrContent.cc 33.33% 2 Missing ⚠️
src/metkit/codes/BUFRDecoder.cc 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #128      +/-   ##
===========================================
- Coverage    54.31%   54.18%   -0.14%     
===========================================
  Files          298      300       +2     
  Lines        11514    11564      +50     
  Branches      1021     1025       +4     
===========================================
+ Hits          6254     6266      +12     
- Misses        5260     5298      +38     

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

@Ozaq Ozaq self-requested a review November 20, 2025 08:01
@pgeier pgeier force-pushed the feature/METK-145-Refactor-CodesContent branch 3 times, most recently from 330cf6c to 4329de1 Compare November 20, 2025 11:08

return eckit::message::Message(new MallocCodesContent(data, size, 0));
return eckit::message::Message(
new CodesContent(codesHandleFromMessageCopy({static_cast<const uint8_t*>(data.get()), size})));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to run this past @simondsmart because we might impact performance due to the additional copy.

@pgeier pgeier force-pushed the feature/METK-145-Refactor-CodesContent branch 3 times, most recently from 86f2a5a to 9eb32f2 Compare November 20, 2025 14:03
@Ozaq Ozaq force-pushed the feature/METK-145-Refactor-CodesContent branch from 9eb32f2 to a70318a Compare December 2, 2025 21:23
@pgeier pgeier force-pushed the feature/METK-145-Refactor-CodesContent branch from a70318a to 5e17fd3 Compare January 8, 2026 10:10
@pgeier pgeier force-pushed the feature/METK-145-Refactor-CodesContent branch 3 times, most recently from a08adb1 to 2240056 Compare January 9, 2026 14:21
@pgeier pgeier marked this pull request as draft January 9, 2026 14:30
@pgeier pgeier force-pushed the feature/METK-145-Refactor-CodesContent branch from 769c854 to ee986b0 Compare January 13, 2026 10:35
@pgeier pgeier force-pushed the feature/METK-145-Refactor-CodesContent branch 2 times, most recently from 8c6522a to 1ff1cf8 Compare January 30, 2026 12:57
@pgeier pgeier marked this pull request as ready for review January 30, 2026 12:59
@pgeier pgeier force-pushed the feature/METK-145-Refactor-CodesContent branch from 1ff1cf8 to e9a7485 Compare January 30, 2026 13:07
Copy link
Contributor

@simondsmart simondsmart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great.

@danovaro danovaro merged commit 0ce2f79 into develop Feb 2, 2026
192 checks passed
@danovaro danovaro deleted the feature/METK-145-Refactor-CodesContent branch February 2, 2026 14:31
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.

6 participants