-
Notifications
You must be signed in to change notification settings - Fork 77
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
Filter events not droping nan on all columns anymore #526
Conversation
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.
Looks good to me, thanks!
Ouch, other than the failing CI test of course! |
Seems that regression_features is simply missing in one of the unit tests |
lstchain/reco/utils.py
Outdated
|
||
if dropna: | ||
_finite_params = list(set(finite_params + events.columns)) |
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 think you got a logic error here. You still compute events.isnull
on all colums. and there is no any(axis=1)
her.
Also _finit_params
now contains all columns in events, right? I think the correct solutino would just be:
nans = events[finite_params].isnull()
filter &= ~nans.any(axis=1) # not any, so all have to be finite
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.
damn, I tried to be too quick, thanks.
Codecov Report
@@ Coverage Diff @@
## master #526 +/- ##
==========================================
+ Coverage 41.66% 41.82% +0.15%
==========================================
Files 77 77
Lines 6518 6534 +16
==========================================
+ Hits 2716 2733 +17
+ Misses 3802 3801 -1
Continue to review full report at Codecov.
|
Good! Would be great to merge this so that @morcuended can test the full chain @ La Palma |
@morcuended I wanted to make an update on your PR #525 , made one in your branch, then finally rebased from yours considering @moralejo comments, hence the history of commits here.
Finally, your first idea was in the right direction.