Skip to content

Commit 023a197

Browse files
committed
fix unit test
1 parent e475f27 commit 023a197

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pymatgen/io/cif.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ def get_lattice(
650650
# Missing Key search for cell setting
651651
for lattice_label in ["_symmetry_cell_setting", "_space_group_crystal_system"]:
652652
if data.data.get(lattice_label):
653-
lattice_type = data.data.get(lattice_label, "").lower()
653+
lattice_type = data.data.get(lattice_label).lower()
654654
try:
655655
required_args = getfullargspec(getattr(Lattice, lattice_type)).args
656656

@@ -737,7 +737,8 @@ def get_symops(self, data: CifBlock) -> list[SymmOp]:
737737
sg = data.data.get(symmetry_label)
738738
msg_template = "No _symmetry_equiv_pos_as_xyz type key found. Spacegroup from {} used."
739739

740-
if sg := sub_space_group(sg):
740+
if sg:
741+
sg = sub_space_group(sg)
741742
try:
742743
if spg := space_groups.get(sg):
743744
sym_ops = list(SpaceGroup(spg).symmetry_ops)
@@ -752,9 +753,9 @@ def get_symops(self, data: CifBlock) -> list[SymmOp]:
752753
cod_data = loadfn(
753754
os.path.join(os.path.dirname(os.path.dirname(__file__)), "symmetry", "symm_ops.json")
754755
)
755-
for data in cod_data:
756-
if sg == re.sub(r"\s+", "", data["hermann_mauguin"]):
757-
xyz = data["symops"]
756+
for _data in cod_data:
757+
if sg == re.sub(r"\s+", "", _data["hermann_mauguin"]):
758+
xyz = _data["symops"]
758759
sym_ops = [SymmOp.from_xyz_str(s) for s in xyz]
759760
msg = msg_template.format(symmetry_label)
760761
warnings.warn(msg)

0 commit comments

Comments
 (0)