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

Fix bug in GempakGrid #2904

Merged
merged 2 commits into from
Jan 27, 2023
Merged

Fix bug in GempakGrid #2904

merged 2 commits into from
Jan 27, 2023

Conversation

nawendt
Copy link
Contributor

@nawendt nawendt commented Jan 27, 2023

A non-existent attribute GDTM2 was referenced when creating the
Grid namedtuple. Since a majority of GEMPAK files do not define a
second time on grids, it was not detected. That is, GDT2 is rarely
defined and the logic statement gets terminated before actually checking
for GDTM2. The parameter name was changed to the correct GTM2.

Description Of Changes

Checklist

  • Tests added

A non-existent attribute GDTM2 was referenced when creating the
Grid namedtuple. Since a majority of GEMPAK files do not define a
second time on grids, it was not detected. That is, GDT2 is rarely
defined and the logic statement gets terminated before actually checking
for GDTM2. The parameter name was changed to the correct GTM2.
@nawendt nawendt requested a review from a team as a code owner January 27, 2023 17:23
@nawendt nawendt requested review from dopplershift and removed request for a team January 27, 2023 17:23
@dopplershift
Copy link
Member

Thanks for sending in the fix! Would it be possible to add the file in question to our static data (assuming it's not huge) and add a corresponding test--even if it basically just checks that the file opens without error?

@nawendt
Copy link
Contributor Author

nawendt commented Jan 27, 2023

Added a small test. Files will open, but having a second time assigned to a grid is not something that gets reflected in the xarray.Dataset. It's a similar problem to if more than one level is defined on a grid (see #2067). That will have to be dealt with separately.

@dopplershift dopplershift added Type: Bug Something is not working like it should Area: IO Pertains to reading data labels Jan 27, 2023
@dopplershift dopplershift added this to the February 2023 milestone Jan 27, 2023
@dopplershift dopplershift self-assigned this Jan 27, 2023
@dopplershift dopplershift merged commit bb6d261 into Unidata:main Jan 27, 2023
@nawendt nawendt deleted the fix-grid-bug branch April 25, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: IO Pertains to reading data Type: Bug Something is not working like it should
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants