Skip to content

Accept ndarray primitive_matrix in phonopy.load with a yaml file - #1129

Merged
atztogo merged 1 commit into
mainfrom
fix-load-numpy-primitive-matrix
Nov 24, 2026
Merged

atztogo merged 1 commit into
mainfrom
fix-load-numpy-primitive-matrix

Conversation

@atztogo

@atztogo atztogo commented Nov 24, 2026

Copy link
Copy Markdown
Member

phonopy.load with a phonopy.yaml-like file raised ValueError when
primitive_matrix was given as an ndarray, because comparing it with
"auto" by == gave an array of bools. It is now checked to be a
string first, as in the other places where "auto" is compared.

The fix was proposed by @rpinho in #1119.

Comparing an ndarray with "auto" by == gave an array of bools and
raised ValueError in the if statement. Check that it is a string first,
as elsewhere.
@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.37%. Comparing base (ffdbf65) to head (2c8d10d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1129   +/-   ##
=======================================
  Coverage   87.36%   87.37%           
=======================================
  Files         247      247           
  Lines       42537    42545    +8     
=======================================
+ Hits        37164    37172    +8     
  Misses       5373     5373           

☔ View full report in Codecov by Harness.
📢 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.

@atztogo
atztogo merged commit 8ab732c into main Nov 24, 2026
10 checks passed
@atztogo
atztogo deleted the fix-load-numpy-primitive-matrix branch November 24, 2026 07:33
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