Skip to content

Commit 0900424

Browse files
committed
wip slice with contact_annoations
1 parent a4af2cc commit 0900424

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

probeinterface/probe.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,13 @@ def get_slice(self, selection):
820820
if isinstance(v, np.ndarray):
821821
assert v.shape[0] == n
822822
d[k] = v[selection].copy()
823+
824+
if k == 'contact_annotations':
825+
print(type(v))
826+
for kk, vv in v.items():
827+
print(type(vv))
828+
print(vv.shape, selection.shape, selection.dtype, n)
829+
d[k][kk] = vv[selection].copy()
823830

824831
sliced_probe = Probe.from_dict(d)
825832

tests/test_probe.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,13 @@ def test_probe():
109109
other_3d = Probe.from_dataframe(df)
110110
assert other_3d.ndim == 3
111111

112+
print('ici', probe.contact_annotations['impedance'].shape)
112113
# slice handling
113114
selection = np.arange(0,18,2)
114115
# print(selection.dtype.kind)
115116
sliced_probe = probe.get_slice(selection)
117+
print('lai', probe.contact_annotations['impedance'].shape)
118+
print('yep', sliced_probe.contact_annotations['impedance'].shape)
116119

117120
#~ from probeinterface.plotting import plot_probe_group, plot_probe
118121
#~ import matplotlib.pyplot as plt
@@ -148,3 +151,4 @@ def test_set_shanks():
148151

149152
test_set_shanks()
150153

154+

0 commit comments

Comments
 (0)