Skip to content

Commit

Permalink
fixed serialization bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmshn committed Jul 21, 2022
1 parent cd47594 commit ff4696c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pymatgen/symmetry/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def __init__(
equivalent_indices = [[] for _ in range(len(u))] # type: ignore
equivalent_sites = [[] for _ in range(len(u))] # type: ignore
wyckoff_symbols = [[] for _ in range(len(u))] # type: ignore
for i, inv in enumerate(inv):
equivalent_indices[inv].append(i)
equivalent_sites[inv].append(self.sites[i])
wyckoff_symbols[inv].append(wyckoff_letters[i])
for i, inv_ in enumerate(inv):
equivalent_indices[inv_].append(i)
equivalent_sites[inv_].append(self.sites[i])
wyckoff_symbols[inv_].append(wyckoff_letters[i])
self.equivalent_indices: list[int] = equivalent_indices # type: ignore
self.equivalent_sites: list[PeriodicSite] = equivalent_sites # type: ignore
self.wyckoff_letters = wyckoff_letters
Expand Down Expand Up @@ -137,8 +137,9 @@ def as_dict(self):
"""
:return: MSONAble dict
"""
structure = Structure.from_sites(self.sites)
return {
"structure": super().as_dict(),
"structure": structure.as_dict(),
"spacegroup": self.spacegroup,
"equivalent_positions": self.site_labels,
"wyckoff_letters": self.wyckoff_letters,
Expand Down

0 comments on commit ff4696c

Please sign in to comment.