Skip to content

Commit

Permalink
upgrade pyre version in fbcode/kats - batch 1
Browse files Browse the repository at this point in the history
Differential Revision: D55200657

fbshipit-source-id: e290e8634c7abce24361c10dab3193fdf227f4c4
  • Loading branch information
generatedunixname89002005307016 authored and facebook-github-bot committed Mar 22, 2024
1 parent 2e4a7c8 commit 516579b
Show file tree
Hide file tree
Showing 38 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions kats/detectors/distribution_distance_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

# Supported metrics for calculating distance
# details: https://github.com/scipy/scipy/blob/v1.10.1/scipy/spatial/distance.py#L1947
# pyre-fixme[21]: Could not find module `scipy.spatial.distance`.
from scipy.spatial.distance import _METRICS_NAMES as SUPPORTED_DISTANCE_METRICS


Expand Down
2 changes: 2 additions & 0 deletions kats/detectors/interval_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
from kats.detectors.detector import DetectorModel
from kats.detectors.detector_consts import AnomalyResponse, ConfidenceBand
from matplotlib import pyplot as plt

# pyre-fixme[21]: Could not find module `numpy.linalg`.
from numpy.linalg import matrix_power
from scipy.linalg import toeplitz
from scipy.stats import beta, binom, mvn, norm
Expand Down
2 changes: 2 additions & 0 deletions kats/models/bayesian_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import numpy as np
import pandas as pd
from kats.consts import _log_error, Params, TimeSeriesData

# pyre-fixme[21]: Could not find module `numpy.linalg`.
from numpy.linalg import inv
from scipy.linalg import block_diag

Expand Down
2 changes: 2 additions & 0 deletions kats/models/ml_ar.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from kats.utils.parameter_tuning_utils import (
get_default_lightgbm_parameter_search_space,
)

# pyre-fixme[21]: Could not find module `numpy.random`.
from numpy.random import RandomState

try:
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_bocpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
TrendChangeParameters,
)
from kats.utils.simulator import Simulator

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_cusum_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
MultiCUSUMDetector,
VectorizedCUSUMDetector,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized
from scipy.stats import chi2 # @manual
from sklearn.datasets import make_spd_matrix
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_cusum_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
CusumScoreFunction,
VectorizedCUSUMDetectorModel,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_detector_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
PercentageChange,
SingleSpike,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_distribution_distance_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
TimeSeriesData,
)
from kats.detectors.distribution_distance_model import DistributionDistanceModel

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_interval_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
TwoSampleRealValuedIntervalDetectorModel,
TwoSampleSchema,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized
from scipy.stats import norm

Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_prophet_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
to_seasonality,
)
from kats.utils.simulator import Simulator

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized

START_DATE_TEST_DATA = "2018-01-01"
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_robust_stat_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
RobustStatChangePoint,
RobustStatDetector,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized
from sklearn.datasets import make_spd_matrix

Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_rolling_stats_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
TimeSeriesData,
)
from kats.detectors.rolling_stats_model import RollingStatsModel

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_stat_sig_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
)
from kats.utils.decomposition import SeasonalityHandler
from kats.utils.simulator import Simulator

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/detectors/test_trend_mk.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import pandas as pd
from kats.detectors.trend_mk import MKDetector
from kats.tests.detectors.utils import gen_no_trend_data_ndim, gen_trend_data_ndim

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/metrics/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

from kats.metrics import metadata
from kats.metrics.metadata import inspect, MetricMetadata

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
4 changes: 4 additions & 0 deletions kats/tests/metrics/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
from unittest import TestCase

import numpy as np

# pyre-fixme[21]: Could not find module `numpy.testing`.
import numpy.testing as npt
from kats.metrics import metrics

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_arima_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
PEYTON_FCST_30_ARIMA_PARAM_2_MODEL_1,
PEYTON_FCST_30_ARIMA_PARAM_2_MODEL_2,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized

STEPS_1 = 15
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
from kats.models.ensemble.kats_ensemble import KatsEnsemble
from kats.models.ensemble.median_ensemble import MedianEnsembleModel
from kats.models.ensemble.weighted_avg_ensemble import WeightedAvgEnsemble

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized

np.random.seed(123321)
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_globalmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
S2Cell,
split,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_holt_winters_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
AIR_FCST_HW_1, # first param combination results
AIR_FCST_HW_2,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized

pd_ver = float(re.findall("([0-9]+\\.[0-9]+)\\..*", pd.__version__)[0])
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_linear_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
PEYTON_FCST_LINEAR_NAN,
PEYTON_INPUT_NAN,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized

TEST_DATA: Dict[
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_ml_ar_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import pandas as pd
from kats.consts import TimeSeriesData
from kats.models.ml_ar import MLARModel, MLARParams

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized

single_univariate_ts = [
Expand Down
1 change: 1 addition & 0 deletions kats/tests/models/test_models_dummy_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import numpy as np
import pandas as pd
# pyre-fixme[21]: Could not find name `Timestamp` in `pandas`.
from pandas import Timestamp

AIR_FCST_LINEAR_95 = pd.DataFrame(
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_neuralprophet_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
NONSEASONAL_FUTURE_DF,
NONSEASONAL_INPUT,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_prophet_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
PEYTON_FCST_30_PROPHET_DAILY_CAP_SM_11,
PEYTON_FCST_30_PROPHET_DAILY_CAP_SM_12,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_sarima_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
AIR_FCST_30_SARIMA_PARAM_2_MODEL_2,
EXOG_FCST_15_SARIMA_PARAM_EXOG_MODEL_1,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized

AIR_TS: pd.DataFrame = load_air_passengers()
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_simple_heuristic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
SimpleHeuristicModel,
SimpleHeuristicModelParams,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized

test_univariate_df = pd.DataFrame(
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_stlf_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
)
from kats.models.stlf import STLFModel, STLFParams
from kats.utils.simulator import Simulator

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_theta_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
PEYTON_FCST_30_THETA_SM_11,
PEYTON_FCST_30_THETA_SM_12,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/models/test_var_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from kats.consts import TimeSeriesData
from kats.data.utils import load_data
from kats.models.var import VARModel, VARParams

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/test_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
from kats.models.ensemble.median_ensemble import MedianEnsembleModel
from kats.models.ensemble.weighted_avg_ensemble import WeightedAvgEnsemble
from kats.models.model import Model

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized

np.random.seed(123321)
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/tsfeatures/test_tsfeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
TsFeatures,
TsFourierFeatures,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized

SAMPLE_INPUT_TS_BOCPD_SCALED = pd.DataFrame(
Expand Down
2 changes: 2 additions & 0 deletions kats/tests/utils/test_datapartition.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
SimpleDataPartition,
SimpleTimestampDataPartition,
)

# pyre-fixme[21]: Could not find module `parameterized.parameterized`.
from parameterized.parameterized import parameterized


Expand Down
2 changes: 2 additions & 0 deletions kats/tests/utils/test_decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from kats.utils.decomposition import SeasonalityHandler, TimeSeriesDecomposition
from kats.utils.simulator import Simulator
from scipy.stats import ks_2samp

# pyre-fixme[21]: Could not find name `STL` in `statsmodels.tsa.seasonal`.
from statsmodels.tsa.seasonal import seasonal_decompose, STL


Expand Down
1 change: 1 addition & 0 deletions kats/tests/utils/test_time_series_parameter_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from kats.models.prophet import ProphetModel
from kats.utils.time_series_parameter_tuning import compute_search_cardinality

# pyre-fixme[21]: Could not find module `numpy.random`.
from numpy.random import RandomState


Expand Down
2 changes: 2 additions & 0 deletions kats/tsfeatures/tsfeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
from scipy.linalg import toeplitz
from scipy.signal import periodogram # @manual
from statsmodels.stats.diagnostic import het_arch

# pyre-fixme[21]: Could not find name `STL` in `statsmodels.tsa.seasonal`.
from statsmodels.tsa.seasonal import STL
from statsmodels.tsa.stattools import acf, kpss, pacf

Expand Down
2 changes: 2 additions & 0 deletions kats/utils/decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
ParameterError,
TimeSeriesData,
)

# pyre-fixme[21]: Could not find name `STL` in `statsmodels.tsa.seasonal`.
from statsmodels.tsa.seasonal import seasonal_decompose, STL

# from numpy.typing import ArrayLike
Expand Down

0 comments on commit 516579b

Please sign in to comment.