Skip to content

Commit 27b848c

Browse files
author
Aaron Kaplan
committed
typo in scipy import
1 parent 2f22d69 commit 27b848c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/atomate2/openff/utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
from emmet.core.openff import MoleculeSpec
1212
from pymatgen.core import Element, Molecule
1313
from pymatgen.io.openff import create_openff_mol
14-
from scipy.units import Avogadro
14+
from scipy.constants import Avogadro
1515

1616
if TYPE_CHECKING:
1717
import pathlib
1818

19+
DEFAULT_ATOMIC_MASSES = {el.Z: el.atomic_mass for el in Element}
20+
1921

2022
def create_mol_spec(
2123
smiles: str,
@@ -191,7 +193,7 @@ def calculate_elyte_composition(
191193
}
192194

193195
# Calculate the molecular weights of the solvent
194-
atomic_masses = atomic_masses or {el.Z: el.atomic_mass for el in Element}
196+
atomic_masses = atomic_masses or DEFAULT_ATOMIC_MASSES
195197
salt_mws = {}
196198
for smile in salts:
197199
mol = tk.Molecule.from_smiles(smile, allow_undefined_stereo=True)
@@ -232,7 +234,7 @@ def counts_from_masses(
232234
numpy.ndarray
233235
n_mols: Number of each SMILES needed for the given mass ratio.
234236
"""
235-
atomic_masses = atomic_masses or {el.Z: el.atomic_mass for el in Element}
237+
atomic_masses = atomic_masses or DEFAULT_ATOMIC_MASSES
236238

237239
mol_weights = []
238240
for smile in species:
@@ -272,7 +274,7 @@ def counts_from_box_size(
272274
dict of str, float
273275
Number of each species needed to fill the box with the given density.
274276
"""
275-
atomic_masses = atomic_masses or {el.Z: el.atomic_mass for el in Element}
277+
atomic_masses = atomic_masses or DEFAULT_ATOMIC_MASSES
276278

277279
volume = (side_length * 1e-7) ** 3 # Convert from nm3 to cm^3
278280
total_mass = volume * density # grams

0 commit comments

Comments
 (0)