start, stop, step = item.start, item.stop, item.step
if step is None:
step = 1
if step != 1:
raise IndexError("Subgroups have to be contiguous")
if isinstance(start, Quantity):
if not have_same_dimensions(start, meter) or not have_same_dimensions(stop, meter):
raise DimensionMismatchError("Start and stop should have units of meter", start, stop)
// Convert to integers (compartment numbers)
After Change
indices = neuron.morphology.indices[item]
start, stop = indices[0], indices[-1] + 1
elif not isinstance(item, slice) and hasattr(item, "indices"):
start, stop = to_start_stop(item.indices[:], neuron._N)
else:
start, stop = to_start_stop(item, neuron._N)