Skip to content

Commit 97e0634

Browse files
committed
ipfx: Avoid using deprecated pynwb interfaces
This fixes the following warnings: /home/thomas/.venvs/ipfx-3.9/lib/python3.9/site-packages/pynwb/base.py:87: DeprecationWarning: get_data_interface is deprecated and will be removed in PyNWB 4.0. Use get instead. warn('get_data_interface is deprecated and will be removed in PyNWB 4.0. Use get instead.', DeprecationWarning) tests/test_mies_nwb_pipeline_output.py: 127 warnings /home/thomas/.venvs/ipfx-3.9/lib/python3.9/site-packages/pynwb/base.py:82: DeprecationWarning: add_data_interface is deprecated and will be removed in PyNWB 4.0. Use add instead. warn('add_data_interface is deprecated and will be removed in PyNWB 4.0. Use add instead.', DeprecationWarning)
1 parent de713e9 commit 97e0634

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ipfx/dataset/ephys_nwb_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def get_clamp_mode(self,sweep_number):
308308

309309
def get_spike_times(self, sweep_number):
310310
spikes = self.nwb.get_processing_module('spikes')
311-
sweep_spikes = spikes.get_data_interface(f"Sweep_{sweep_number}")
311+
sweep_spikes = spikes.get(f"Sweep_{sweep_number}")
312312
return sweep_spikes.timestamps
313313

314314
@staticmethod

ipfx/nwb_append.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def append_spike_times(input_nwb_path: PathLike,
5959
unit='seconds',
6060
data=wrapped_spike_times,
6161
name=f"Sweep_{sweep_num}")
62-
spike_module.add_data_interface(ts)
62+
spike_module.add(ts)
6363

6464
nwbfile.add_processing_module(spike_module)
6565

tests/test_append_nwb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ def test_embed_spike_times_into_nwb(tmpdir_factory):
5151

5252
spikes = nwbfile.get_processing_module('spikes')
5353
for sweep_num, spike_times in sweep_spike_times.items():
54-
sweep_spikes = spikes.get_data_interface(f"Sweep_{sweep_num}").timestamps
54+
sweep_spikes = spikes.get(f"Sweep_{sweep_num}").timestamps
5555
assert np.allclose(sweep_spikes, spike_times)

0 commit comments

Comments
 (0)