Skip to content

Commit 28d0303

Browse files
authored
Apply suggestion from @bendichter
1 parent 2bba267 commit 28d0303

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/nwbinspector/checks/_ecephys.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,15 @@ def check_units_table_duration(
181181
idxs = idxs[idxs != 0]
182182

183183
spike_times = units["spike_times"].target
184+
if len(spike_times) == 0:
185+
return None
184186
if len(idxs) > 1:
185187
start = np.min(np.r_[spike_times[0], spike_times[idxs[:-1]]])
186188
else:
187189
start = spike_times[0]
188190

189191
end = np.max(spike_times[idxs - 1])
190192

191-
if len(spike_times) == 0:
192-
return None
193-
194193
start = float(np.min(spike_times))
195194
end = float(np.max(spike_times))
196195
duration = end - start

0 commit comments

Comments
 (0)