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
Add brightest_island function #1587
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1587 +/- ##
==========================================
+ Coverage 90.43% 90.44% +0.01%
==========================================
Files 186 186
Lines 13862 13882 +20
==========================================
+ Hits 12536 12556 +20
Misses 1326 1326
Continue to review full report at Codecov.
|
ctapipe/image/morphology.py
Outdated
island_brightness = np.zeros(n_islands + 1) | ||
np.add.at(island_brightness, island_labels[mask], image[mask]) | ||
|
||
brightest_island = np.argmax(island_brightness) |
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.
Shouldn't name your variable brightest_island
, as that is also the function name
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.
maybe brightest_label
?
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.
That's actually not a problem, since it only assigns a variable in the local scope of the function (and the function is not recursive).
However, to avoid confusion, I changed the variable name.
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.
Thanks. it was more to avoid confusion and the linter complaining
ctapipe/image/morphology.py
Outdated
island_brightness = np.zeros(n_islands + 1) | ||
np.add.at(island_brightness, island_labels[mask], image[mask]) | ||
|
||
brightest_island = np.argmax(island_brightness) |
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.
maybe brightest_label
?
No description provided.