@@ -59,15 +59,15 @@ def mann_kendall(series: Sequence[float], threshold: float = 0.5):
5959 return trend , test
6060
6161
62- def breaking_last_point (signal : Sequence [float ], threshold : float = 1.2 ):
62+ def breaking_last_point (series : Sequence [float ], threshold : float = 1.2 ):
6363 """
6464 Assuming a timeseries is constant, we check the last value
6565 is not an outlier.
6666
67- :param signal : series
67+ :param series : series
6868 :return: significant change (-1, 0, +1), test value
6969 """
70- signal = np .asarray (signal )
70+ signal = np .asarray (series )
7171 if not np .issubdtype (signal .dtype , np .number ):
7272 return 0 , np .nan
7373 assert len (signal .shape ) == 1 , f"Unexpected signal shape={ signal .shape } , signal={ signal } "
@@ -986,10 +986,6 @@ def load(self, verbose: int = 0):
986986 shape = self .data .shape
987987 if verbose :
988988 print (f"[CubeLogs.load] removed columns, shape={ self .data .shape } " )
989- assert self .data .shape [0 ] > 0 or self ._data .shape [0 ] == 0 , (
990- f"The preprocessing reduced shape { shape } to { self .data .shape } , "
991- f"initial shape={ self ._data .shape } ."
992- )
993989 self ._preprocess ()
994990 if verbose :
995991 print (f"[CubeLogs.load] preprocess, shape={ self .data .shape } " )
@@ -1520,7 +1516,7 @@ def to_excel(
15201516 print (f"[CubeLogs.to_excel] add sheet { main !r} with shape { df .shape } " )
15211517 df .to_excel (writer , sheet_name = main , freeze_panes = (1 , 1 ))
15221518
1523- time_mask_view = {}
1519+ time_mask_view : Dict [ str , pandas . DataFrame ] = {}
15241520 for name , view in views .items ():
15251521 if view is None :
15261522 continue
@@ -1658,7 +1654,7 @@ def cube_time(self, fill_other_dates: bool = False, threshold: float = 1.2) -> "
16581654 Aggregates the data over time to detect changes on the last value.
16591655 If *fill_other_dates* is True, all dates are kept, but values
16601656 are filled with 0.
1661- *threshold* determines the bandwith within the values are expected,
1657+ *threshold* determines the bandwidth within the values are expected,
16621658 should be a factor of the standard deviation.
16631659 """
16641660 unique_time = self .data [self .time ].unique ()
0 commit comments