From 255bc5470558488cd1aa4b8a7b90925405189bdf Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Fri, 17 May 2024 11:22:30 +0800 Subject: [PATCH] tweak docstring for units --- pymatgen/core/units.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymatgen/core/units.py b/pymatgen/core/units.py index 0ff5410f80a..ee0c80f84ee 100644 --- a/pymatgen/core/units.py +++ b/pymatgen/core/units.py @@ -639,8 +639,8 @@ def to(self, new_unit: str | Unit) -> Self: A ArrayWithUnit object in the new unit. Example usage: - >>> e = EnergyArray([1, 1.1], "Ha") - >>> e.to("eV") + >>> energy = EnergyArray([1, 1.1], "Ha") + >>> energy.to("eV") array([ 27.21138386, 29.93252225]) eV """ return type(self)( @@ -658,17 +658,17 @@ def as_base_units(self): """ return self.to(self.unit.as_base_units[0]) - # TODO abstract base class property? @property def supported_units(self) -> dict: + # TODO abstract base class property? """Supported units for specific unit type.""" if self.unit_type is None: raise RuntimeError("Cannot get supported unit for None.") return ALL_UNITS[self.unit_type] - # TODO abstract base class method? def conversions(self) -> str: + # TODO abstract base class method? """Get a string showing the available conversions. Useful tool in interactive mode. """