Skip to content

implements biased IntegralArray for floats#22

Open
mleseach wants to merge 1 commit intoJuliaImages:masterfrom
mleseach:add_bias
Open

implements biased IntegralArray for floats#22
mleseach wants to merge 1 commit intoJuliaImages:masterfrom
mleseach:add_bias

Conversation

@mleseach
Copy link
Copy Markdown

@mleseach mleseach commented Jun 30, 2025

This PR fixes #18 by introducing a bias to improve numerical stability in IntegralArray computations.

For floating-point arrays, a bias equal to the mean of the array is applied automatically.

For non-floating types (e.g. integers), the bias is ignored and behavior is unchanged.

Implementation details:

  • A new bias field is added to IntegralArray.
  • Before integration, bias is added to every element of the array.
  • During evaluation, bias * area is subtracted from the result.

Currently, the bias can't be easily specified by the user, as I'm not sure how best to handle cases where the bias type doesn't match the type of the array.
Let me know if you'd like any changes or additional tests.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 30, 2025

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.83%. Comparing base (33decc4) to head (9e66ec2).

Files with missing lines Patch % Lines
src/IntegralArrays.jl 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
- Coverage   97.29%   95.83%   -1.47%     
==========================================
  Files           1        1              
  Lines          37       48      +11     
==========================================
+ Hits           36       46      +10     
- Misses          1        2       +1     

☔ View full report in Codecov by Sentry.
📢 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.

Improve numerical stability

1 participant