Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1800. Add file name to NC4 asserts #1813

Merged
merged 3 commits into from
Nov 17, 2022

Conversation

mathomp4
Copy link
Member

Description

This PR adds to asserts in NetCDF4_get_var.H so that not only will the variable be output, but also the file in question.

Related Issue

Closes #1800

Motivation and Context

Makes the error message a bit more explicit helping to find bad files.

How Has This Been Tested?

Hard to test assertion failures. Maybe @lizziel has a case that triggers it?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)

Checklist:

  • I have tested this change with a run of GEOSgcm (if non-trivial)
  • I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
  • I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

@mathomp4 mathomp4 added the 0 Diff Trivial The changes in this pull request are trivially zero-diff (documentation, build failure, &c.) label Nov 14, 2022
@mathomp4 mathomp4 self-assigned this Nov 14, 2022
@mathomp4 mathomp4 requested a review from a team as a code owner November 14, 2022 20:38
Copy link
Contributor

@lizziel lizziel left a comment

Choose a reason for hiding this comment

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

Looks good! Regarding testing, I'm not sure how the user files that triggered issues in NetCDF4_get_var.H were corrupted. Perhaps simply removing a required variable would work, or maybe that would get caught earlier on.

@mathomp4 mathomp4 merged commit 1b2034e into develop Nov 17, 2022
@mathomp4 mathomp4 deleted the feature/mathomp4/1800-add-filename-to-netcdf-error branch November 17, 2022 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Diff Trivial The changes in this pull request are trivially zero-diff (documentation, build failure, &c.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants