dfki-ric / pytransform3d

3D transformations for Python.
https://dfki-ric.github.io/pytransform3d/
Other
615 stars 63 forks source link

remove_transform introduces inconsistencies #252

Closed matthaus-arrival closed 1 year ago

matthaus-arrival commented 1 year ago

It seems the self.transform_to_ij_index is not updated when removing a transform, leading to inconsistencies and 'crashes':

import numpy as np
from pytransform3d.transform_manager import TransformManager

tm.add_transform('a', 'b', np.eye(4))
tm.add_transform('c', 'd', np.eye(4))
tm.remove_transform('a', 'b')
tm.remove_transform('c', 'd')
  File "~/.local/lib/python3.8/site-packages/pytransform3d/transform_manager.py", line 151, in remove_transform
    del self.i[ij_index]
IndexError: list assignment index out of range
AlexanderFabisch commented 1 year ago

That's interesting and obviously bad. Thanks for reporting @matthaus-arrival . I will take a look.

AlexanderFabisch commented 1 year ago

It is fixed on the develop branch now. I will make a new release (3.2.0) soon.

matthaus-arrival commented 1 year ago

Thanks for the fast action! And thanks for providing this great library!

AlexanderFabisch commented 1 year ago

Thanks! 3.2.0 has just been released!