Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 5e134f4

Browse files
committed
make sure we raise properly if no section are available
1 parent d841b86 commit 5e134f4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bluepyopt/ephys/locations.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,11 @@ def set_sec_index(self, icell=None):
521521
for section in getattr(icell, self.seclist_name)
522522
]
523523
)
524-
if self.direction == 'radial':
525-
self.sec_index = int(np.argmax(np.linalg.norm(points, axis=1)))
526-
else:
527-
self.sec_index = int(np.argmax(points.dot(self.direction)))
524+
if len(points):
525+
if self.direction == 'radial':
526+
self.sec_index = int(np.argmax(np.linalg.norm(points, axis=1)))
527+
else:
528+
self.sec_index = int(np.argmax(points.dot(self.direction)))
528529

529530
def instantiate(self, sim=None, icell=None):
530531
""" """

0 commit comments

Comments
 (0)