-
Notifications
You must be signed in to change notification settings - Fork 416
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
set default METAR year, month from UTC date #2701
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding and fixing. Is there any reason you didn't use datetime.utcnow()
instead?
I can't think of any way to test realistically.
I stand corrected. If we monkey patch time.time() to return what we want, that will affect things the right way. I can push the test if you have no clue what I'm talking about. |
I did, but then I read the python docs and it told me the preferred way. |
I can likely try that later tonight or if you want to do it, go for it. |
Eh, @dopplershift, I could not figure it out. It also gets tricky as one has to ensure you have a situation of the current datetime (timezone could be anything around the world when this code runs) is for the previous month. I tried setting the |
Looks like |
closes #2700
Description Of Changes
METAR is a horrible format that provides just a UTC day, so we have to make life choices to figure out what the month and year is for this day. MetPy previously assumed a default year and month matching the current system localized date and not the current UTC date.
Checklist
Tests addedNo idea how this can be tested outside of doing naugthy things to python's datetime module?