Skip to content

Commit 0c10fd3

Browse files
authored
fix: backward compatibility of to/from numpy (#455)
1 parent a07f3bb commit 0c10fd3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/probeinterface/probegroup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ def from_numpy(arr: np.ndarray) -> "ProbeGroup":
200200
probegroup = ProbeGroup()
201201
for probe_index in probes_indices:
202202
mask = arr["probe_index"] == probe_index
203-
probe_id = arr["probe_id"][mask][0]
203+
if "probe_id" not in arr.dtype.fields:
204+
probe_id = str(probe_index)
205+
else:
206+
probe_id = arr["probe_id"][mask][0]
204207
probe = Probe.from_numpy(arr[mask])
205208
probegroup.add_probe(probe, probe_id=probe_id)
206209

0 commit comments

Comments
 (0)