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

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 37.77778% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.52%. Comparing base (b87c013) to head (ee986b0).

Files with missing lines Patch % Lines
src/metkit/codes/CodesDataContent.cc 20.75% 42 Missing ⚠️
src/metkit/codes/api/CodesAPI.cc 58.33% 5 Missing ⚠️
src/metkit/codes/BUFRDecoder.cc 0.00% 4 Missing ⚠️
src/metkit/codes/GRIBDecoder.cc 25.00% 3 Missing ⚠️
src/metkit/codes/BufrContent.cc 33.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #128      +/-   ##
===========================================
- Coverage    71.07%   70.52%   -0.56%     
===========================================
  Files          130      132       +2     
  Lines         8160     8214      +54     
  Branches       781      783       +2     
===========================================
- Hits          5800     5793       -7     
- Misses        2360     2421      +61     

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

4 participants