Skip to content

fix: miepython 3.x compatibility in Mie far-field comparisons#2

Merged
HunterSpence merged 1 commit into
mainfrom
fix/miepython3-scalar
Jul 14, 2026
Merged

fix: miepython 3.x compatibility in Mie far-field comparisons#2
HunterSpence merged 1 commit into
mainfrom
fix/miepython3-scalar

Conversation

@HunterSpence

Copy link
Copy Markdown
Owner

miepython >=3.0 returns 1-element arrays where 2.x returned scalars, crashing the Mie-comparison path (testSphereScattering / calcFarField / convergence tests) — this is the breakage a reviewer hit and hand-patched locally. np.squeeze on the six call sites restores compatibility with both API generations. Verified by rerunning the Mie sphere test in the bench image (miepython 3.2.0).

🤖 Generated with Claude Code

miepython >=3.0 returns 1-element arrays where 2.x returned scalars,
breaking 'mies[i] = miepython.i_per(...)' with 'setting an array element
with a sequence' in testSphereScattering/calcFarField. np.squeeze() makes
all six call sites work under both API generations.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@HunterSpence HunterSpence merged commit a011ca7 into main Jul 14, 2026
2 checks passed
@HunterSpence HunterSpence deleted the fix/miepython3-scalar branch July 14, 2026 12:47
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