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

Incorrect logic in setdates? #257

Closed
vidklopcic opened this issue Aug 18, 2024 · 1 comment
Closed

Incorrect logic in setdates? #257

vidklopcic opened this issue Aug 18, 2024 · 1 comment

Comments

@vidklopcic
Copy link

There seems to be an error in the logic for setting dates:

if grb.has_key('forecastTime'):

    if grb.has_key('forecastTime'):
        if grb.has_key('forecastTime'):    # always True
            ftime = grb.forecastTime
        elif grb.has_key('stepRange'):    # mis-indentation?
            # if forecastTime doesn't exist, use end of stepRange.
            ftime = grb['stepRange'] # computed key, uses stepUnits
            if grb.has_key('stepUnits') and grb.stepUnits in _ftimedict:
                grb.fcstimeunits = _ftimedict[grb.stepUnits]
            # if it's a range, use the end of the range to define validDate
            try: 
                ftime = float(ftime.split('-')[1])
            except:
                ftime = None
    else:
        ftime = 0
@jswhit
Copy link
Owner

jswhit commented Sep 1, 2024

closed by pr #258

@jswhit jswhit closed this as completed Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants