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

Add standard deviation to the effective area function #54

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jsaffer
Copy link
Collaborator

@jsaffer jsaffer commented Mar 1, 2025

Added the calculation of the standard deviation of the effective area by weighting with squared weights. The default behavior of the function is unchanged, the return type is a single histograms with effective area binned in energy and cos(zenith). If the new argument return_stddev is set to True, a tuple of effective area and its uncertainty is returned.

jsaffer and others added 2 commits March 1, 2025 22:05
Added the calculation of the standard deviation of the effective area by weighting with squared weights. The default behavior of the function is unchanged, the return type is a single histograms with effective area binned in energy and cos(zenith). If the new argument return_stddev is set to True, a tuple of effective area and its uncertainty is returned.
Copy link

codecov bot commented Mar 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (bedd1c5) to head (e13a474).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #54   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines          836       840    +4     
=========================================
+ Hits           836       840    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Mar 1, 2025

Test Results

    6 files  ±0      6 suites  ±0   2m 33s ⏱️ ±0s
  638 tests ±0    413 ✅ ±0    225 💤 ±0  0 ❌ ±0 
3 828 runs  ±0  2 476 ✅ ±0  1 352 💤 ±0  0 ❌ ±0 

Results for commit e13a474. ± Comparison against base commit bedd1c5.

♻️ This comment has been updated with latest results.

jsaffer and others added 5 commits March 1, 2025 22:31
Making return_stddev a keyword-only argument to address FBT001 and FBT002 and changing from Tuple to tuple (UP006)
undo unintended change
Adding a test for the standard deviation of effective area
@jsaffer
Copy link
Collaborator Author

jsaffer commented Mar 1, 2025

I had to use a return type of NDArray[np.float64] | tuple[NDArray[np.float64], NDArray[np.float64]] because returning a tuple in any case, i.e. a one-element tuple in the default case, would break backward compatibility.

@jsaffer jsaffer added enhancement New feature or request python Pull requests that update Python code labels Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant