Skip to content

Commit

Permalink
Add alphabetical_formula property to
Browse files Browse the repository at this point in the history
SiteCollection class
  • Loading branch information
janosh committed Nov 17, 2023
1 parent 77191b6 commit 1cee2f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pymatgen/core/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ def formula(self) -> str:
"""Returns the formula as a string."""
return self.composition.formula

@property
def alphabetical_formula(self) -> str:
"""Returns the formula as a string."""
return self.composition.alphabetical_formula

@property
def elements(self) -> list[Element | Species | DummySpecies]:
"""Returns the elements in the structure as a list of Element objects."""
Expand Down

0 comments on commit 1cee2f5

Please sign in to comment.