Skip to content

Commit 1a474af

Browse files
author
Mark Wieczorek
committed
Add bullets to parameters defined in __str__
1 parent 67d46ce commit 1a474af

File tree

4 files changed

+67
-45
lines changed

4 files changed

+67
-45
lines changed

boule/_ellipsoid.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ class Ellipsoid:
8989
>>> print(ellipsoid) # doctest: +ELLIPSIS
9090
WGS84 - World Geodetic System 1984
9191
Oblate ellipsoid:
92-
Semimajor axis: 6378137 m
93-
Flattening: 0.0033528106647474805
94-
GM: 398600441800000.0 m³/s²
95-
Angular velocity: 7.292115e-05 rad/s
92+
Semimajor axis: 6378137 m
93+
Flattening: 0.0033528106647474805
94+
GM: 398600441800000.0 m³/s²
95+
Angular velocity: 7.292115e-05 rad/s
9696
Source:
9797
Hofmann-Wellenhof & Moritz (2006)
9898
Comments:
@@ -406,20 +406,23 @@ def gravity_pole(self):
406406
def __str__(self):
407407
s = self.name + " - " + self.long_name + "\n"
408408
s += "Oblate ellipsoid:\n"
409-
s += f" Semimajor axis: {self.semimajor_axis} m\n"
410-
s += f" Flattening: {self.flattening}\n"
411-
s += f" GM: {self.geocentric_grav_const} m³/s²\n"
412-
s += f" Angular velocity: {self.angular_velocity} rad/s"
409+
s += f" Semimajor axis: {self.semimajor_axis} m\n"
410+
s += f" Flattening: {self.flattening}\n"
411+
s += f" GM: {self.geocentric_grav_const} m³/s²\n"
412+
s += f" Angular velocity: {self.angular_velocity} rad/s"
413413
if self.reference is not None:
414414
s += "\nSource:"
415415
for ref in self.reference.splitlines():
416416
s += "\n" + textwrap.fill(
417-
ref, width=72, initial_indent=" ", subsequent_indent=" "
417+
ref, width=72, initial_indent=2 * " ", subsequent_indent=4 * " "
418418
)
419419
if self.comments is not None:
420420
s += "\nComments:\n"
421421
s += textwrap.fill(
422-
self.comments, width=72, initial_indent=" ", subsequent_indent=" "
422+
self.comments,
423+
width=72,
424+
initial_indent=2 * " ",
425+
subsequent_indent=2 * " ",
423426
)
424427
return s
425428

boule/_realizations.py

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
angular_velocity=1.2400141739494342e-06,
3636
reference=(
3737
"Radius: Maia, J. (2024). Spherical harmonic models of the shape of "
38-
"Mercury [Data set]. Zenodo. https://doi.org/10.5281/zenodo.10809345\n"
38+
"Mercury [Data set]. Zenodo. https://doi.org/10.5281/zenodo.10809345"
39+
"\n"
3940
"GM, angular velocity: Mazarico, E., et al. (2014), The gravity field, "
4041
"orientation, and ephemeris of Mercury from MESSENGER observations "
4142
"after three years in orbit, J. Geophys. Res. Planets, 119, "
@@ -135,7 +136,8 @@
135136
reference=(
136137
"Semimajor axis, flattening: Park, R. S., et al. (2019). High-resolution "
137138
"shape model of Ceres from stereophotoclinometry using Dawn Imaging Data. "
138-
"Icarus, 319, 812–827. https://doi.org/10.1016/j.icarus.2018.10.024\n"
139+
"Icarus, 319, 812–827. https://doi.org/10.1016/j.icarus.2018.10.024"
140+
"\n"
139141
"GM, angular velocity: Konopliv, A. S., et al. (2018). The Ceres gravity "
140142
"field, spin pole, rotation period and orbit from the Dawn radiometric "
141143
"tracking and optical data. Icarus, 299, 411–429. "
@@ -189,10 +191,12 @@
189191
reference=(
190192
"Semi-axis: Thomas, P. C., et al. (1998). The Shape of Io from Galileo "
191193
"Limb Measurements. Icarus, 135(1), 175–180. "
192-
"https://doi.org/10.1006/icar.1998.5987\n"
194+
"https://doi.org/10.1006/icar.1998.5987"
195+
"\n"
193196
"GM: Anderson, J. D., et al. (2001). Io's gravity field and interior "
194197
"structure. J. Geophys. Res., 106, 32963–32969. "
195-
"https://doi.org/10.1029/2000JE001367\n"
198+
"https://doi.org/10.1029/2000JE001367"
199+
"\n"
196200
"Angular velocity: R. A. Jacobson (2021), The Orbits of the Regular "
197201
"Jovian Satellites and the Orientation of the Pole of Jupiter, personal "
198202
"communication to Horizons/NAIF. Accessed via JPL Solar System "
@@ -212,10 +216,12 @@
212216
reference=(
213217
"Semi-axis: Nimmo, F., et al. (2007). The global shape of Europa: "
214218
"Constraints on lateral shell thickness variations. Icarus, 191(1), "
215-
"183–192. https://doi.org/10.1016/j.icarus.2007.04.021\n"
219+
"183–192. https://doi.org/10.1016/j.icarus.2007.04.021"
220+
"\n"
216221
"GM: Anderson, J. D., et al. (1998). Europa's differentiated internal "
217222
"structure: Inferences from four Galileo encounters. Science, 281, "
218-
"2019–2022. https://doi.org/10.1126/science.281.5385.2019\n"
223+
"2019–2022. https://doi.org/10.1126/science.281.5385.2019"
224+
"\n"
219225
"Angular velocity: R. A. Jacobson (2021), The Orbits of the Regular "
220226
"Jovian Satellites and the Orientation of the Pole of Jupiter, personal "
221227
"communication to Horizons/NAIF. Accessed via JPL Solar System "
@@ -235,10 +241,12 @@
235241
reference=(
236242
"Semi-axis: Zubarev, A., et al. (2015). New Ganymede control point "
237243
"network and global shape model. Planetary and Space Science, 117, "
238-
"246–249. https://doi.org/10.1016/j.pss.2015.06.022\n"
244+
"246–249. https://doi.org/10.1016/j.pss.2015.06.022"
245+
"\n"
239246
"GM: Gomez Casajus, L., et al. (2022). Gravity Field of Ganymede After "
240247
"the Juno Extended Mission. Geophysical Research Letters, 49(24), "
241-
"e2022GL099475. https://doi.org/doi:10.1029/2022GL099475\n"
248+
"e2022GL099475. https://doi.org/doi:10.1029/2022GL099475"
249+
"\n"
242250
"Angular velocity: R. A. Jacobson (2021), The Orbits of the Regular "
243251
"Jovian Satellites and the Orientation of the Pole of Jupiter, personal "
244252
"communication to Horizons/NAIF. Accessed via JPL Solar System "
@@ -256,7 +264,8 @@
256264
reference=(
257265
"Radius, GM: Anderson, J. D., et al. (2001). Shape, mean radius, gravity "
258266
"field, and interior structure of Callisto. Icarus, 153(1), 157–161. "
259-
"https://doi.org/10.1006/icar.2001.6664\n"
267+
"https://doi.org/10.1006/icar.2001.6664"
268+
"\n"
260269
"Angular velocity: Satellites and the Orientation of the Pole of Jupiter, "
261270
"personal communication to Horizons/NAIF. Accessed via JPL Solar "
262271
"System Dynamics, https://ssd.jpl.nasa.gov, JUP365."
@@ -289,10 +298,12 @@
289298
reference=(
290299
"Semi-axis: Corlies, P., et al. (2017). Titan’s Topography and Shape at "
291300
"the End of the Cassini Mission. Geophysical Research Letters, 44(23), "
292-
"11,754-11,761. https://doi.org/10.1002/2017GL075518\n"
301+
"11,754-11,761. https://doi.org/10.1002/2017GL075518"
302+
"\n"
293303
"GM: Durante, D., et al. (2019). Titan’s gravity field and interior "
294304
"structure after Cassini. Icarus, 326, 123–132. "
295-
"https://doi.org/10.1016/j.icarus.2019.03.003\n"
305+
"https://doi.org/10.1016/j.icarus.2019.03.003"
306+
"\n"
296307
"Angular velocity: Jacobson, R. (2022). The Orbits of the Main Saturnian "
297308
"Satellites, the Saturnian System Gravity Field, and the Orientation "
298309
"of Saturn's Pole. The Astronomical Journal, 164, 199. "
@@ -312,7 +323,8 @@
312323
reference=(
313324
"Radius: Nimmo, et al. (2017). Mean radius and shape of Pluto and Charon "
314325
"from New Horizons images. Icarus, 287, 12–29. "
315-
"https://doi.org/10.1016/j.icarus.2016.06.027\n"
326+
"https://doi.org/10.1016/j.icarus.2016.06.027"
327+
"\n"
316328
"GM, angular velocity: Brozović, M., et al. (2015). The orbits and masses of "
317329
"satellites of Pluto. Icarus, 246, 317–329. "
318330
"https://doi.org/10.1016/j.icarus.2014.03.015"
@@ -328,7 +340,8 @@
328340
reference=(
329341
"Radius: Nimmo, et al. (2017). Mean radius and shape of Pluto and Charon "
330342
"from New Horizons images. Icarus, 287, 12–29. "
331-
"https://doi.org/10.1016/j.icarus.2016.06.027\n"
343+
"https://doi.org/10.1016/j.icarus.2016.06.027"
344+
"\n"
332345
"GM, angular velocity: Brozović, M., et al. (2015). The orbits and masses of "
333346
"satellites of Pluto. Icarus, 246, 317–329. "
334347
"https://doi.org/10.1016/j.icarus.2014.03.015"

boule/_sphere.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ class Sphere:
8686
>>> print(sphere) # doctest: +ELLIPSIS
8787
Moon - Moon Spheroid
8888
Spheroid:
89-
Radius: 1737151 m
90-
GM: 4902800070000.0 m³/s²
91-
Angular velocity: 2.6617073e-06 rad/s
89+
Radius: 1737151 m
90+
GM: 4902800070000.0 m³/s²
91+
Angular velocity: 2.6617073e-06 rad/s
9292
Source:
9393
Wieczorek (2015)
9494
Comments:
@@ -294,19 +294,22 @@ def reference_normal_gravitational_potential(self):
294294
def __str__(self):
295295
s = self.name + " - " + self.long_name + "\n"
296296
s += "Spheroid:\n"
297-
s += f" Radius: {self.radius} m\n"
298-
s += f" GM: {self.geocentric_grav_const} m³/s²\n"
299-
s += f" Angular velocity: {self.angular_velocity} rad/s"
297+
s += f" Radius: {self.radius} m\n"
298+
s += f" GM: {self.geocentric_grav_const} m³/s²\n"
299+
s += f" Angular velocity: {self.angular_velocity} rad/s"
300300
if self.reference is not None:
301301
s += "\nSource:"
302302
for ref in self.reference.splitlines():
303303
s += "\n" + textwrap.fill(
304-
ref, width=72, initial_indent=" ", subsequent_indent=" "
304+
ref, width=72, initial_indent=2 * " ", subsequent_indent=4 * " "
305305
)
306306
if self.comments is not None:
307307
s += "\nComments:\n"
308308
s += textwrap.fill(
309-
self.comments, width=72, initial_indent=" ", subsequent_indent=" "
309+
self.comments,
310+
width=72,
311+
initial_indent=2 * " ",
312+
subsequent_indent=2 * " ",
310313
)
311314
return s
312315

boule/_triaxialellipsoid.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ class TriaxialEllipsoid:
9999
>>> print(ellipsoid) # doctest: +ELLIPSIS
100100
Vesta - Vesta Triaxial Ellipsoid
101101
Triaxial ellipsoid:
102-
Semimajor axis: 280413 m
103-
Semimedium axis: 274572 m
104-
Semiminor axis: 231253 m
105-
Semimajor axis longitude: 8.29°
106-
GM: 17288000000.0 m³/s²
107-
Angular velocity: 0.0003267 rad/s
102+
Semimajor axis: 280413 m
103+
Semimedium axis: 274572 m
104+
Semiminor axis: 231253 m
105+
Semimajor axis longitude: 8.29°
106+
GM: 17288000000.0 m³/s²
107+
Angular velocity: 0.0003267 rad/s
108108
Source:
109109
Karimi et al. (2017)
110110
Comments:
@@ -338,22 +338,25 @@ def meridional_flattening(self):
338338
def __str__(self):
339339
s = self.name + " - " + self.long_name + "\n"
340340
s += "Triaxial ellipsoid:\n"
341-
s += f" Semimajor axis: {self.semimajor_axis} m\n"
342-
s += f" Semimedium axis: {self.semimedium_axis} m\n"
343-
s += f" Semiminor axis: {self.semiminor_axis} m\n"
344-
s += f" Semimajor axis longitude: {self.semimajor_axis_longitude}°\n"
345-
s += f" GM: {self.geocentric_grav_const} m³/s²\n"
346-
s += f" Angular velocity: {self.angular_velocity} rad/s"
341+
s += f" Semimajor axis: {self.semimajor_axis} m\n"
342+
s += f" Semimedium axis: {self.semimedium_axis} m\n"
343+
s += f" Semiminor axis: {self.semiminor_axis} m\n"
344+
s += f" Semimajor axis longitude: {self.semimajor_axis_longitude}°\n"
345+
s += f" GM: {self.geocentric_grav_const} m³/s²\n"
346+
s += f" Angular velocity: {self.angular_velocity} rad/s"
347347
if self.reference is not None:
348348
s += "\nSource:"
349349
for ref in self.reference.splitlines():
350350
s += "\n" + textwrap.fill(
351-
ref, width=72, initial_indent=" ", subsequent_indent=" "
351+
ref, width=72, initial_indent=2 * " ", subsequent_indent=4 * " "
352352
)
353353
if self.comments is not None:
354354
s += "\nComments:\n"
355355
s += textwrap.fill(
356-
self.comments, width=72, initial_indent=" ", subsequent_indent=" "
356+
self.comments,
357+
width=72,
358+
initial_indent=2 * " ",
359+
subsequent_indent=2 * " ",
357360
)
358361
return s
359362

0 commit comments

Comments
 (0)