Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate site labels in SymmetrizedStructure() #3423

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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