Skip to content

Add sum to stats module#949

Open
psavery wants to merge 1 commit into
masterfrom
stats-add-sum
Open

Add sum to stats module#949
psavery wants to merge 1 commit into
masterfrom
stats-add-sum

Conversation

@psavery

@psavery psavery commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Overview

This generalizes the logic for average and sum to be in an _accumulate function which also takes the output type as a parameter.

This allows average() output to remain as an np.float32, and the new sum() output can be a np.float64 (since the results can be much larger).

This also adds type annotations to existing functions, and some new tests.

xref: HEXRD/hexrdgui#2030

Affected Workflows

All

This generalizes the logic for average and sum to be in an `_accumulate`
function which also takes the output type as a parameter.

This allows `average()` output to remain as an `np.float32`, and the
new `sum()` output can be a `np.float64` (since the results can be
much larger).

This also adds type annotations to existing functions, and some new
tests.

xref: HEXRD/hexrdgui#2030

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.45455% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.26%. Comparing base (86cf1c7) to head (e2fe8d9).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
hexrd/core/imageseries/stats.py 95.45% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #949      +/-   ##
==========================================
+ Coverage   73.22%   73.26%   +0.03%     
==========================================
  Files         146      146              
  Lines       22672    22711      +39     
==========================================
+ Hits        16602    16639      +37     
- Misses       6070     6072       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant