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

Siphon default regex in siphon/catalog.py fails for days 30/31 #172

Closed
pjpokran opened this issue Dec 1, 2017 · 3 comments
Closed

Siphon default regex in siphon/catalog.py fails for days 30/31 #172

pjpokran opened this issue Dec 1, 2017 · 3 comments

Comments

@pjpokran
Copy link
Contributor

pjpokran commented Dec 1, 2017

Siphon routine filter_time_nearest was returning the wrong times for days 30 and 31 of a month. I believe the problem is line 44 of siphon/catalog.py. The default regular expression is currently

default_regex = re.compile(r'(?P<year>\d{4})(?P<month>[01]\d)(?P<day>[012]\d)_'
                           r'(?P<hour>[012]\d)(?P<minute>[0-5]\d)')

which only accounts for days 01 through 29. To include days 30 and 31, you need to add a 3 to the day part:

default_regex = re.compile(r'(?P<year>\d{4})(?P<month>[01]\d)(?P<day>[0123]\d)_'
                           r'(?P<hour>[012]\d)(?P<minute>[0-5]\d)')

Working on a pull request with the fix.
Cheers. Pete

@dopplershift
Copy link
Member

Well that was silly.

@pjpokran
Copy link
Contributor Author

pjpokran commented Dec 1, 2017

Happy Friday to you :) time for a 🍺

dopplershift added a commit to pjpokran/siphon that referenced this issue Dec 4, 2017
dopplershift added a commit to pjpokran/siphon that referenced this issue Dec 5, 2017
@dopplershift
Copy link
Member

Closed by #173 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants