Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
Used a pattern like np.array().all() > tolerance with the intention to perform element-wise value comparison, however this seems to be misused as all():
"Test whether all array elements along a given axis evaluate to True."
- if abs(band2 - 1.0).all() > limit_deviation:
# However this logic might need double check as it only evaluates to True
# when ALL deviations are greater than threshold
+ if np.all(np.abs(band2 - 1) > limit_deviation):
# Perhaps it should be the following?
+ if np.any(np.abs(band2 - 1) > limit_deviation):
# The same to the other
- elif band2.all() > limit_deviation:
+ elif np.all(band2 > limit_deviation)
# The following seems more sensible?
+ elif np.any(band2 > limit_deviation)
I might go ahead and change this if I didn't misunderstand anything? @JaGeo
The following method: https://github.com/materialsproject/pymatgen/blob/bd9fba9ec62437b5b62fbd0b2c2c723216cc5a2c/src/pymatgen/io/lobster/outputs.py#L1694-L1737
Used a pattern like
np.array().all() > tolerance
with the intention to perform element-wise value comparison, however this seems to be misused asall()
:Should be something like:
I might go ahead and change this if I didn't misunderstand anything? @JaGeo