impy-project / chromo

Hadronic Interaction Model interface in PYthon
Other
30 stars 7 forks source link

Fixing event copy #119

Closed HDembinski closed 1 year ago

HDembinski commented 1 year ago

This fixes issues I saw when developing something else with EventData.copy.

I discovered that dataclasses.astuple works recursively if the dataclass also holds other dataclasses. This caused the second issue.

EventKinematics is now a thin class with just an init over EventKinematicsBase. This was necessary to make copies. I need to be able to call the raw init of the data holder (EventKinematicsBase), but we also want to customize the init. Since Python does not have overloads, I use this solution.

Other changes: