Skip to content

Commit 87f4b5d

Browse files
committed
If the coordinates are empty, return none and add warning
1 parent 39bd1d7 commit 87f4b5d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

neuro_py/io/loading.py

+5
Original file line numberDiff line numberDiff line change
@@ -2269,6 +2269,11 @@ def load_probe_layout(basepath: str) -> pd.DataFrame:
22692269
data = sio.loadmat(filename, simplify_cells=True)
22702270
x = data["session"]['extracellular']['chanCoords']['x']
22712271
y = data["session"]['extracellular']['chanCoords']['y']
2272+
2273+
if (len(x) == 0) & (len(y) == 0):
2274+
warnings.warn("The coordinates are empty in session.extracellular.chanCoords. Returning None - check session file")
2275+
return None
2276+
22722277
electrode_groups = data["session"]["extracellular"]["electrodeGroups"]['channels']
22732278

22742279
# for each group in electrodeGroups

0 commit comments

Comments
 (0)