Skip to content

Adds a type check to Omega Config#454

Merged
philipwjones merged 2 commits into
E3SM-Project:developfrom
philipwjones:omega/config-type-check
Jul 2, 2026
Merged

Adds a type check to Omega Config#454
philipwjones merged 2 commits into
E3SM-Project:developfrom
philipwjones:omega/config-type-check

Conversation

@philipwjones

@philipwjones philipwjones commented Jul 1, 2026

Copy link
Copy Markdown

Adds a data type check to Config retrievals in order to provide a clearer error message than the generic yaml-cpp message. When yaml-cpp cannot convert to the requested data type, Omega now aborts with a clear error message that includes the offending variable name.

Fixes #444

Checklist

  • Documentation: Does not impact existing documentation
  • Linting
  • Building
    • CMake build does not produce any new warnings from changes in this PR
  • Testing
    • Add a comment to the PR titled Testing with the following:
      • Which machines CTest unit tests
        have been run on and indicate that are all passing.
      • The Polaris omega_pr test suite
        has passed, using the Polaris e3sm_submodules/Omega baseline
      • Document machine(s), compiler(s), and the build path(s) used for -p for both the baseline (Polaris e3sm_submodules/Omega) and the PR build
      • Indicate "All tests passed" or document failing tests
      • Document testing used to verify the changes including any tests that are added/modified/impacted.
      • Performance related PRs: Please include a relevant PACE experiment link documenting performance before and after.

  adds an explicit error check for a type conversion error
  to enable better error handling and a clearer error message
  also adds the variable name to the abort message to better
  isolate the error
@philipwjones philipwjones requested review from cbegeman and xylar July 1, 2026 17:28
@philipwjones philipwjones self-assigned this Jul 1, 2026
@philipwjones

Copy link
Copy Markdown
Author

CTests pass on PM cpu and gpu. Also tested with an edited Config with bad inputs to verify appropriate error messages are generated.

@cbegeman cbegeman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@philipwjones Thanks for getting to this so quickly! I think this will be broadly helpful. Would you like me to do any additional testing?

@xylar xylar left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approving based on an inspection of the code. I agree, these error messages will be helpful.

@philipwjones philipwjones merged commit 4362b49 into E3SM-Project:develop Jul 2, 2026
1 check passed
@philipwjones philipwjones deleted the omega/config-type-check branch July 2, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run aborts when IO frequency is given as float

3 participants