Skip to content

Fix: chunking in the new interface - #168

Merged
kzsigmond merged 3 commits into
mainfrom
122-bug-discrepancy-between-least-squares-results
Feb 20, 2026
Merged

kzsigmond merged 3 commits into
mainfrom
122-bug-discrepancy-between-least-squares-results

Conversation

@kzsigmond

Copy link
Copy Markdown
Contributor

This pull request fixes the calculation of chunk sizes for overlap derivative computations in the impacted modules and adds a new test to verify correct chunking behavior. The main focus is to ensure that chunking is based on the actual size of the s-space rather than the number of parameters.

Refactor chunk calculation logic:

  • Updated calculate_overlap_deriv_chunks in fanpy/interface/fanci/legacy.py, fanpy/interface/fanci/pyci.py, and fanpy/wfn/utils.py to use the size of the s-space (self._sspace.shape[0]) instead of the number of active parameters for memory and chunk size calculations, ensuring more accurate and consistent chunking.

Testing improvements:

  • Added a new test test_norm_constraint_chunking in tests/test_interface_pyci.py to verify that the norm constraint Jacobian is computed correctly with and without chunking, ensuring the refactored chunking logic produces consistent results.

@kzsigmond kzsigmond added this to the v2.0.0 milestone Nov 19, 2025
@kzsigmond kzsigmond self-assigned this Nov 19, 2025
@kzsigmond kzsigmond added bug Something isn't working test unit tests, integration tests, etc. labels Nov 19, 2025
@kzsigmond kzsigmond linked an issue Nov 19, 2025 that may be closed by this pull request
@kzsigmond kzsigmond changed the title Bug: chunking in the new interface Fix: chunking in the new interface Nov 19, 2025

@rugwed-lokhande rugwed-lokhande left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pretty straightforward, looks good!

@kzsigmond
kzsigmond merged commit 993e49b into main Feb 20, 2026
6 of 12 checks passed
@kzsigmond
kzsigmond deleted the 122-bug-discrepancy-between-least-squares-results branch April 21, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working test unit tests, integration tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Discrepancy between least squares results

2 participants