Closed khl02007 closed 2 years ago
Same error if you do recordinf.get_traces()
??
Yes it seems so. I get the same error.
@khl02007 can you send me the NWB file? Can you access the electrical series data through the pynwb API outside of SI?
@alejoe91 The NWB file is >1TB. What would be a good way to send it to you?
I can access the electrical series from this file using pynwb
. I can also do so with get_traces
from the NwbRecordingExtractor
. But it gives an error when I do frame_slice
and then get_traces
. Are you unable to reproduce this issue with a test nwb file you have?
Using pynwb 1.4.0 and hdmf 2.5.1
I found that during save, when we get to NwbRecordingSegment, the electrical series data cannot be accessed. I printed the electrical series during instantiation
e-series pynwb.ecephys.ElectricalSeries at 0x140374304276000
Fields:
comments: sample comment
conversion: 1.9499999837080395e-07
data: <HDF5 dataset "data": shape (138007758, 256), type "<i2">
description: Electrical series registered on electrode
electrodes: electrodes <class 'hdmf.common.table.DynamicTableRegion'>
interval: 1
resolution: -1.0
timestamps: <HDF5 dataset "timestamps": shape (138007758,), type "<f8">
timestamps_unit: seconds
unit: volts
and just before get_traces
e-series pynwb.ecephys.ElectricalSeries at 0x140374304276000
Fields:
comments: sample comment
conversion: 1.9499999837080395e-07
description: Electrical series registered on electrode
interval: 1
resolution: -1.0
timestamps_unit: seconds
unit: volts
they are in the same memory location but the data field is not present in the second one.
I also noticed that the NwbRecordingExtractor is re-instantiated upon save? Is there a reason for this?
By the way, get_traces
on a FrameSliceRecording
works if I use another variable; i.e. sliced_recording=recording.frame_slice
instead of recording=recording.frame_slice
Thanks for digging deeper. I think that the problem is due to the fact that we keep the io open until a __del__
is called. Using the same variable name deletes the object, so the nwbfile.acquisition
is not accessible anymore.
@samuelgarcia maybe we should switch back to opening the file with the context in the segment too to avoid this weird behavior
I don't think so. Open+check/close the file for every chunk is a total perf killer. Lets discuss this in detail.
I think we need to move the ownership to the recordingsegment. And it should fix the stuff.
I get an error related to h5. Here is what I tried:
Error: