Open JacekHoleczek opened 1 year ago
Then I cannot "
import jetset
"
I don't know what "jetset" is. Do you mean fastjet
?
AttributeError: no field named 'pt'. Did you mean: 'px'?
It sounds like an array of Lorentz vectors was loaded without
vector.register_awkward()
Call to deprecated class method from_string.
Again, the tutorial is showing its age. If Particle is deprecating from_string
, it should be replaced with finditer
or findall
. Both of these allow for the possibility of multiple matches. Maybe
particle.Particle.from_string("pi+")
should become
next(particle.Particle.finditer("pi+"))
(to bake-in the assumption that there's only one, or we're only interested in the first)?
See also https://github.com/scikit-hep/particle#getting-started-particles and of course the extensive docstrings :-).
Sorry, I get GitHub notifications via email, which can be out of date.
On fastjet in conda-forge—you're right, it's not done: scikit-hep/fastjet#133.
To my new pull request, I added the missing "vector.register_vawkward()
" call (in the last example to make it fully self-contained), and I replaced from_string
with findall
in one place (as it returns a bit funny result there for the "p~"
).
I'm not sure if finditer
or findall
should be used elsewhere, so please fix the 2 remaining from_string
places.
I assume, when replacing "particle.Particle.from_string("name")
", one should use "particle.Particle.findall("name")[0]
" or "next(particle.Particle.finditer("name"))
" (not sure what to do when these methods return a list with more than one entries, like for the "p~"
).
This issue or pull request has been automatically marked as stale because it has not had recent activity. Please manually close it, if it is no longer relevant, or ask for help or support to help getting it unstuck. Let me bring this to the attention of @klieret @wdconinc @michmx for now.
I've met some problems with the examples in the "
Lorentz vectors, particle PDG, jet-clustering, oh my!
" chapter.In the "
Particle PDG
" section:particle.Particle.from_string("p~")
z_boson = particle.Particle.from_string("Z0")
and in the "Jet clustering
" section:probable_mass = particle.Particle.from_string("pi+").mass / GeV
generate warnings in the form:<stdin>:1: DeprecationWarning: Call to deprecated class method from_string. (This method is deprecated and will be removed from version 0.23.0. Use finditer or findall instead.) -- Deprecated since version 0.22.
In the "
Jet clustering
" section, in the "fastjet" example:good_pseudojets = pseudojets[pseudojets.pt > 0.1]
generates an error in the form:Then I cannot "
import fastjet
" ... and when I try to "install fastjet
" (from conda-forge), I get: