@@ -1210,7 +1210,7 @@ def to_excel(
12101210 for k , v in sbs .items ():
12111211 print (f"[CubeLogs.to_excel] sbs { k } : { v } " )
12121212 name = "∧" .join (sbs )
1213- sbs_raw , sbs_agg = self .sbs (sbs )
1213+ sbs_raw , sbs_agg , sbs_col = self .sbs (sbs )
12141214 if verbose :
12151215 print (f"[CubeLogs.to_excel] add sheet { name !r} with shape { sbs_raw .shape } " )
12161216 print (
@@ -1234,6 +1234,14 @@ def to_excel(
12341234 sbs_agg .index .nlevels ,
12351235 ),
12361236 )
1237+ sbs_col .to_excel (
1238+ writer ,
1239+ sheet_name = f"{ name } -COL" ,
1240+ freeze_panes = (
1241+ sbs_col .columns .nlevels + 1 ,
1242+ sbs_col .index .nlevels ,
1243+ ),
1244+ )
12371245
12381246 if plots :
12391247 from openpyxl .drawing .image import Image
@@ -1314,7 +1322,7 @@ def cube_time(self, fill_other_dates: bool = False, threshold: float = 1.2) -> "
13141322
13151323 def sbs (
13161324 self , configs : Dict [str , Dict [str , Any ]], column_name : str = "CONF"
1317- ) -> Tuple [pandas .DataFrame , pandas .DataFrame ]:
1325+ ) -> Tuple [pandas .DataFrame , pandas .DataFrame , pandas . DataFrame ]:
13181326 """
13191327 Creates a side-by-side for two configurations.
13201328 Every configuration a dictionary column:value which filters in
@@ -1325,7 +1333,7 @@ def sbs(
13251333 :param configs: example
13261334 ``dict(CFA=dict(exporter="E1", opt="O"), CFB=dict(exporter="E2", opt="O"))``
13271335 :param column_name: column to add with the name of the configuration
1328- :return: data and aggregated date
1336+ :return: data, aggregated date, data with a row per model
13291337 """
13301338 assert (
13311339 len (configs ) >= 2
@@ -1433,6 +1441,8 @@ def _mkc(m, s):
14331441 _mkc (m , f"{ n1 } <{ n2 } " ): (si < sj ).astype (int ),
14341442 _mkc (m , f"{ n1 } =={ n2 } " ): (si == sj ).astype (int ),
14351443 _mkc (m , f"{ n1 } >{ n2 } " ): (si > sj ).astype (int ),
1444+ _mkc (m , f"{ n1 } *({ n1 } ∧{ n2 } )" ): si * (~ sinan & ~ sjnan ).astype (float ),
1445+ _mkc (m , f"{ n2 } *({ n1 } ∧{ n2 } )" ): sj * (~ sinan & ~ sjnan ).astype (float ),
14361446 }
14371447 )
14381448 nas .columns .names = view_res .columns .names
@@ -1452,7 +1462,7 @@ def _mkc(m, s):
14521462 }
14531463 flat = view_res .groupby (self .time ).agg (aggs )
14541464 flat = flat .stack ("METRICS" , future_stack = True )
1455- return res , flat
1465+ return res , flat , view_res . T . sort_index (). T
14561466
14571467
14581468class CubeLogsPerformance (CubeLogs ):
0 commit comments