Context: I use Numba a lot, so it would be great if particle would work with Numba directly, but I guess that this is probably a more elaborate project. In the meantime as a workaround, I extract information from particle and store that in Python lists and dicts, which I then pass to the numba-compiled functions.
The attribute Particle.pdgid is of type particle.pdgid.pdgid.PDGID instead of int, which leads to unexpected issues. I argue it would be better to return a plain int. The type particle.pdgid.pdgid.PDGID emulates a plain int, so you won't notice the difference much in pure Python, but it is a different type nonetheless and Numba does not understand this type. If I prepare a list or dict of PDG IDs to pass to Numba, I need to call int(Particle.pdgid) explicitly, which is doable but irritating.
I argue that there is no benefit of Particle.pdgid being particle.pdgid.pdgid.PDGID here, because the extra information that can be queried from particle.pdgid.pdgid.PDGID is can already be queried from Particle.
Context: I use Numba a lot, so it would be great if
particlewould work with Numba directly, but I guess that this is probably a more elaborate project. In the meantime as a workaround, I extract information from particle and store that in Python lists and dicts, which I then pass to the numba-compiled functions.The attribute
Particle.pdgidis of typeparticle.pdgid.pdgid.PDGIDinstead ofint, which leads to unexpected issues. I argue it would be better to return a plainint. The typeparticle.pdgid.pdgid.PDGIDemulates a plain int, so you won't notice the difference much in pure Python, but it is a different type nonetheless and Numba does not understand this type. If I prepare a list or dict of PDG IDs to pass to Numba, I need to callint(Particle.pdgid)explicitly, which is doable but irritating.I argue that there is no benefit of
Particle.pdgidbeingparticle.pdgid.pdgid.PDGIDhere, because the extra information that can be queried fromparticle.pdgid.pdgid.PDGIDis can already be queried fromParticle.