Skip to content

Commit

Permalink
Fixed test of dummy atoms due to grammatical change (Specie/DummySpecie
Browse files Browse the repository at this point in the history
=> Species/DummySpecies) in pymatgen.
  • Loading branch information
davidwaroquiers committed Mar 11, 2021
1 parent e98bbaf commit 8c958b3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion turbomoleio/core/tests/test_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
from turbomoleio.core.molecule import MoleculeSystem
from turbomoleio.core.datagroups import DataGroups

try:
from pymatgen.core.periodic_table import DummySpecies
except ImportError:
DummySpecies = None


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

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


Expand Down

0 comments on commit 8c958b3

Please sign in to comment.