Skip to content

Commit

Permalink
Add doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkWieczorek committed Mar 30, 2024
1 parent bb3d7ce commit 9864ad9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions boule/_ellipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ class Ellipsoid:
8.2094437949696e-02
>>> print(f"{ellipsoid.mean_radius:.4f} m")
6371008.7714 m
>>> print(f"{ellipsoid.volume_equivalent_radius:0.4f} m")
6371000.7900 m
>>> print(f"{ellipsoid.mass:.10e} kg")
5.9721684941e+24 kg
>>> print(f"{ellipsoid.mean_density:0.0f} kg/m³")
5513 kg/m³
>>> print(f"{ellipsoid.volume * 1e-9:.5e} km³")
1.08321e+12 km³
>>> print(f"{ellipsoid.gravity_equator:.10f} m/s²")
Expand Down
6 changes: 6 additions & 0 deletions boule/_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,14 @@ class Sphere:
0
>>> print(sphere.thirdflattening)
0
>>> print(f"{sphere.volume_equivalent_radius:0.1f} m")
1.0 m
>>> print(f"{sphere.volume:.10f} m³")
4.1887902048 m³
>>> print(f"{sphere.mass:.12e} kg")
2.996568928577e+10 kg
>>> print(f"{sphere.mean_density:0.0f} kg/m³")
7153781359 kg/m³
"""

Expand Down
6 changes: 6 additions & 0 deletions boule/_triaxialellipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ class TriaxialEllipsoid:
>>> print(f"{ellipsoid.mean_radius:.0f} m")
262700 m
>>> print(f"{ellipsoid.volume_equivalent_radius:0.f} m")
261115 m
>>> print(f"{ellipsoid.mass:.10e} kg")
2.5906746775e+20 kg
>>> print(f"{ellipsoid.mean_density:0.0f} kg/m³")
3474 kg/m³
>>> print(f"{ellipsoid.volume * 1e-9:.0f} km³")
74573626 km³
Expand Down

0 comments on commit 9864ad9

Please sign in to comment.