Skip to content

Fix loading YAML with a NumPy primitive matrix - #1119

Closed
rpinho wants to merge 2 commits into
phonopy:mainfrom
rpinho:fix-numpy-primitive-matrix
Closed

rpinho wants to merge 2 commits into
phonopy:mainfrom
rpinho:fix-numpy-primitive-matrix

Conversation

@rpinho

@rpinho rpinho commented Nov 18, 2026

Copy link
Copy Markdown

Passing a NumPy primitive matrix to phonopy.load with a YAML input raises ValueError before constructing the calculation. It happens when reusing the primitive_matrix array from another Phonopy instance. Restrict the comparison with the auto keyword to strings so an explicit matrix takes the override path. Tests check the cell transformation and silicon frequencies after reload, including the list and default controls. This patch was prepared with AI assistance.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

@atztogo

atztogo commented Nov 24, 2026

Copy link
Copy Markdown
Member

Thank you for this fix as well.

The change is the same as yours, but making a new PR was less work for me than asking for changes here, so the fix is in #1129, with a test along the lines of your first one. I'm closing this PR without merging it.

@atztogo atztogo closed this Nov 24, 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.

2 participants