Skip to content
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

Merged
merged 14 commits into from
Sep 30, 2020

Conversation

vuillaut
Copy link
Member

@vuillaut vuillaut commented Sep 29, 2020

@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.

moralejo
moralejo previously approved these changes Sep 30, 2020
Copy link
Collaborator

@moralejo moralejo left a 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!

@moralejo
Copy link
Collaborator

Looks good to me, thanks!

Ouch, other than the failing CI test of course!

lstchain/reco/utils.py Outdated Show resolved Hide resolved
lstchain/reco/utils.py Outdated Show resolved Hide resolved
@moralejo
Copy link
Collaborator

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 Show resolved Hide resolved

if dropna:
_finite_params = list(set(finite_params + events.columns))
Copy link
Member

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

Copy link
Member Author

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
Copy link

codecov bot commented Sep 30, 2020

Codecov Report

Merging #526 into master will increase coverage by 0.15%.
The diff coverage is 96.55%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
lstchain/scripts/lstchain_dl1_to_dl2.py 0.00% <0.00%> (ø)
lstchain/reco/dl1_to_dl2.py 65.59% <100.00%> (-0.19%) ⬇️
lstchain/reco/tests/test_utils.py 100.00% <100.00%> (ø)
lstchain/reco/utils.py 73.33% <100.00%> (+2.61%) ⬆️
lstchain/tests/test_lstchain.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6083a24...104c912. Read the comment docs.

@moralejo
Copy link
Collaborator

Good! Would be great to merge this so that @morcuended can test the full chain @ La Palma
@maxnoe, can you approve? It "looks fine" to me now, but so did it before.

@moralejo moralejo merged commit 4a903e0 into cta-observatory:master Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants