-
Notifications
You must be signed in to change notification settings - Fork 22
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
docs: LHE file writing examples #256
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #256 +/- ##
==========================================
+ Coverage 91.17% 91.79% +0.62%
==========================================
Files 2 2
Lines 306 317 +11
Branches 83 83
==========================================
+ Hits 279 291 +12
Misses 17 17
+ Partials 10 9 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hello @APN-Pucky. This sounds great. I will try and have a proper look later in the week. May I suggest that you also update the README with a paragraph or so about writing? One could even explicitly mention the existence of notebooks for how to get started with examples. |
This adds two notebooks one showing how to write custom LHE files with a simple Monte Carlo event generator example and one filtering out events with a Z boson in the event record.
Further, the previously empty
class LHEFile
now contains two fields:info
andevents
with a write function to a output stream. Contrary to the previous conversion to a string and then writing the string to the file, this approach allows us to write large filtered files directly per event to disk without consuming much memory.One minor source for confusion might still remain:
write_lhe_file
takes ainit
andevents
whileread_lhe_file
returns aLHEFile
. I'd changewrite_lhe_file
, introduced in recent 0.9.0, to only require an LHEFile. The same then applies towrite_lhe_string
.Closes: #251