Skip to content

Clean parameterized hfun interface - #252

Merged
jared321 merged 19 commits into
mainfrom
247NoKwargs
Feb 16, 2026
Merged

Clean parameterized hfun interface#252
jared321 merged 19 commits into
mainfrom
247NoKwargs

Conversation

@jared321

@jared321 jared321 commented Jan 14, 2026

Copy link
Copy Markdown
Collaborator

PR Self-review

  • Synchronize feature branch to main
  • Carefully review all changes
  • Confirm changes in code coverage acceptable
  • Review changes in User Manual as rendered by RTD for this PR
  • Check Python and MATLAB action logs to confirm that new unittest is being called
  • Confirm all actions passing

Tox tasks were passing locally.
@jared321 jared321 self-assigned this Jan 14, 2026
@codecov

codecov Bot commented Jan 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.75%. Comparing base (5ca99d4) to head (1ba39d3).
⚠️ Report is 197 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #252      +/-   ##
==========================================
+ Coverage   94.49%   94.75%   +0.25%     
==========================================
  Files          93       95       +2     
  Lines        3618     3831     +213     
==========================================
+ Hits         3419     3630     +211     
- Misses        199      201       +2     

☔ 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.

The changes were made in both the Python and MATLAB codes.  The following
discussion is w.r.t. the Python code and hopefully helps explain the changes.

After designing the new test for this hfun, I suspected that the sign in front
of sumH in line 59 was incorrect.  However, the tests were passing with small
errors.  To determine if the test is capable of detecting that sign error, I
reran the tests but with the sign changed.  There was effectively no difference
in the results despite the fact that the Hres and sumH variables contain
non-trivial numbers.  This can be understood by seeing that

   sumH * sum_{i=1}^m (Cres[i] - m_sumF) = sumH * 0.

Therefore, I removed the sumH term, which allowed for some simplifications,
especially in line 63.

Both Python and MATLAB tests were passing locally with no need to adjust error
tolerances in the test.

@mmenickelly mmenickelly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me and I appreciate the short write up about the changes to the square_diff_from_mean computations.

@jared321

jared321 commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator Author

@jmlarson1 I made some additional changes to the code at 1ba39d3 since your review.

Could you please review those before I merge? Hopefully the commit message will provide enough information for you to understand why those simplifications were made.

@jmlarson1

Copy link
Copy Markdown
Collaborator

@jared321 This is correct. In initial research, we played with different alpha values, but in the end, the final runs were done with alpha=0. Thank you for these fixes.

@jared321
jared321 merged commit 0eabe37 into main Feb 16, 2026
53 of 55 checks passed
@jared321 jared321 mentioned this pull request Feb 16, 2026
21 tasks
@jared321
jared321 deleted the 247NoKwargs branch February 16, 2026 18:33
@jared321 jared321 mentioned this pull request Mar 23, 2026
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.

3 participants