Skip to content
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 numpy/tensor generation #18

Merged
merged 43 commits into from May 17, 2019
Merged

Add numpy/tensor generation #18

merged 43 commits into from May 17, 2019

Conversation

apuignav
Copy link
Contributor

@apuignav apuignav commented May 13, 2019

Addresses #15.

Still missing, how to deal with boost_to in the iterator case.

@apuignav
Copy link
Contributor Author

I'm happy now. If you agree, I fix the docs and we're ready to release 1.0.0.

@apuignav
Copy link
Contributor Author

Open question, the way we implemented things now, I am not sure about the caching anymore.

from phasespace import Particle

B0_MASS = 5279.58
KSTARZ_MASS = 895.81
PION_MASS = 139.57018
KAON_MASS = 493.677

pion = Particle('pi+', PION_MASS)
kaon = Particle('K+', KAON_MASS)
kstar = Particle('K*', KSTARZ_MASS).set_children(pion, kaon)
gamma = Particle('gamma', 0)
bz = Particle('B0', B0_MASS).set_children(kstar, gamma)

for i in range(10):
       weights, particles = bz.generate(n_events=1000)
       ...
       (do something with weights and particles)
       ...

Does this actually cache the graph? Since in generate it's recreated from scratch.

@jonas-eschle
Copy link
Contributor

You're right, it does not yet, wanted to get things working again first, which is good now. I'll implement it, it should be very simple.

@apuignav
Copy link
Contributor Author

Great! Other than that it's working, and docs should be up to date!

@jonas-eschle
Copy link
Contributor

Good! I'll tackle it tomorrow

@apuignav apuignav changed the title WIP: Add numpy/tensor generation Add numpy/tensor generation May 17, 2019
@apuignav apuignav merged commit f983130 into master May 17, 2019
@apuignav apuignav deleted the tensornumpy branch May 17, 2019 13:53
@apuignav apuignav mentioned this pull request May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants