Open kedoxey opened 5 months ago
@kedoxey If you still have it, the similar traceback that you got from the command line call also displayed the final line in SI with the error - can you copy that over? It had something to do with setting a numpy dtype
For context, I the latest versions of SI/neo work fine on current known example TDT data, but something subtle changes with @kedoxey's data
This type of error stems from a call of the form
numpy.dtype(str(type(1)))
implying some instance/type did not get parsed as expected (casted a string on the type rather than the value or something similar)
Error trace from command line:
Traceback (most recent call last):
File "/Users/katedoxey/Desktop/research/projects/CRCNS/data/nwb_conversion/convert_tdt.py", line 14, in <module>
interface = TdtRecordingInterface(folder_path=tdt_dir, gain=1.0, verbose=False)
File "/Users/katedoxey/miniconda3/lib/python3.9/site-packages/neuroconv/datainterfaces/ecephys/tdt/tdtdatainterface.py", line 40, in __init__
super().__init__(
File "/Users/katedoxey/miniconda3/lib/python3.9/site-packages/neuroconv/datainterfaces/ecephys/baserecordingextractorinterface.py", line 38, in __init__
self.recording_extractor = self.get_extractor()(**source_data)
File "/Users/katedoxey/miniconda3/lib/python3.9/site-packages/spikeinterface/extractors/neoextractors/tdt.py", line 34, in __init__
NeoBaseRecordingExtractor.__init__(
File "/Users/katedoxey/miniconda3/lib/python3.9/site-packages/spikeinterface/extractors/neoextractors/neobaseextractor.py", line 244, in __init__
BaseRecording.__init__(self, sampling_frequency, chan_ids, dtype)
File "/Users/katedoxey/miniconda3/lib/python3.9/site-packages/spikeinterface/core/baserecording.py", line 41, in __init__
BaseRecordingSnippets.__init__(
File "/Users/katedoxey/miniconda3/lib/python3.9/site-packages/spikeinterface/core/baserecordingsnippets.py", line 25, in __init__
self._dtype = np.dtype(dtype)
TypeError: data type "<class 'int'>" not understood
@CodyCBakerPhD this does not look like a spikeinterface problem. It seems that the at some point in the chain the dtype is serialized to string str(int)
and then is not unserliazed correctly.
Probably something with the json at the communication between neuroconv and the guide.
This is really confusing because these lines:
Before calling the __init__
of BaseRecording on neobasextractors wher the error of @kedoxey is raised the dtype should already have been casted to dtype.
I don't think there is a way where the output of dtype can be a str(int)
. Is there?
So I think that there is something outside of spikeinterface when handling this case of neo maybe?
@kedoxey could you share your data just to be 100 % this is the case?
This error appears during the TDT recording extractor when converting to NWB format within NWB Guide and NeuroConv