Skip to content

Commit

Permalink
Merge pull request #173 from pjpokran/master
Browse files Browse the repository at this point in the history
Change line 44 to include 0123 for day instead of 012
  • Loading branch information
jrleeman authored Dec 5, 2017
2 parents 0adc01a + 1078155 commit 41ce8f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion siphon/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __getitem__(self, item):
class DatasetCollection(IndexableMapping):
"""Extend ``IndexableMapping`` to allow datetime-based filter queries."""

default_regex = re.compile(r'(?P<year>\d{4})(?P<month>[01]\d)(?P<day>[012]\d)_'
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)')

def _get_datasets_with_times(self, regex):
Expand Down
10 changes: 10 additions & 0 deletions siphon/tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ def test_datasets_nearest_time():
assert nearest.title == 'NAM_CONUS_20km_noaaport_20150528_1800.grib1'


@recorder.use_cassette('top_level_20km_rap_catalog')
def test_datasets_nearest_time_30():
"""Test getting dataset by time; check for a day in the 30s (#gh-173)."""
url = ('http://thredds.ucar.edu/thredds/catalog/grib/NCEP/NAM/'
'CONUS_20km/noaaport/catalog.xml')
cat = TDSCatalog(url)
nearest = cat.catalog_refs.filter_time_nearest(datetime(2015, 5, 30, 11))
assert nearest.title == 'NAM_CONUS_20km_noaaport_20150530_1200.grib1'


@recorder.use_cassette('top_level_20km_rap_catalog')
def test_datasets_nearest_time_raises():
"""Test getting dataset by time using filenames."""
Expand Down

0 comments on commit 41ce8f1

Please sign in to comment.