lnls-fac / pyaccel

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

Add lattice_version property in Accelerator class #117

Closed murilobalves closed 1 year ago

murilobalves commented 1 year ago

This PR must be accompanied with https://github.com/lnls-fac/pymodels/pull/90

lattice_version attribute had to be included in trackcpp so it can be serialized when we save a model in pickle format

murilobalves commented 1 year ago

@murilobalves, I think this property will not be propagated through serialization. Besides, you need to change other methods appropriately, such as comparison, addition, initialization, printing, multiplication...

Thank you for the warning @fernandohds564 ! I included lattice_version property on trackcpp's Accelerator class (https://github.com/lnls-fac/trackcpp/pull/580) and propagated the changes on pyaccel's Accelerator class as well. I tested it and now it seems to work fine with pickle serialization.