-
Notifications
You must be signed in to change notification settings - Fork 23
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
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.77% 91.87% +0.09%
==========================================
Files 2 2
Lines 304 320 +16
Branches 81 64 -17
==========================================
+ Hits 279 294 +15
Misses 17 17
- Partials 8 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. |
Co-authored-by: Eduardo Rodrigues <[email protected]>
I did not check the notebooks as I cannot use ReviewNB. But the rest looks great. On to @matthewfeickert. |
In the last commit, I deprecated two functions that I introduced within v0.9.0 that used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm re-approving.
I suggest you wait until, say, Wednesday, in case @matthewfeickert finds a bit of time to look as well, else you go ahead and merge.
Nice work!
Hi @APN-Pucky, I reckon you can go ahead and then release a new version so that we have support for 3.13 out there :-). Advance thanks. |
Good I'll try to follow https://www.youtube.com/watch?v=tsAWDumpcW8 and write a developer.md for #177 afterwards. |
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