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

Remove any Pint objects from METAR parser output #1921

Merged
merged 1 commit into from Jun 18, 2021

Conversation

23ccozad
Copy link
Contributor

@23ccozad 23ccozad commented Jun 18, 2021

After further review of #1918 with @dopplershift, we determined that Pint quantities were being used in eastward_wind and northward_wind columns of dataframes coming out of the METAR parser functions, and this was causing problems down the road when it came to plotting wind barbs. In this PR, we change how eastward_wind and northward_wind are created so that they are floats instead of Pint objects. This should solve the original issue #1916 related to the nightly build failing.

This PR also adds a new test that makes sure that none of the columns in the dataframes created by METAR parsers contain Pint quantities.

Checklist

@23ccozad 23ccozad added Area: IO Pertains to reading data Area: Units Pertains to unit information Type: Bug Something is not working like it should labels Jun 18, 2021
@23ccozad 23ccozad mentioned this pull request Jun 18, 2021
1 task
@23ccozad 23ccozad marked this pull request as ready for review June 18, 2021 20:36
"""Test that there are no Pint quantities in dataframes created by parser."""
# Test parse_metar_file()
input_file = get_test_data('metar_20190701_1200.txt', mode='rt')
df = parse_metar_file(input_file)
Copy link
Member

Choose a reason for hiding this comment

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

Could loop over df like:

for df in (parse_metar_file(input_file), parse_metar_to_dataframe(metar_str)):
...

@dopplershift dopplershift merged commit 1eb7162 into Unidata:main Jun 18, 2021
@github-actions github-actions bot added this to the 1.1.0 milestone Jun 18, 2021
@23ccozad 23ccozad deleted the metar_parser_object_bug branch June 28, 2021 17:57
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 Area: Units Pertains to unit information Type: Bug Something is not working like it should
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nightly build is failing
2 participants