Skip to content

Fix ValueError when querying for versioned datasets for a detector

With gwosc-0.5.0 the following results in a ValueError:

>>> from gwosc import datasets
>>> datasets.find_datasets(type='event', version=1, detector='L1')
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/duncan/git/gwosc/gwosc/datasets.py", line 262, in find_datasets
    return sorted(list(_iter_datasets(
  File "/Users/duncan/git/gwosc/gwosc/datasets.py", line 203, in _iter_datasets
    for name in _matched(_event_datasets(
  File "/Users/duncan/git/gwosc/gwosc/datasets.py", line 183, in _matched
    for x in iter_:
  File "/Users/duncan/git/gwosc/gwosc/datasets.py", line 104, in _event_datasets
    detset = event_detectors(
  File "/Users/duncan/git/gwosc/gwosc/datasets.py", line 461, in event_detectors
    data = _event_metadata(
  File "/Users/duncan/git/gwosc/gwosc/datasets.py", line 282, in _event_metadata
    return list(api._fetch_allevents_event_json(
  File "/Users/duncan/git/gwosc/gwosc/api.py", line 263, in _fetch_allevents_event_json
    raise ValueError(msg)
ValueError: failed to identify catalog for event 'GW150914_R1' at version 1

This PR fixes that.

cc @alurban (reporter)

Merge request reports

Loading