Skip to content

Commit

Permalink
tweak docstring example
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed May 17, 2024
1 parent 1bb34a6 commit 0aa1332
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pymatgen/core/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,12 @@ class FloatWithUnit(float):
are expected.
Example usage:
>>> e = Energy(1.1, "Ha")
>>> a = Energy(1.1, "Ha")
>>> b = Energy(3, "eV")
>>> c = a + b
>>> print(c)
>>> energy_a = Energy(1.1, "Ha")
>>> energy_b = Energy(3, "eV")
>>> energy_c = energy_a + energy_b
>>> print(energy_c)
1.2102479761938871 Ha
>>> c.to("eV")
>>> energy_c.to("eV")
32.932522246000005 eV
"""

Expand Down

0 comments on commit 0aa1332

Please sign in to comment.