AllenInstitute/ipfx

Fix nightly build failure

Closed this issue · 0 comments

Describe the bug

TypeError: No conversion path for dtype: dtype('<U12')
tmpdir_factory = TempdirFactory(_tmppath_factory=TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7ff65d4d0e10>, _basetemp=PosixPath('/tmp/pytest-of-root/pytest-0')))
nwbfile = root pynwb.file.NWBFile at 0x140698916992560
Fields:
  acquisition: {
    a current clamp <class 'pynwb.icephys.Curren...ep_table: sweep_table <class 'pynwb.icephys.SweepTable'>
  timestamps_reference_time: 2020-10-31 05:03:18.242359+00:00

name = 'session_id', value = '12345', sweep_id = None
getter = <function <lambda> at 0x7ff7163a68c8>, expected = '12345'

    @pytest.mark.parametrize("name, value, sweep_id, getter, expected", [
        ["subject_id", "mouse01", None, lambda f: f.subject.subject_id, "mouse01"],
        ["institution", "aibs", None, lambda f: f.institution, "aibs"],
        ["session_id", "12345", None, lambda f: f.session_id, "12345"],
        ["age", "P56D", None, lambda f: f.subject.age, "P56D"],
        ["date_of_birth", "2019-05-12 17:00:00 -0700", None,
            lambda f: f.subject.date_of_birth, datetime(
                2019, 5, 12, 17, 0, tzinfo=timezone(timedelta(hours=-7))
            )
        ],
        ["genotype", "Gad2-IRES-Cre/wt;Ai14(RCL-tdT)/wt", None,
            lambda f: f.subject.genotype, "Gad2-IRES-Cre/wt;Ai14(RCL-tdT)/wt"
        ],
        ["sex", "F", None, lambda f: f.subject.sex, "F"],
        ["species", "Mus musculus", None, lambda f: f.subject.species,
            "Mus musculus"
        ],
    ])
    def test_register(
            tmpdir_factory, nwbfile, name, value, sweep_id, getter, expected
    ):
        tmpdir = tmpdir_factory.mktemp("test_register")
        path = os.path.join(str(tmpdir), "test.nwb")
    
        sink = nwb2_sink.Nwb2Sink(None)
        sink.nwbfile = nwbfile
    
        sink.register(name, value, sweep_id)
    
        with pynwb.NWBHDF5IO(path, "w") as writer:
>           writer.write(nwbfile)

tests/attach_metadata/test_nwb2_sink.py:163: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.6/site-packages/hdmf/utils.py:561: in func_call
    return func(args[0], **pargs)
/usr/local/lib/python3.6/site-packages/hdmf/backends/hdf5/h5tools.py:323: in write
    call_docval_func(super().write, kwargs)
/usr/local/lib/python3.6/site-packages/hdmf/utils.py:405: in call_docval_func
    return func(*fargs, **fkwargs)
/usr/local/lib/python3.6/site-packages/hdmf/utils.py:561: in func_call
    return func(args[0], **pargs)
/usr/local/lib/python3.6/site-packages/hdmf/backends/io.py:45: in write
    self.write_builder(f_builder, **kwargs)
/usr/local/lib/python3.6/site-packages/hdmf/utils.py:561: in func_call
    return func(args[0], **pargs)
/usr/local/lib/python3.6/site-packages/hdmf/backends/hdf5/h5tools.py:716: in write_builder
    self.write_group(self.__file, gbldr, **kwargs)
/usr/local/lib/python3.6/site-packages/hdmf/utils.py:561: in func_call
    return func(args[0], **pargs)
/usr/local/lib/python3.6/site-packages/hdmf/backends/hdf5/h5tools.py:896: in write_group
    self.write_group(group, sub_builder, **kwargs)
/usr/local/lib/python3.6/site-packages/hdmf/utils.py:561: in func_call
    return func(args[0], **pargs)
/usr/local/lib/python3.6/site-packages/hdmf/backends/hdf5/h5tools.py:896: in write_group
    self.write_group(group, sub_builder, **kwargs)
/usr/local/lib/python3.6/site-packages/hdmf/utils.py:561: in func_call
    return func(args[0], **pargs)
/usr/local/lib/python3.6/site-packages/hdmf/backends/hdf5/h5tools.py:908: in write_group
    self.set_attributes(group, attributes)
/usr/local/lib/python3.6/site-packages/hdmf/utils.py:561: in func_call
    return func(args[0], **pargs)
/usr/local/lib/python3.6/site-packages/hdmf/backends/hdf5/h5tools.py:849: in set_attributes
    obj.attrs[key] = value
h5py/_objects.pyx:54: in h5py._objects.with_phil.wrapper
    ???
h5py/_objects.pyx:55: in h5py._objects.with_phil.wrapper
    ???
/usr/local/lib/python3.6/site-packages/h5py/_hl/attrs.py:103: in __setitem__
    self.create(name, data=value)
/usr/local/lib/python3.6/site-packages/h5py/_hl/attrs.py:180: in create
    htype = h5t.py_create(original_dtype, logical=True)
h5py/h5t.pyx:1629: in h5py.h5t.py_create
    ???
h5py/h5t.pyx:1653: in h5py.h5t.py_create
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   TypeError: No conversion path for dtype: dtype('<U12')

h5py/h5t.pyx:1719: TypeError

To Reproduce
http://bamboo.corp.alleninstitute.org/browse/IFR-AIN-PYT-851/test/case/175946410;jsessionid=2890788DA6533A56278CB7AAE75514BF