You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add more rules to our ruff config. Current ones I'm seeing:
Pathlib PTH
Pytest style PT
PyLint PL
A brief check shows some things I'd want to look into with the first two. Pylint will need to be more judicious, since a brief look seems to show some things I don't care to fix (overwriting loop variables). That said, I also just saw this while writing:
PLW0177 Comparing against a NaN value; use `math.isnan` instead
--> src/metpy/io/gempak.py:2599:12
|
2598 | station['TIME'] = parsed.date_time.time()
2599 | if math.nan in [parsed.altimeter, parsed.elevation, parsed.temperature]:
| ^^^^^^^^
2600 | station['PMSL'] = missing
2601 | else:
|
which is suspicious but somehow isn't a bug, though should be changed anyways:
Ok, based on this post it seems to be that is is getting the nan check above to work. But if you change the source of nan (since IEEE-754 defines many nans that differ bit-wise), you can get it to fail:
importmatha= [1, 1.1, float('nan')]
math.nanina
False
So the issue found by the PLW rule above is definitely a bug that should be fixed.
Activity
dopplershift commentedon Feb 12, 2026
Ok, based on this post it seems to be that
isis getting the nan check above to work. But if you change the source of nan (since IEEE-754 defines many nans that differ bit-wise), you can get it to fail:FalseSo the issue found by the PLW rule above is definitely a bug that should be fixed.