From f9649164370bf7da5c4b3231e2ddcbfdf5ceb84d Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 8 Aug 2024 21:35:36 +0800 Subject: [PATCH] docstring tweak --- src/pymatgen/core/periodic_table.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pymatgen/core/periodic_table.py b/src/pymatgen/core/periodic_table.py index 5b186c471e9..49908ed322d 100644 --- a/src/pymatgen/core/periodic_table.py +++ b/src/pymatgen/core/periodic_table.py @@ -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 @@ -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)):