Skip to content

Allow setting iparms before analysis via iparm_overrides#25

Open
bodono wants to merge 1 commit intosimpeg:mainfrom
bodono:fix/iparm-overrides-before-analysis
Open

Allow setting iparms before analysis via iparm_overrides#25
bodono wants to merge 1 commit intosimpeg:mainfrom
bodono:fix/iparm-overrides-before-analysis

Conversation

@bodono
Copy link
Copy Markdown

@bodono bodono commented Apr 6, 2026

Summary

  • Adds an iparm_overrides dict parameter to MKLPardisoSolver.__init__() that applies overrides after handle creation but before _analyze() is called
  • This allows iparm parameters that affect the analysis stage (e.g., iparm[10] and iparm[12]) to take effect properly
  • Overrides are validated through the existing set_iparm() method, so invalid indices/parameters are rejected

Test plan

  • Added test_iparm_overrides — overrides iparm[10] and iparm[12] on SPD matrix, verifies values and solver correctness
  • Added test_iparm_overrides_nonsymmetric — overrides on nonsymmetric matrix
  • Added test_iparm_overrides_invalid — verifies IndexError/ValueError for bad indices
  • Added test_iparm_overrides_default_none — verifies backward compatibility (no overrides preserves defaults)

Fixes #24

🤖 Generated with Claude Code

Some Pardiso iparms (e.g., 10 and 12) affect the analysis stage, but
previously there was no way to set them before __init__ called _analyze().
Add an iparm_overrides dict parameter to MKLPardisoSolver.__init__ that
applies overrides after handle creation but before the analysis phase.

Fixes simpeg#24

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Allow setting iparms before analyzing (and factoring).

1 participant