Skip to content

ParamID strict behavior#175

Closed
danovaro wants to merge 0 commit intodevelopfrom
feature/METK-161-gribParamID
Closed

ParamID strict behavior#175
danovaro wants to merge 0 commit intodevelopfrom
feature/METK-161-gribParamID

Conversation

@danovaro
Copy link
Member

@danovaro danovaro commented Mar 4, 2026

Description

METK-161 added optional parameter to ParamID::normalise to request strict behavior

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 Mar 4, 2026

Codecov Report

❌ Patch coverage is 99.47090% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 61.42%. Comparing base (250f0da) to head (067b6ab).
⚠️ Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
src/metkit/mars/ParamID.h 98.61% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #175      +/-   ##
===========================================
+ Coverage    61.02%   61.42%   +0.40%     
===========================================
  Files          309      309              
  Lines        11732    11723       -9     
  Branches      1035     1019      -16     
===========================================
+ Hits          7159     7201      +42     
+ Misses        4573     4522      -51     

☔ 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/METK-161-gribParamID branch from 52d2b41 to 618ac13 Compare March 4, 2026 16:21
@danovaro danovaro requested a review from Copilot March 4, 2026 16:23
Copy link

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

This PR extends metkit::ParamID::normalise() with an additional optional boolean parameter, allowing callers to explicitly select an alternate normalisation path (previously only enabled via the useGRIBParamID resource).

Changes:

  • Adds a new optional parameter to ParamID::normalise()’s signature.
  • Switches the normalisation branch condition to useGRIBParamID || useParamId to allow explicit caller override.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +55 to +56
static void normalise(const REQUEST_T& r, std::vector<Param>& req, const AXIS_T& axis, bool& windConversion,
bool fullTableDropping = ParamID::fullTableDropping());
bool fullTableDropping = ParamID::fullTableDropping(), bool useParamId = false);
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The new boolean parameter useParamId doesn’t match the PR description (“strict behavior”) and is also ambiguous vs the existing useGRIBParamID resource. Consider renaming this parameter to reflect the behavioral intent (e.g., strict/strictNormalisation or forceGRIBParamID) and documenting what behavior changes when it is enabled.

Copilot uses AI. Check for mistakes.
Comment on lines 79 to 80
if (useGRIBParamID || useParamId) {

Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

useParamId forces the useGRIBParamID branch (if (useGRIBParamID || useParamId)), but the debug logging inside this branch still labels the mode as useGRIBParamID. If this flag is intended for callers to request a different/stricter behavior, the logging (and possibly the condition naming) should be updated so diagnostics clearly reflect which mode is active.

Copilot uses AI. Check for mistakes.
Comment on lines 79 to 80
if (useGRIBParamID || useParamId) {

Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

This change introduces a new normalization mode controllable via useParamId, but there are existing unit tests for ParamID::normalise (e.g., tests/test_param_axis.cc) and none currently exercise the new flag. Please add/extend tests to cover the behavior when useParamId=true (especially when the useGRIBParamID resource is false) to prevent regressions.

Copilot uses AI. Check for mistakes.
@danovaro danovaro force-pushed the feature/METK-161-gribParamID branch from 72186b2 to 067b6ab Compare March 5, 2026 12:27
@danovaro danovaro closed this Mar 5, 2026
@danovaro danovaro force-pushed the feature/METK-161-gribParamID branch from 067b6ab to 37662f2 Compare March 5, 2026 15:37
@danovaro danovaro deleted the feature/METK-161-gribParamID branch March 5, 2026 15:38
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