Skip to content

Commit f2bf2ca

Browse files
committed
minor change to avoid warning from ase
on my system (fresh install, ase 3.22.1 ) the relevant part of the traceback: ``` File "/scratch/AnacondaEnvironments/ml_datasets/lib/python3.9/site-packages/ase/atoms.py", line 731, in get_potential_energy energy = self._calc.get_potential_energy(self) File "/scratch/AnacondaEnvironments/ml_datasets/lib/python3.9/site-packages/ase/calculators/calculator.py", line 709, in get_potential_energy energy = self.get_property('energy', atoms) File "/scratch/AnacondaEnvironments/ml_datasets/lib/python3.9/site-packages/ase/calculators/calculator.py", line 737, in get_property self.calculate(atoms, [name], system_changes) File "/scratch/AnacondaEnvironments/ml_datasets/lib/python3.9/site-packages/pyace/asecalc.py", line 161, in calculate if self.atoms.number_of_lattice_vectors == 3: File "/scratch/AnacondaEnvironments/ml_datasets/lib/python3.9/site-packages/ase/utils/__init__.py", line 62, in deprecated_function warnings.warn(warning) FutureWarning: Please use atoms.cell.rank instead ``` which is solved with this modification
1 parent 6d3e5b8 commit f2bf2ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pyace/asecalc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def calculate(self, atoms=None, properties=['energy', 'forces', 'stress', 'energ
158158
'energies': self.energies.astype(np.float64),
159159
'gamma': np.array(self.ace.gamma_grade, dtype=np.float64)
160160
}
161-
if self.atoms.number_of_lattice_vectors == 3:
161+
if self.atoms.cell.rank == 3:
162162
self.volume = atoms.get_volume()
163163
self.virial = np.array(self.ace.virial) # order is: xx, yy, zz, xy, xz, yz
164164
# swap order of the virials to fullfill ASE Voigt stresses order: (xx, yy, zz, yz, xz, xy)

0 commit comments

Comments
 (0)