Skip to content

Feature/paramid normalisation mode#188

Merged
danovaro merged 3 commits intodevelopfrom
feature/paramidNormalisationMode
Apr 8, 2026
Merged

Feature/paramid normalisation mode#188
danovaro merged 3 commits intodevelopfrom
feature/paramidNormalisationMode

Conversation

@danovaro
Copy link
Copy Markdown
Member

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.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 98.40000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.93%. Comparing base (f97d405) to head (a3e9634).
⚠️ Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
src/metkit/mars/ParamID.cc 66.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #188      +/-   ##
===========================================
- Coverage    61.95%   61.93%   -0.03%     
===========================================
  Files          303      303              
  Lines        11673    11674       +1     
  Branches      1046     1048       +2     
===========================================
- Hits          7232     7230       -2     
- Misses        4441     4444       +3     

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

@danovaro danovaro force-pushed the feature/paramidNormalisationMode branch from ce8d203 to 525ae34 Compare April 8, 2026 09:15
@danovaro danovaro requested a review from Copilot April 8, 2026 10:41
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

Adds an explicit parameter-ID normalisation mode to ParamID::normalise() and updates tests to exercise the new mode-based API instead of the previous boolean flags.

Changes:

  • Introduce metkit::NormalisationMode and a new ParamID::normalise(..., NormalisationMode) overload (with deprecated legacy overloads).
  • Replace the global fullTableDropping_ flag with a mode returned by ParamID::normalisationMode().
  • Update tests/test_param_axis.cc to call ParamID::normalise() using NormalisationMode (including Strict, Loose, FullTableDropping cases).

Reviewed changes

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

File Description
tests/test_param_axis.cc Migrates param-axis tests from (useParamId, fullTableDropping) booleans to NormalisationMode inputs.
src/metkit/mars/ParamID.h Adds NormalisationMode, introduces the mode-based normalise overload, and deprecates legacy APIs.
src/metkit/mars/ParamID.cc Loads/stores the configured default normalisation mode from param-matching.yaml.

Impacted files under src/metkit/mars2grib/**: none (documentation sync checks not applicable).

Comment on lines +39 to +41
Strict, // Exact match + wind conversion
Loose, // Strict + partial match (dropping tables defined in param-matching.yaml)
FullTableDropping
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The inline comments on NormalisationMode are misleading: Strict currently disables the partial-match logic (it is guarded by !strict), so Loose is not “Strict + partial match”. Please adjust these comments to reflect the actual behaviors (e.g., whether GRIB1 value matching and table-expansion are enabled) to avoid confusing API users.

Suggested change
Strict, // Exact match + wind conversion
Loose, // Strict + partial match (dropping tables defined in param-matching.yaml)
FullTableDropping
Strict, // Exact match only (no partial table expansion) + wind conversion
Loose, // GRIB1-style/value-based matching with partial table expansion from param-matching.yaml +
// wind conversion
FullTableDropping // GRIB1-style/value-based matching with full configured table dropping + wind conversion

Copilot uses AI. Check for mistakes.
@@ -56,9 +56,9 @@ static void test_param_axis(const std::vector<std::string>& user, const std::vec
std::cout << "Axis:" << index << std::endl;
std::cout << "User:" << params << std::endl;
std::cout << "Wind:" << false << std::endl;
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

This debug output prints a constant false for Wind, which is confusing when diagnosing test failures. Consider printing windRequested (and/or expectWind) here so the log reflects the actual state being asserted later.

Suggested change
std::cout << "Wind:" << false << std::endl;
std::cout << "Initial Wind:" << windRequested << ", Expected Wind:" << expectWind << std::endl;

Copilot uses AI. Check for mistakes.
@danovaro danovaro merged commit 8f01f7e into develop Apr 8, 2026
29 checks passed
@danovaro danovaro deleted the feature/paramidNormalisationMode branch April 8, 2026 11:50
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