6767from darts .utils .formatting import (
6868 format_bytes ,
6969 format_dict ,
70- format_list ,
7170 make_collapsible_section ,
7271 make_paragraph ,
7372)
@@ -5483,7 +5482,6 @@ def __str__(self):
54835482 )
54845483
54855484 freq_str = self ._freq_str if self ._freq_str is not None else str (self .freq )
5486- time_index_name = self ._time_index .name or "timesteps"
54875485
54885486 # indentation, first line needs to be manual
54895487 if self .static_covariates is not None :
@@ -5493,13 +5491,12 @@ def __str__(self):
54935491 static_cov_str = " <empty>"
54945492
54955493 return (
5496- f"<TimeSeries shape({ time_index_name } : { self .n_timesteps } , "
5494+ f"{ values_str } \n \n "
5495+ f"Shape: (times: { self .n_timesteps } , "
54975496 f"components: { self .n_components } , "
5498- f"samples: { self .n_samples } )> \n "
5497+ f"samples: { self .n_samples } ) \n "
5498+ f"Time frame: ({ self ._time_index .min ()} , { self ._time_index .max ()} , { freq_str } )\n "
54995499 f"Size: { format_bytes (self ._values .nbytes )} \n \n "
5500- f"{ values_str } \n \n "
5501- f"Time frame:\n ({ self ._time_index .min ()} , { self ._time_index .max ()} , { freq_str } )\n \n "
5502- f"Components:\n { format_list (list (self .components ))} \n \n "
55035500 f"Static covariates:\n { static_cov_str } \n \n "
55045501 f"Hierarchy:\n { format_dict (self .hierarchy )} \n "
55055502 f"Metadata:\n { format_dict (self .metadata )} \n "
@@ -5514,41 +5511,20 @@ def _repr_html_(self):
55145511 if self .n_samples == 1
55155512 else f"(displaying median of samples):\n { self .median ().to_dataframe ().to_html (max_rows = 10 , max_cols = 15 )} "
55165513 )
5517- dataframe_html = make_paragraph (
5518- values_str , bold = True , size = "1.2em" , margin_left = "0"
5519- )
5520-
5521- time_index_name = self ._time_index .name or "timesteps"
55225514 freq_str = self ._freq_str if self ._freq_str is not None else str (self .freq )
55235515
5524- shape_info_content = (
5525- f"({ time_index_name } : { self .n_timesteps } , "
5526- f"components: { self .n_components } , "
5527- f"samples: { self .n_samples } ) <br>\n "
5528- f"Size: { format_bytes (self ._values .nbytes )} \n "
5529- )
5530- shape_info_html = make_paragraph (
5531- shape_info_content , bold = True , size = "1.0em" , margin_left = "0"
5532- )
5533-
5534- # container div for top section with 2 columns
5535- top_section_html = f"""
5536- <div style="display: flex; align-items: center; gap: 2em; margin-left: 0.5em;">
5537- <div>{ dataframe_html } </div>
5538- <div>{ shape_info_html } </div>
5539- </div>
5540- """
5541-
55425516 static_covs_empty = self .static_covariates is None
55435517 hierarchy_empty = self .hierarchy is None or len (self .hierarchy ) == 0
55445518 metadata_empty = self .metadata is None or len (self .metadata ) == 0
55455519
55465520 return (
5547- top_section_html
5548- + make_collapsible_section (
5549- "Details:" ,
5550- f"Time frame: ({ self ._time_index .min ()} , { self ._time_index .max ()} , { freq_str } )\n "
5551- f"Components: { format_list (list (self .components ), render_html = True , max_items = 10 )} " ,
5521+ make_paragraph (values_str , bold = True , size = "1.2em" , margin_left = "0" )
5522+ + make_paragraph (
5523+ f"Shape: (times: { self .n_timesteps } , "
5524+ f"components: { self .n_components } , "
5525+ f"samples: { self .n_samples } )<br>"
5526+ f"Time frame: ({ self ._time_index .min ()} , { self ._time_index .max ()} , { freq_str } )<br>"
5527+ f"Size: { format_bytes (self ._values .nbytes )} "
55525528 )
55535529 + make_collapsible_section (
55545530 "Static covariates:" ,
0 commit comments