Skip to content

Commit 8c958b3

Browse files
Fixed test of dummy atoms due to grammatical change (Specie/DummySpecie
=> Species/DummySpecies) in pymatgen.
1 parent e98bbaf commit 8c958b3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

turbomoleio/core/tests/test_molecule.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
from turbomoleio.core.molecule import MoleculeSystem
3333
from turbomoleio.core.datagroups import DataGroups
3434

35+
try:
36+
from pymatgen.core.periodic_table import DummySpecies
37+
except ImportError:
38+
DummySpecies = None
39+
3540

3641
replace_comments_re = re.compile(r"^\s*#.*?$", flags=re.MULTILINE)
3742

@@ -460,7 +465,11 @@ def test_to_coord_string(self, molecule):
460465
def test_dummy_atoms(self, molecule_filepath):
461466
ms = MoleculeSystem.from_file(molecule_filepath, fmt="coord")
462467
mol = ms.molecule
463-
assert isinstance(mol[-1].specie, DummySpecie)
468+
print(mol[-1].specie)
469+
print(mol[-1].specie.__class__)
470+
# Pymatgen's Specie and DummySpecie have been changed to Species and
471+
# DummySpecies in v2020.10.9. We keep testing both for backward compatibility.
472+
assert isinstance(mol[-1].specie, (DummySpecies, DummySpecie))
464473
assert mol[-1].specie.symbol == "Q"
465474

466475

0 commit comments

Comments
 (0)