Skip to content

Conversation

hsoh-u
Copy link
Collaborator

@hsoh-u hsoh-u commented Apr 15, 2025

Expected Differences

  • Do these changes introduce new tools, command line arguments, or configuration file options? [No]

    If yes, please describe:

  • Do these changes modify the structure of existing or add new output data types (e.g. statistic line types or NetCDF variables)? [No]

    If yes, please describe:

Pull Request Testing

  • Describe testing already performed for these changes:

Only difference is having log messages or not.

  • select non zero center and local table number fist
  • If not exists, select zero center and local table number
  • Exclude if the grib2 entry has the same parameters

./plot_data_plane /d1/projects/METplus/discussions/2931/demo/2t-heightAboveGround-0002.grib2 grib2_entry.ps 'name="TMP"; level="Z002"; GRIB2_cntr=7;GRIB2_ltab=1;GRIB2_mtab=1;' -v 3

cp -p data/table_files/grib2_all.txt data/table_files/grib2_all_dup.txt

And ran the same command above

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:

Test other cases if exist.

  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [No]

  • Do these changes include sufficient testing updates? [No]

  • Will this PR result in changes to the MET test suite? [No]

    If yes, describe the new output and/or changes to the existing output:

  • Will this PR result in changes to existing METplus Use Cases? [Yes or No]

    If yes, create a new Update Truth METplus issue to describe them.

  • Do these changes introduce new SonarQube findings? [Yes or No]

    If yes, please describe:

  • Please complete this pull request review by [Fill in date].

Pull Request Checklist

See the METplus Workflow for details.

  • Review the source issue metadata (required labels, projects, and milestone).
  • Complete the PR definition above.
  • Ensure the PR title matches the feature or bugfix branch name.
  • Define the PR metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Milestone as the version that will include these changes
    Select: METplus-X.Y Support project for bugfix releases or MET-X.Y Development project for the next coordinated release
  • After submitting the PR, select the ⚙️ icon in the Development section of the right hand sidebar. Search for the issue that this PR will close and select it, if it is not already selected.
  • After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
  • Close the linked issue and delete your feature or bugfix branch from GitHub.

@hsoh-u hsoh-u added this to the MET-12.1.0 milestone Apr 15, 2025
@hsoh-u hsoh-u requested a review from JohnHalleyGotway April 15, 2025 23:44
@github-project-automation github-project-automation bot moved this to 🩺 Needs Triage in METplus-6.1 Development Apr 15, 2025
@JohnHalleyGotway JohnHalleyGotway changed the title Bugfix 3107 multiple grib2 entry Bugfix #3107 multiple grib2 entry Apr 16, 2025
@JohnHalleyGotway JohnHalleyGotway moved this from 🩺 Needs Triage to 🔎 In review in METplus-6.1 Development Apr 16, 2025
Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway left a comment

Choose a reason for hiding this comment

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

I approve of these changes.

I see that the changes are limited to table_lookup.h and table_lookup.cc and I see that you included some SonarQube code smells fixes. Thanks!

I tested this in seneca:/d1/projects/MET/MET_pull_requests/met-12.1.0/rc1/MET-bugfix_3107_multiple_grib2_entry with the following command for the source #3107 issue:

plot_data_plane /d1/projects/METplus/discussions/2931/demo/2t-heightAboveGround-0002.grib2 ./out.ps 'name="TMP"; level="Z002"; GRIB2_cntr=7;GRIB2_ltab=1;GRIB2_mtab=1;' -v 3

And I note that when testing with the NB version /d1/projects/MET/MET_regression/develop/NB20250416/MET-develop/bin/plot_data_plane, the following log message appear:

DEBUG 3: Multiple GRIB2 table entries match lookup criteria (parm_name = TMP, grib2_mtab = 1, grib2_cntr = 7, grib2_ltab = 1):
DEBUG 3:   parm_name: TMP, index_a = 0, grib2_mtab = 1, grib2_cntr = 0, grib2_ltab = 0, index_b = 0, index_c = 0
DEBUG 3:   parm_name: TMP, index_a = 0, grib2_mtab = 1, grib2_cntr = 7, grib2_ltab = 1, index_b = 0, index_c = 0
DEBUG 3: Using the first match found:   parm_name: TMP, index_a = 0, grib2_mtab = 1, grib2_cntr = 0, grib2_ltab = 0, index_b = 0, index_c = 0

But those no longer appear with the changes in this PR.

@hsoh-u hsoh-u merged commit 25f1420 into develop Apr 17, 2025
40 checks passed
@github-project-automation github-project-automation bot moved this from 🔎 In review to 🏁 Done in METplus-6.1 Development Apr 17, 2025
@hsoh-u hsoh-u deleted the bugfix_3107_multiple_grib2_entry branch May 20, 2025 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: 🏁 Done
Development

Successfully merging this pull request may close these issues.

Bugfix: Refine the MET GRIB2 library logic to find a single GRIB2 table match rather than multiple ones
2 participants