@arnaudon encountered an issue when resampling neuronal morphologies where the two last resampled points were identical.
This was due to the numerical imprecision of the cumulative values in np.arange(dl, total_length, dl). In some cases, due to the numerical error of the summation, the value total_length was returned at the end of the array.
To fix this the arrange is converted to np.arange(1, n_segments) * dl to avoid such errors and ensure that the correct size is always created.
@arnaudon encountered an issue when resampling neuronal morphologies where the two last resampled points were identical.
This was due to the numerical imprecision of the cumulative values in
np.arange(dl, total_length, dl)
. In some cases, due to the numerical error of the summation, the valuetotal_length
was returned at the end of the array.To fix this the arrange is converted to
np.arange(1, n_segments) * dl
to avoid such errors and ensure that the correct size is always created.