Skip to content

Commit

Permalink
Moved pymatgen imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
lauri-codes committed May 13, 2024
1 parent 7456f4d commit b5c9357
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_ewaldsummatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def test_electrostatics(setup):

# The value in each matrix element should correspond to the Coulomb
# energy of a system with with only those atoms. Here the energies from
# the Ewald matrix are compared against the Ewald energy calculated
# the Ewald matrix are compared against the Ewald energy precalculated
# with pymatgen.
energy_pymatgen = load_ewald(create_args)
assert np.allclose(energy_matrix, energy_pymatgen, atol=1e-5, rtol=0)
Expand Down
5 changes: 3 additions & 2 deletions tests/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from scipy.linalg import sqrtm
from ase import Atoms

# from pymatgen.analysis.ewald import EwaldSummation
# from pymatgen.core.structure import Structure
from dscribe.descriptors import SOAP
from joblib import Parallel, delayed
from conftest import get_simple_finite
Expand Down Expand Up @@ -404,6 +402,9 @@ def save_poly_coefficients():

def calculate_ewald(system, a=None, r_cut=None, g_cut=None, accuracy=None):
"""Used to precalculate the Ewald summation results using pymatgen."""
from pymatgen.analysis.ewald import EwaldSummation
from pymatgen.core.structure import Structure

positions = system.get_positions()
atomic_num = system.get_atomic_numbers()
n_atoms = len(system)
Expand Down

0 comments on commit b5c9357

Please sign in to comment.