Skip to content

Commit

Permalink
docstring tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Aug 8, 2024
1 parent 5bcde4e commit f964916
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pymatgen/core/periodic_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1609,9 +1609,9 @@ def get_el_sp(obj: SpeciesLike) -> Element | Species | DummySpecies:

@functools.lru_cache
def get_el_sp(obj: int | SpeciesLike) -> Element | Species | DummySpecies:
"""Utility method to get an Element, Species or DummySpecies from any input.
"""Utility function to get an Element, Species or DummySpecies from any input.
If obj is in itself an Element or a Species, it is returned automatically.
If obj is an Element or a Species, it is returned as is.
If obj is an int or a string representing an integer, the Element with the
atomic number obj is returned.
If obj is a string, Species parsing will be attempted (e.g. Mn2+). Failing that
Expand All @@ -1626,8 +1626,8 @@ def get_el_sp(obj: int | SpeciesLike) -> Element | Species | DummySpecies:
ValueError: if obj cannot be converted into an Element or Species.
Returns:
Species | Element: with a bias for the maximum number of properties
that can be determined.
Element | Species | DummySpecies: with a bias for the maximum number
of properties that can be determined.
"""
# If obj is already an Element or Species, return as is
if isinstance(obj, (Element, Species, DummySpecies)):
Expand Down

0 comments on commit f964916

Please sign in to comment.