Fix bug in custom peak_kwargs input into find_peaks - #92
Merged
RemDelaporteMathurin merged 5 commits intoApr 28, 2026
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #92 +/- ##
==========================================
+ Coverage 87.25% 87.96% +0.70%
==========================================
Files 19 19
Lines 1562 1570 +8
==========================================
+ Hits 1363 1381 +18
+ Misses 199 189 -10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
RemDelaporteMathurin
approved these changes
Apr 28, 2026
RemDelaporteMathurin
left a comment
Member
There was a problem hiding this comment.
I think this is ok @cdunn314 could you add a short test to catch this bug?
Contributor
Author
|
I kind of overdid the tests, but now it's well tested I think! |
Contributor
Author
|
@RemDelaporteMathurin If you're good with the tests and refactoring, can you approve this PR? |
RemDelaporteMathurin
approved these changes
Apr 28, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When energy calibrating the gamma detectors used for foil activation analysis, they are first energy calibrated. This is done through the get_calibration_data() function, which employs the SciPy.signal find_peaks() function with certain peak parameters to find the appropriate peaks in the spectrum that correspond to the check source gamma peaks. However, when the default peak parameters don't work, the user may input custom peak parameters through the peak_kwargs dictionary that is a keyword argument to get_calibration_data(). Currently, this dictionary uses Nuclide classes as keys, but this creates an error. This PR updates the dictionary to use the names of the nuclides as dictionary keys for the peak parameters as obtained from Nuclide.name.