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

Cleaning up analysis warnings #1937

Merged
merged 6 commits into from
Jun 30, 2021
Merged

Cleaning up analysis warnings #1937

merged 6 commits into from
Jun 30, 2021

Conversation

dopplershift
Copy link
Member

@dopplershift dopplershift commented Jun 25, 2021

Description Of Changes

Fixing up some style issues from CodeQL, including one real bug (in code for a NEXRAD product that likely no one uses).

  • Clean up some imports
  • Put set_agg_backend with the rest of the fixtures in conftest.py and only use on the one test that requires it (test_show in test_declarative.py, because otherwise it opens a window).
  • Enable a commented-out test in test_mapping.py--this was waiting on CartoPy>0.16 (0.17 came out November 2018). This is why, boys and girls, you don't comment things out but use skips and stuff.
  • Clean up some spots where file objects weren't being explicitly closed

Found by CodeQL warning.
Restructure or otherwise avoid potentially undefined local variables.
@dopplershift dopplershift added Type: Bug Something is not working like it should Type: Maintenance Updates and clean ups (but not wrong) Area: Tests Affects tests Area: IO Pertains to reading data labels Jun 25, 2021
@dopplershift
Copy link
Member Author

Ok, looks like the tests hung--I'm guessing due to the same show() test that brings up a window and waits here. I think I have a better way to handle this.

This puts it with the rest of the fixtures. Also set it in the only test
that seems to need it now.
Had been disabled since merge waiting on a viable Cartopy version, which
has long-since been released.
@dopplershift dopplershift marked this pull request as ready for review June 26, 2021 03:06
src/metpy/io/metar.py Outdated Show resolved Hide resolved
Inspired by some alerts from CodeQL, though most were false alarms.
@dopplershift
Copy link
Member Author

Should be good now.

@dcamron dcamron merged commit bb98358 into Unidata:main Jun 30, 2021
@github-actions github-actions bot added this to the 1.1.0 milestone Jun 30, 2021
@dopplershift dopplershift deleted the cleanup branch July 1, 2021 15:59
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: Tests Affects tests Type: Bug Something is not working like it should Type: Maintenance Updates and clean ups (but not wrong)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants