Skip to content

Fixes for ERA6 re-encoding#194

Merged
dsarmany merged 2 commits intorelease/1.18.0from
bugfix/era6-re-encoding
Apr 15, 2026
Merged

Fixes for ERA6 re-encoding#194
dsarmany merged 2 commits intorelease/1.18.0from
bugfix/era6-re-encoding

Conversation

@dsarmany
Copy link
Copy Markdown
Contributor

Description

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts mars2grib concept matchers to better align ERA6 re-encoding behavior with expected tables/level/point-in-time handling for specific parameter IDs.

Changes:

  • Remove the chemical-products special-case that selected TablesType::Custom in the tables matcher.
  • Expand/shift several parameter ranges in the point-in-time matcher (incl. additional 21x/262xxx codes).
  • Update level matching for SFC/O2D to align with the updated parameter coverage (incl. 262900, 262906, 262907, and updated 21x ranges).

Impacted files under src/metkit/mars2grib/**:

  • src/metkit/mars2grib/backend/concepts/tables/tablesMatcher.h
  • src/metkit/mars2grib/backend/concepts/point-in-time/pointInTimeMatcher.h
  • src/metkit/mars2grib/backend/concepts/level/levelMatcher.h

Documentation status (src/metkit/mars2grib/docs/**): ✅ in sync (no public-behavior documentation found that enumerates/depends on these specific param-ID lists).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/metkit/mars2grib/backend/concepts/tables/tablesMatcher.h Stops selecting custom tables for chemical params (now always default).
src/metkit/mars2grib/backend/concepts/point-in-time/pointInTimeMatcher.h Adjusts param inclusion ranges (notably 21x and 262xxx additions/expansions).
src/metkit/mars2grib/backend/concepts/level/levelMatcher.h Aligns SFC and O2D level matching with updated param ranges/new ocean-related params.

Comment on lines 15 to 22
std::size_t tablesMatcher(const MarsDict_t& mars, const OptDict_t& opt) {
using metkit::mars2grib::util::param_matcher::matchAny;
using metkit::mars2grib::util::param_matcher::range;
using metkit::mars2grib::utils::dict_traits::get_or_throw;

const auto param = get_or_throw<long>(mars, "param");
// Chemical products
if (matchAny(param, range(233032, 233035), range(235062, 235064))) {
return static_cast<std::size_t>(TablesType::Custom);
}

return static_cast<size_t>(TablesType::Default);
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

tablesMatcher() now always returns TablesType::Default, but it still reads param via get_or_throw and keeps matchAny/range using-declarations and the param-matcher include. This adds an unnecessary dictionary access (and can throw if param is absent) despite param no longer influencing the result. Consider removing the param lookup and the now-unused matchAny/range aliases/includes, or otherwise documenting/justifying why param is still required here.

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 11, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 62.00%. Comparing base (8bdc834) to head (34dbdd1).
⚠️ Report is 3 commits behind head on release/1.18.0.

Files with missing lines Patch % Lines
...it/mars2grib/backend/concepts/level/levelMatcher.h 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release/1.18.0     #194   +/-   ##
===============================================
  Coverage           61.99%   62.00%           
===============================================
  Files                 303      303           
  Lines               11663    11661    -2     
  Branches             1048     1049    +1     
===============================================
- Hits                 7231     7230    -1     
+ Misses               4432     4431    -1     

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

@dsarmany dsarmany force-pushed the bugfix/era6-re-encoding branch from d4d4b8d to 9c289fd Compare April 12, 2026 08:50
@dsarmany dsarmany force-pushed the bugfix/era6-re-encoding branch from 9c289fd to 34dbdd1 Compare April 15, 2026 07:47
@dsarmany dsarmany merged commit 6e62646 into release/1.18.0 Apr 15, 2026
100 of 101 checks passed
@dsarmany dsarmany deleted the bugfix/era6-re-encoding branch April 15, 2026 07: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.

4 participants