From 20e516afe7f342fbbae0210d608cd37b68c18642 Mon Sep 17 00:00:00 2001 From: Ivan Nedosekov Date: Thu, 18 Aug 2022 16:00:03 +0300 Subject: [PATCH 1/5] add py.typed marker file for PEP-561 support --- etna/py.typed | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 etna/py.typed diff --git a/etna/py.typed b/etna/py.typed new file mode 100644 index 000000000..e69de29bb From 7cd51773ffce99ea62f70b34fdbe452d88a3165d Mon Sep 17 00:00:00 2001 From: Ivan Nedosekov Date: Thu, 18 Aug 2022 16:38:01 +0300 Subject: [PATCH 2/5] stubs for arima --- etna/libs/pmdarima_utils/arima.pyi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 etna/libs/pmdarima_utils/arima.pyi diff --git a/etna/libs/pmdarima_utils/arima.pyi b/etna/libs/pmdarima_utils/arima.pyi new file mode 100644 index 000000000..22309ef77 --- /dev/null +++ b/etna/libs/pmdarima_utils/arima.pyi @@ -0,0 +1,18 @@ +from typing import Any + +from numpy import ndarray + +def ARMAtoMA( + ar: ndarray, + ma: ndarray, + max_deg: int, + ) -> ndarray: ... + +def seasonal_prediction_with_confidence( + arima_res: Any, + start: Any, + end: Any, + X: Any, + alpha: Any, + **kwargs: Any, + ) -> Any: ... From 3358454f5a235fa98b47bf19e10301d1cd94e051 Mon Sep 17 00:00:00 2001 From: Ivan Nedosekov Date: Thu, 18 Aug 2022 17:33:16 +0300 Subject: [PATCH 3/5] tsfresh stubs --- etna/libs/tsfresh/distribution.pyi | 1 + etna/libs/tsfresh/relevance.pyi | 25 ++++++++++++++++++++++++ etna/libs/tsfresh/significance_tests.pyi | 6 ++++++ 3 files changed, 32 insertions(+) create mode 100644 etna/libs/tsfresh/distribution.pyi create mode 100644 etna/libs/tsfresh/relevance.pyi create mode 100644 etna/libs/tsfresh/significance_tests.pyi diff --git a/etna/libs/tsfresh/distribution.pyi b/etna/libs/tsfresh/distribution.pyi new file mode 100644 index 000000000..7eeb505f7 --- /dev/null +++ b/etna/libs/tsfresh/distribution.pyi @@ -0,0 +1 @@ +def initialize_warnings_in_workers(show_warnings: bool) -> None: ... diff --git a/etna/libs/tsfresh/relevance.pyi b/etna/libs/tsfresh/relevance.pyi new file mode 100644 index 000000000..79568ade1 --- /dev/null +++ b/etna/libs/tsfresh/relevance.pyi @@ -0,0 +1,25 @@ +from typing import List +from typing import Optional + +import pandas as pd + +def calculate_relevance_table( + X: pd.DataFrame, + y: pd.Series, + ml_task: str = ..., + multiclass: bool = ..., + n_significant: int = ..., + n_jobs: int = ..., + show_warnings: bool = ..., + chunksize: Optional[int] = ..., + test_for_binary_target_binary_feature: str = ..., + test_for_binary_target_real_feature: str = ..., + test_for_real_target_binary_feature: str = ..., + test_for_real_target_real_feature: str = ..., + fdr_level: float = ..., + hypotheses_independent: bool = ..., + ) -> pd.DataFrame: ... + +def infer_ml_task(y: pd.Series) -> str: ... +def combine_relevance_tables(relevance_tables: List[pd.DataFrame]) -> pd.DataFrame: ... +def get_feature_type(feature_column: pd.Series) -> str: ... diff --git a/etna/libs/tsfresh/significance_tests.pyi b/etna/libs/tsfresh/significance_tests.pyi new file mode 100644 index 000000000..bf589824a --- /dev/null +++ b/etna/libs/tsfresh/significance_tests.pyi @@ -0,0 +1,6 @@ +import pandas as pd + +def target_binary_feature_binary_test(x: pd.Series, y: pd.Series) -> float: ... +def target_binary_feature_real_test(x: pd.Series, y: pd.Series, test: str) -> float: ... +def target_real_feature_binary_test(x: pd.Series, y: pd.Series) -> float: ... +def target_real_feature_real_test(x: pd.Series, y: pd.Series) -> float: ... From b0bad649029e3a4319eea83660bfa88d240939f8 Mon Sep 17 00:00:00 2001 From: Ivan Nedosekov Date: Thu, 18 Aug 2022 17:39:23 +0300 Subject: [PATCH 4/5] lost init in lib --- etna/libs/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 etna/libs/__init__.py diff --git a/etna/libs/__init__.py b/etna/libs/__init__.py new file mode 100644 index 000000000..e69de29bb From b6e396f6f8fa64d1f49a49495fc55827efe9f4e7 Mon Sep 17 00:00:00 2001 From: Ivan Nedosekov Date: Fri, 19 Aug 2022 13:57:02 +0300 Subject: [PATCH 5/5] add to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc54b2758..4058507b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - ### Fixed +- Type hints for external users by [PEP 561](https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-library-stubs-or-py-typed-marker) ([#868](https://github.com/tinkoff-ai/etna/pull/868)) - Type hints for `Pipeline.model` match `models.nn`([#768](https://github.com/tinkoff-ai/etna/pull/840)) - -