-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add loading pythonizations from podio #290
Conversation
e851cf2
to
fc51058
Compare
Since this now would also include the "freezing" of the objects (see AIDASoft/podio#663), I would be in favor of adding these to EDM4hep. At least freezing the objects would be good to have to avoid having things like #357 (and a few small fixes in #353) |
There seems to be some interference with the python (test) modules from EDM4hep? |
But that is the nightlies without AIDASoft/podio#663 included, edit: ah shouldn't change anything I guess 🤔 |
Yes, exactly. The freezing will only be picked up tomorrow, but the other pythonizations should already work today. |
Yeah, I think I messed up something with walking through submodules and the local modules are included 😒 Let me fix that |
8216fa4
to
c4f359c
Compare
Looks like AIDASoft/podio#667 fixed one issue in the pythonizations and we can properly import now, but we now have a different issue: EDM4hep/scripts/createEDM4hepFile.py Lines 88 to 89 in b99ba9f
Seems to assume a |
If you mean this error in the CI https://github.com/key4hep/EDM4hep/actions/runs/10773294123/job/29872769550?pr=290#step:3:840 then it should also disappear once the fix is propagated to the nightlies |
These workflows already pick up the latest version of podio as they build it on the fly. The problem in this case really seems to be that the wrong overload for |
Sorry for the confusion, you are absolutely right. The culprit seems to be the "collection subscript" pythonization that replaces the As a clarification, that difference in constness for >>> import edm4hep
>>> col = edm4hep.MCParticleCollection()
>>> p = col.create()
>>> type(p)
<class cppyy.gbl.edm4hep.MutableMCParticle at 0xea24410>
>>> type(col[0])
<class cppyy.gbl.edm4hep.MutableMCParticle at 0xea24410>
>>> type(col.at(0))
<class cppyy.gbl.edm4hep.MCParticle at 0xf5006a0> |
At least for our script the changes are not too bad, I think. See: |
I timed some usage with and without pythonizations. For commands I list the first time it was called during a session as some things are cached.
The increase in import time is due to the I don't know how to programmaticaly time autocompletion in python so the estimates for these are very rough Otherwise I don't see big differences with and without the pythonizations. This might change in the future if there will be more of them For the sake of benchmark changed - for i in range(3):
- particle = particles.create()
+ mutable_particles = [particles.create() for _ in range(3)]
+ for particle in mutable_particles: |
Thanks for the extensive checking. This looks about as expected, at least for me. Curious that creating a collection becomes quicker with pythonizations. Could that be because we are measuring different things at that point, i.e. is it possible that part of the things that are done at |
Yes, no pythonizations just adding |
c4f359c
to
4359cb4
Compare
Let's see if #361 indeed makes this pass as expected :) |
Everything looks to be working now. Merging this later today, unless there is something more to do. |
Ufff. Should be good to go |
Copy-paste error that was not caught in the large PR that introduced the tests
54426a8
to
99bbcb2
Compare
I wonder if at some point is better to implement the python bindings ourselves... |
BEGINRELEASENOTES
ENDRELEASENOTES
Load podio pythonizations (AIDASoft/podio#570) on
import edm4hep