Skip to content

added grib2 conversion to parse-mars-request CLI tool#224

Merged
danovaro merged 5 commits into
developfrom
feature/grib2-convert
Jun 19, 2026
Merged

added grib2 conversion to parse-mars-request CLI tool#224
danovaro merged 5 commits into
developfrom
feature/grib2-convert

Conversation

@danovaro

Copy link
Copy Markdown
Member

Description

add --grib2 flag to parse-mars-request, to trigger mars request conversion to the mtg2 version

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 the parse-mars-request CLI tool with a --grib2 flag to convert expanded MARS requests into the “full GRIB2 metadata” (via mars2mars) and then optionally re-compacts the resulting flattened requests.

Changes:

  • Add --grib2 CLI option and usage example to trigger conversion of requests to GRIB2-oriented metadata.
  • Implement conversion by flattening requests into per-field requests, converting them, and compacting/merging them using HyperCube logic when possible.

mars2grib documentation sync (per repo guidelines):

  • Impacted files under src/metkit/mars2grib/**: none
  • Impacted files under tests/mars2grib/**: none
  • Documentation status: ✅ in sync (no mars2grib-doc-scoped files changed)

Comment thread src/tools/parse-mars-request.cc
Comment thread src/tools/parse-mars-request.cc
Comment thread src/tools/parse-mars-request.cc Outdated
Comment thread src/tools/parse-mars-request.cc Outdated
ParseRequest(int argc, char** argv) : MetkitTool(argc, argv) {
options_.push_back(new SimpleOption<bool>("json", "Format request in json, default = false"));
options_.push_back(new SimpleOption<bool>("compact", "Compact output, default = false"));
options_.push_back(new SimpleOption<bool>("grib2", "Convert request to the full Grib2 metadata, default = false"));
@codecov-commenter

codecov-commenter commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 9.09091% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.44%. Comparing base (343fa5c) to head (74ed5c8).
⚠️ Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
src/tools/parse-mars-request.cc 9.09% 40 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #224      +/-   ##
===========================================
+ Coverage    54.95%   55.44%   +0.48%     
===========================================
  Files          323      322       -1     
  Lines        13900    13785     -115     
  Branches      1120     1102      -18     
===========================================
+ Hits          7639     7643       +4     
+ Misses        6261     6142     -119     

☔ View full report in Codecov by Harness.
📢 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.

@tweska tweska left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested it and it looks good to me. If we want to access the mars2mars mappings through this tool, we should remove this: src/tools/request-to-mtg2.cc

@danovaro danovaro force-pushed the feature/grib2-convert branch from 1bb888c to 82f3b68 Compare June 18, 2026 14:03
@danovaro danovaro merged commit cd24939 into develop Jun 19, 2026
101 checks passed
@danovaro danovaro deleted the feature/grib2-convert branch June 19, 2026 05:27
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