diff --git a/kats/detectors/cusum_model.py b/kats/detectors/cusum_model.py index 7752f6cc..f859455e 100644 --- a/kats/detectors/cusum_model.py +++ b/kats/detectors/cusum_model.py @@ -348,8 +348,10 @@ def _if_normal( check_decrease = 0 if decrease else np.inf return ( + # pyre-fixme[61]: `check_decrease` is undefined, or not always defined. self.pre_mean - check_decrease * self.pre_std <= cur_mean + # pyre-fixme[61]: `check_increase` is undefined, or not always defined. <= self.pre_mean + check_increase * self.pre_std ) diff --git a/kats/detectors/rolling_stats_model.py b/kats/detectors/rolling_stats_model.py index ba94d38f..f3218bb7 100644 --- a/kats/detectors/rolling_stats_model.py +++ b/kats/detectors/rolling_stats_model.py @@ -166,6 +166,9 @@ def calculate_iqr_median_deviation( numerator, m, out=np.zeros_like(numerator), where=m != 0 ) + # pyre-fixme[16]: `int` has no attribute `__getitem__`. + # pyre-fixme[6]: For 1st argument expected `pyre_extensions.ReadOnly[Sized]` but + # got `int`. return result[0] if len(result) == 1 else result diff --git a/kats/models/globalmodel/model.py b/kats/models/globalmodel/model.py index d98e077f..8724973c 100644 --- a/kats/models/globalmodel/model.py +++ b/kats/models/globalmodel/model.py @@ -552,6 +552,7 @@ def _format_fcst( first_time[i], freq=self.params.freq, periods=steps ) if "actual" in fcst_store: + # pyre-fixme[61]: `actual` is undefined, or not always defined. df["actual"] = actual[i] ans[idx] = df return ans diff --git a/kats/models/ml_ar.py b/kats/models/ml_ar.py index 6f64019e..d645d7c4 100644 --- a/kats/models/ml_ar.py +++ b/kats/models/ml_ar.py @@ -1228,7 +1228,9 @@ def _predict( # fill rest of the data with forecasts if new_data_is_forecast: in_window.update( - fc_wide[fc_wide.index <= fc_origin], overwrite=False + # pyre-fixme[61]: `fc_wide` is undefined, or not always defined. + fc_wide[fc_wide.index <= fc_origin], + overwrite=False, ) else: # in case the new_data is actually earlier than the training data, we need to remove any data diff --git a/kats/models/prophet.py b/kats/models/prophet.py index 634fbbd0..efa0882a 100644 --- a/kats/models/prophet.py +++ b/kats/models/prophet.py @@ -926,12 +926,14 @@ def sample_linear_predictive_trend_vectorize( # sample change points changepoint_ts_new = 1 + np.random.rand(sample_size, max_possion_num) * (T - 1) + # pyre-fixme[16]: `int` has no attribute `sort`. changepoint_ts_new.sort(axis=1) # create mask for deltas -> to mute some deltas based on number of change points mask = np.random.uniform( 0, max_possion_num, max_possion_num * sample_size ).reshape(sample_size, -1) + # pyre-fixme[61]: `possion_sample` is undefined, or not always defined. mask = mask < possion_sample[:, None] # Sample deltas diff --git a/kats/tests/detectors/test_prophet_detector.py b/kats/tests/detectors/test_prophet_detector.py index e41f900b..374b75b2 100644 --- a/kats/tests/detectors/test_prophet_detector.py +++ b/kats/tests/detectors/test_prophet_detector.py @@ -132,6 +132,7 @@ def create_weekend_seasonality_ts( ts.extend(sim.stl_sim() + trend) rest_days_weekend = 2 if i >= weeks: + # pyre-fixme[61]: `rest_days` is undefined, or not always defined. rest_days_weekend = rest_days - rest_days_weekday if rest_days_weekend == 0: break diff --git a/kats/tests/tsfeatures/test_tsfeatures.py b/kats/tests/tsfeatures/test_tsfeatures.py index ff87c0a3..c38df165 100644 --- a/kats/tests/tsfeatures/test_tsfeatures.py +++ b/kats/tests/tsfeatures/test_tsfeatures.py @@ -534,6 +534,7 @@ def test_IntegerArrays(self) -> None: ], } ) + # pyre-fixme[61]: `df` is undefined, or not always defined. df["value"] = df["value"].astype(dtype=pd.Int64Dtype()) # pyre-fixme[61]: `df` may not be initialized here. ts = TimeSeriesData(df) diff --git a/kats/utils/decomposition.py b/kats/utils/decomposition.py index df03b98d..38297f31 100644 --- a/kats/utils/decomposition.py +++ b/kats/utils/decomposition.py @@ -433,6 +433,7 @@ def _decompose_multi(self) -> None: trend_jump=max(int((self.period + 1) * self.trend_jump_factor), 1), ) assert self.decomp is not None + # pyre-fixme[16]: `Optional` has no attribute `__setitem__`. self.decomp[str(i)] = decomposer.decomposer() def remove_seasonality(self) -> TimeSeriesData: