lnls-fac / pyaccel

Python module for beam dynamics tracking and optics calculations
MIT License
7 stars 5 forks source link

Fix `__getitem__` when slice contains -1 as limit. #141

Closed fernandohds564 closed 3 months ago

fernandohds564 commented 3 months ago

A simple lattice reversion:

mod2 = mod[::-1]

did not work because the resulting slice had a -1 as last element and the vector object from C++ could not understand this value.

Now, all slices are treated as python lists.