-
Notifications
You must be signed in to change notification settings - Fork 12
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
invert the logic from "skip" to "keep" - trying to improve readablility #215
Conversation
Ok so this broke a test related to |
Yes, it does, you did not invert the logic in the skip check, so now it get's the wrong number of events I think |
I think I did invert it ... no? the new function
|
Lunch time 👍 |
Ha, passed now ... I made a mistake before and replaced |
eventio/simtel/simtelfile.py
Outdated
if event['type'] == 'data': | ||
return self.skip_non_triggered and not event.get('telescope_events') | ||
return self.keep_non_triggered or event.get('telescope_events') |
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.
This might now return the telescope events instead of a bool. It might not be important, but could be strange.
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.
oh!
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've added is_event_triggered = bool(event.get('telescope_events'))
... since I must admit in the beginning I did not immediately understand why we get the telescope events there. :D
I think that fixes the issue you found and might even improve readability... what do you think?
I would at least like to keep Then we have to ask if having two keyword arguments named I have the feeling that this will be very subjective. |
Ah this is API changing? ... sorry I missed that. Ok let's keep the |
@maxnoe maybe this improves readability .. maybe not .. was just a try