-
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
Update gammapy stat #318
Merged
Merged
Update gammapy stat #318
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8511eb3
Modify excess_matching_significance from gammapy
rlopezcoto 72fff95
correct also ebin function
rlopezcoto ed52454
correct some tests
rlopezcoto 8bda455
solve test conflicts
rlopezcoto b9b82b0
Add tests for calculate_sensitivity_lima_ebin
rlopezcoto 90a315e
fix calls for arrays
rlopezcoto 1c08ca5
fix tests
rlopezcoto 9d6f695
implement comments
rlopezcoto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
raise ValueError
with that message, not print and returnThere 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
if any(len(a) != n_bins_energy for a in (n_excesses, n_background, alpha))
as a more concise formulationThere 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, already implemented. The only problem with this (also present with my formulation) is that
(n_excesses, n_background, alpha)
must be input as lists/arrays, and an error is raised if only singlefloats
are given as inputThere 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.
Then apply
np.asanyarray(n_on, ndmin=1)
to the input. If you also want to return a single number when the input were numbers, you can do sometehing like this: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.
But let's get this merged first so the other PRs can run again