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
Generated docs show fixed default values, taken when the docs were last built (i.e. currently parse_metar_file(filename, year=2020, month=1))
If a user has a long running process, IPython/Jupyter window open for awhile, etc., calls to parse_metar_file are not going to use the current year/month, but the year/month when MetPy was imported.
So we should change this to default to None, and then check for None and convert that to the appropriate values.
The text was updated successfully, but these errors were encountered:
My opinion is that you need more granularity here to also specify the day, so to get things right when parsing archived METARs around the first of the month.
So I couple with @akrherz as I have run into this issue quite a bit and think we may need to add in hour as well. Here is some code that would work to alleviate the problem, but with the need to have year, month, day, and hour, then we might as well make the input be a date time object.
Likely preaching to the choir here, but there's craziness on the noaaport feed, mostly international METARs
Products that come every hour with the same WMO header timestamp, for example one is coming today with a day timestamp of 31.
Products that come with a valid and current WMO header timestamp, but have actual METARS with various random dates that could be in the future or past or neither.
Products with valid WMO headers that update hourly, but the same METAR repeated every hour that is likely valid some number of years ago.
Right now, the signature of
parse_metar_file
is:This can create some confusion:
parse_metar_file(filename, year=2020, month=1)
)parse_metar_file
are not going to use the current year/month, but the year/month when MetPy was imported.So we should change this to default to
None
, and then check forNone
and convert that to the appropriate values.The text was updated successfully, but these errors were encountered: