From 93b8a23cc39215898c26e192f58fc0a84874dc1b Mon Sep 17 00:00:00 2001 From: Saksham Sharda Date: Sun, 25 Jul 2021 15:56:13 +0530 Subject: [PATCH 1/3] channel ids for dtype bug fix --- nwb_conversion_tools/utils/spike_interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nwb_conversion_tools/utils/spike_interface.py b/nwb_conversion_tools/utils/spike_interface.py index c955222dc..635725041 100644 --- a/nwb_conversion_tools/utils/spike_interface.py +++ b/nwb_conversion_tools/utils/spike_interface.py @@ -656,7 +656,7 @@ def add_electrical_series( eseries_kwargs.update(conversion=1e-6) eseries_kwargs.update(channel_conversion=channel_conversion) - trace_dtype = recording.get_traces(channel_ids=[0], end_frame=1).dtype + trace_dtype = recording.get_traces(channel_ids=channel_ids[:1], end_frame=1).dtype estimated_memory = trace_dtype.itemsize * recording.get_num_channels() * recording.get_num_frames() if not iterate and psutil.virtual_memory().available <= estimated_memory: warn("iteration was disabled, but not enough memory to load traces! Forcing iterate=True.") From 5d4391c7328a8d32bf31d553410c2ec226f99ac5 Mon Sep 17 00:00:00 2001 From: Saksham Sharda Date: Sun, 25 Jul 2021 19:31:34 +0530 Subject: [PATCH 2/3] adding starting_times as optional --- nwb_conversion_tools/utils/spike_interface.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nwb_conversion_tools/utils/spike_interface.py b/nwb_conversion_tools/utils/spike_interface.py index 635725041..9da677cc3 100644 --- a/nwb_conversion_tools/utils/spike_interface.py +++ b/nwb_conversion_tools/utils/spike_interface.py @@ -697,9 +697,12 @@ def data_generator(recording, channels_ids, unsigned_coercion, write_scaled): eseries_kwargs.update(data=H5DataIO(ephys_data, compression=compression, compression_opts=compression_opts)) if not use_times: eseries_kwargs.update( - starting_time=float(recording.frame_to_time(0)), rate=float(recording.get_sampling_frequency()) ) + if 'starting_time' not in eseries_kwargs: + eseries_kwargs.update( + starting_time=float(recording.frame_to_time(0)) + ) else: eseries_kwargs.update( timestamps=H5DataIO( From a2708ce0e4489f8caf7f904e68345ca5b195d340 Mon Sep 17 00:00:00 2001 From: Saksham Sharda Date: Mon, 26 Jul 2021 22:40:51 +0530 Subject: [PATCH 3/3] Revert "adding starting_times as optional" This reverts commit 5d4391c7 --- nwb_conversion_tools/utils/spike_interface.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nwb_conversion_tools/utils/spike_interface.py b/nwb_conversion_tools/utils/spike_interface.py index 9da677cc3..635725041 100644 --- a/nwb_conversion_tools/utils/spike_interface.py +++ b/nwb_conversion_tools/utils/spike_interface.py @@ -697,12 +697,9 @@ def data_generator(recording, channels_ids, unsigned_coercion, write_scaled): eseries_kwargs.update(data=H5DataIO(ephys_data, compression=compression, compression_opts=compression_opts)) if not use_times: eseries_kwargs.update( + starting_time=float(recording.frame_to_time(0)), rate=float(recording.get_sampling_frequency()) ) - if 'starting_time' not in eseries_kwargs: - eseries_kwargs.update( - starting_time=float(recording.frame_to_time(0)) - ) else: eseries_kwargs.update( timestamps=H5DataIO(