Detchar unit test failure in frame reading: astropy.io.registry.IORegistryError: Format could not be identified
The following error occurs in the unit tests when we try to read a state vector from a frame file. The error started with gwpy 0.14.1. Rolling back to gwpy 0.14.0 fixes the issue.
CC @duncanmmacleod, @geoffrey.mo.
=================================== FAILURES ===================================
_________________________ test_handle_create_grb_event _________________________
mock_create_event = <MagicMock name='create_event' id='5115675088'>
mock_get_event = <MagicMock name='get_event' id='5119847392'>
mock_write_log = <MagicMock name='writeLog' id='5119773944'>
mock_json = <MagicMock name='dqr_json' id='5119823264'>
@patch('gwcelery.tasks.detchar.dqr_json', return_value='dqrjson')
@patch('gwcelery.tasks.gracedb.client.writeLog')
@patch('gwcelery.tasks.gracedb.get_event', return_value={
'graceid': 'E1', 'gpstime': 1, 'instruments': '', 'pipeline': 'Fermi',
'extra_attributes': {'GRB': {'trigger_duration': 1}}})
@patch('gwcelery.tasks.gracedb.create_event')
def test_handle_create_grb_event(mock_create_event, mock_get_event,
mock_write_log, mock_json):
text = resource_string(__name__, 'data/fermi_grb_gcn.xml')
> external_triggers.handle_grb_gcn(payload=text)
gwcelery/tests/test_tasks_external_triggers.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../.local/share/virtualenvs/gwcelery-qtf_ZR8h/lib/python3.6/site-packages/celery/app/task.py:375: in __call__
return self.run(*args, **kwargs)
gwcelery/tasks/external_triggers.py:97: in handle_grb_gcn
detchar.check_vectors(event, event['graceid'], start, end)
../../.local/share/virtualenvs/gwcelery-qtf_ZR8h/lib/python3.6/site-packages/celery/app/task.py:375: in __call__
return self.run(*args, **kwargs)
gwcelery/tasks/detchar.py:342: in check_vectors
start, end, globals()[bits]))
gwcelery/tasks/detchar.py:266: in check_vector
bits=bits)
../../.local/share/virtualenvs/gwcelery-qtf_ZR8h/lib/python3.6/site-packages/gwpy/timeseries/statevector.py:688: in read
return super(StateVector, cls).read(source, *args, **kwargs)
../../.local/share/virtualenvs/gwcelery-qtf_ZR8h/lib/python3.6/site-packages/gwpy/timeseries/core.py:310: in read
return timeseries_reader(cls, source, *args, **kwargs)
../../.local/share/virtualenvs/gwcelery-qtf_ZR8h/lib/python3.6/site-packages/gwpy/timeseries/io/core.py:45: in read
return io_read_multi(joiner, cls, source, *args, **kwargs)
../../.local/share/virtualenvs/gwcelery-qtf_ZR8h/lib/python3.6/site-packages/gwpy/io/mp.py:73: in read_multi
kwargs['format'] = get_read_format(cls, path, (source,) + args, kwargs)
../../.local/share/virtualenvs/gwcelery-qtf_ZR8h/lib/python3.6/site-packages/gwpy/io/registry.py:95: in get_read_format
return get_format('read', cls, filepath, fileobj, args, kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mode = 'read', cls = <class 'gwpy.timeseries.statevector.StateVector'>
path = None, fileobj = None, args = ([], 'H1:DMT-DQ_VECTOR')
kwargs = {'bits': <Bits(1: 'NO_OMC_DCPD_ADC_OVERFLOW'
2: 'NO_DMT-ETMY_ESD_DAC_OVERFLOW',
channel=<Channel("DMT-DQ_VECTOR", None) at 0x12f8679b0>,
epoch=None)>, 'end': 4, 'start': -1}
def _get_valid_format(mode, cls, path, fileobj, args, kwargs):
"""
Returns the first valid format that can be used to read/write the data in
question. Mode can be either 'read' or 'write'.
"""
valid_formats = identify_format(mode, cls, path, fileobj, args, kwargs)
if len(valid_formats) == 0:
format_table_str = _get_format_table_str(cls, mode.capitalize())
raise IORegistryError("Format could not be identified.\n"
"The available formats are:\n"
> "{0}".format(format_table_str))
E astropy.io.registry.IORegistryError: Format could not be identified.
E The available formats are:
E Format Read Write Auto-identify
E ------------ ---- ----- -------------
E csv Yes Yes Yes
E gwf Yes Yes Yes
E gwf.framecpp Yes Yes No
E gwf.lalframe Yes Yes No
E hdf5 Yes Yes Yes
E hdf5.losc Yes No No
E txt Yes Yes Yes
../../.local/share/virtualenvs/gwcelery-qtf_ZR8h/lib/python3.6/site-packages/astropy/io/registry.py:595: IORegistryError
Edited by Leo P. Singer