Skip to content

Commit

Permalink
Propagate site labels in SymmetrizedStructure() (#3423)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefsmeets committed Oct 25, 2023
1 parent 3ec73a7 commit b4aedf0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pymatgen/symmetry/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def __init__(
structure.frac_coords,
site_properties=structure.site_properties,
properties=structure.properties,
labels=structure.labels,
)

equivalent_indices: list[list[int]] = [[] for _ in range(len(uniq))]
Expand Down
1 change: 1 addition & 0 deletions tests/io/test_cif.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def test_get_symmetrized_structure(self):
assert isinstance(sym_structure, SymmetrizedStructure)
assert structure == sym_structure
assert sym_structure.equivalent_indices == [[0, 1, 2, 3], [4, 5, 6, 7, 8, 9, 10, 11]]
assert set(sym_structure.labels) == {"O1", "Li1"}

def test_site_symbol_preference(self):
parser = CifParser(f"{TEST_FILES_DIR}/site_type_symbol_test.cif")
Expand Down

0 comments on commit b4aedf0

Please sign in to comment.