scikit-hep / pylhe

Lightweight Python interface to read Les Houches Event (LHE) files

Home Page:https://pypi.org/project/pylhe/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error running master/examples/

Andresfgomez970 opened this issue · comments

Hello again,

I just wanted to pointed out that examples appear to be outdated or are not working for me because a possible error. For example, running https://github.com/scikit-hep/pylhe/blob/master/examples/awkward_example.ipynb. The code pylhe.register_awkward() gives me the following error:

AttributeError: module 'pylhe' has no attribute 'register_awkward'

Thanks for the Issue @Andresfgomez970 👍 Though this for the same reason as #119 (comment). It isn't that the examples are outdated, but rather that they reflect the API of master and we need to make a new release.

I'll leave this open though as from the example it isn't clear how one should attempt to acquire/make the unweighted_events.lhe in the example

pylhe.register_awkward()
arr = pylhe.to_awkward(pylhe.read_lhe_with_attributes("unweighted_events.lhe"))
arr

(maybe should switch to using pylhe-testfile-pr29.lhe or something).

Thanks for the quick answer again and the suggestion Matthew. I am working with the file you suggested as follows:

from skhep_testdata import data_path
filename = data_path("pylhe-testfile-pr29.lhe")

Digressing from the matter, I am actually figuring out how to use the library inspecting the methods installed locally at my PC in site-packages/pylhe. Any suggestion in this regard will be gratefully received.

Hello @Andresfgomez970, what kind of suggestions are you looking for? If you did for example a python -m pip install -e . you should be able to open a prompt and do a help(pylhe). If you want to play with the variables in a file then the example notebook awkward_example.ipynb you mention ago is a good bet. And if you then need to do various 4-vector calculations then look at the https://github.com/scikit-hep/vector package as well. HTH.