Skip to content

Add HTML representation to Event objects

Benoit Seignovert requested to merge events-html-repr into main

In Jupyter, it is possible to implement _repr_html_ function to force the display of object in a custom HTML format.

For examples, for the event, the output could be represented as:

>>> phases
event # t_start t_stop
0 Approach and first ellipse - 2031-01-19 2032-02-08
1 Energy reduction - 2032-02-08 2032-06-25
2 Europa flybys - 2032-06-25 2032-07-24
3 High-latitude - 2032-07-24 2033-08-18
4 Low energy - 2033-08-18 2034-12-19
5 All Jupiter phases - 2031-01-19 2034-12-19
6 GEOa - 2034-12-19 2035-01-17
7 GCO5000 - 2035-01-17 2035-04-16
8 GEOb - 2035-04-16 2035-05-13
9 TGCO - 2035-05-13 2035-05-21
10 GCO500 - 2035-05-21 2035-09-29
11 All Ganymede phases - 2034-12-19 2035-09-29
12 All mission phases - 2031-01-19 2035-09-29

instead of:

<EsaMissionPhases> Mission_Phases-Crema_5.0.csv (2031-01-19 -> 2035-09-29 | 13 keys):
 - Approach and first ellipse (2031-01-19 -> 2032-02-08)
 - Energy reduction (2032-02-08 -> 2032-06-25)
 - Europa flybys (2032-06-25 -> 2032-07-24)
 - High-latitude (2032-07-24 -> 2033-08-18)
 - Low energy (2033-08-18 -> 2034-12-19)
 - All Jupiter phases (2031-01-19 -> 2034-12-19)
 - GEOa (2034-12-19 -> 2035-01-17)
 - GCO5000 (2035-01-17 -> 2035-04-16)
 - GEOb (2035-04-16 -> 2035-05-13)
 - TGCO (2035-05-13 -> 2035-05-21)
 - GCO500 (2035-05-21 -> 2035-09-29)
 - All Ganymede phases (2034-12-19 -> 2035-09-29)
 - All mission phases (2031-01-19 -> 2035-09-29)

This method could be generalized to ROIs, CReMA and Maps representations.

Edited by Benoit Seignovert

Merge request reports