-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adding flux weighting option to the effective_area function of Weighter objects #47
Open
jsaffer
wants to merge
10
commits into
main
Choose a base branch
from
effective_area_weighting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…er objects Instead of weighting to a 1 GeV⁻¹ m⁻² sr⁻¹ flux, one can now chose to use any of the cosmic ray flux models as well in order take into account the spectral shape and varying mass composition inside energy bins. The scalar flux is still possible and the default (1e-4).
jsaffer
added
enhancement
New feature or request
help wanted
Extra attention is needed
python
Pull requests that update Python code
labels
Dec 12, 2024
for more information, see https://pre-commit.ci
The new optional flux argument is now the last in the list of arguments. This way, confusion with the mask argument, which remains in 3rd place, is avoided.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #47 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 12 12
Lines 799 807 +8
=========================================
+ Hits 799 807 +8 ☔ View full report in Codecov by Sentry. |
This should fix C3001 (lambda expression replaced by def function definition), R1728 (using generator for sum of flux components), D417 (added description for flux argument), E731 (lambda -> def), N803 (E -> energy), TRY003 and EM101 (assigned error message to variable), also I changed the ValueError to a TypeError which should be more appropriate
for more information, see https://pre-commit.ci
Adding type annotations for flux_func function, and moving the return outside of the it/elif/else condition.
for more information, see https://pre-commit.ci
@jsaffer I cleaned up this commit for you, but you still need to provide unit tests for both the weighted flux and the type error |
…r of invalid flux argument and the TypeError of a valid flux argument that is not supported yet
for more information, see https://pre-commit.ci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
python
Pull requests that update Python code
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.
Instead of weighting to a 1 GeV⁻¹ m⁻² sr⁻¹ flux, one can now chose to use any of the cosmic ray flux models available in
simweights
as well in order take into account the spectral shape and varying mass composition inside energy bins. The scalar flux is still possible and the default (1e-4
).The plots demonstrate the slight correction of effective area resulting from weighting with three common CR flux models vs the default (scalar flux) for