From 4a8dc871b1f4900769df7e8ae8cdb7a9a52b67d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Kir=C3=A1ly?= Date: Sun, 2 Apr 2023 19:03:24 +0100 Subject: [PATCH] [MNT] remove soft dependency import warnings in modules and documented requirements to add these (#4398) Previously, modules that contained objects with soft dependencies were raising import warnings. This would raise a lot of warnings in crawling based utilities such as `all_estimators` (and cause those utilities to have a longer runtime than otherwise). In many cases, the warnings would be raised without a clear reason visible to the user, and would confuse more than they would help - contributing to some user frustration. The information is still raised as an error when users try to construct the estimators in question - and there cause and effect are much clearer. Therefore, I would argue that it is an improvement to get rid of the module warnings. This PR removes both the existing warnings in estimator modules and the convention itself: * removed all calls to `_check_soft_dependencies` with warning level at module import, in estimator modules * removed the instruction to write such checks from all extension templates * removed the bullet point in the dependency handling guide that asked to add these, and rewrote adjacent content for coherence --- docs/source/developer_guide/dependencies.rst | 6 ++---- extension_templates/classification.py | 6 +----- extension_templates/dist_kern_panel.py | 6 +----- extension_templates/dist_kern_tab.py | 6 +----- extension_templates/forecasting.py | 6 +----- extension_templates/param_est.py | 6 +----- extension_templates/transformer.py | 6 +----- sktime/alignment/dtw_python.py | 8 -------- sktime/annotation/adapters/_pyod.py | 2 -- sktime/annotation/hmm_learn/gaussian.py | 3 --- sktime/annotation/hmm_learn/gmm.py | 4 ---- sktime/annotation/hmm_learn/poisson.py | 3 --- sktime/classification/deep_learning/cnn.py | 2 -- sktime/classification/deep_learning/fcn.py | 2 -- sktime/classification/deep_learning/lstmfcn.py | 3 --- sktime/classification/deep_learning/mlp.py | 2 -- sktime/classification/deep_learning/resnet.py | 2 -- sktime/classification/deep_learning/tapnet.py | 2 -- sktime/clustering/k_shapes.py | 3 --- sktime/clustering/kernel_k_means.py | 3 --- sktime/forecasting/adapters/_hcrystalball.py | 2 -- sktime/forecasting/arima.py | 3 --- sktime/forecasting/bats.py | 3 --- sktime/forecasting/fbprophet.py | 3 --- sktime/forecasting/statsforecast.py | 3 --- sktime/forecasting/tbats.py | 3 --- sktime/networks/cnn.py | 2 -- sktime/networks/fcn.py | 2 -- sktime/networks/lstmfcn.py | 3 --- sktime/networks/lstmfcn_layers.py | 5 ----- sktime/networks/mlp.py | 2 -- sktime/networks/tapnet.py | 7 ------- sktime/transformations/panel/catch22wrapper.py | 3 --- sktime/transformations/panel/signature_based/_compute.py | 3 --- .../transformations/panel/signature_based/_rescaling.py | 4 ---- sktime/transformations/panel/tsfresh.py | 3 --- sktime/transformations/series/bkfilter.py | 3 --- sktime/transformations/series/cffilter.py | 4 ---- sktime/transformations/series/filter.py | 3 --- sktime/transformations/series/hpfilter.py | 3 --- sktime/transformations/series/kalman_filter.py | 3 --- sktime/transformations/series/matrix_profile.py | 3 --- 42 files changed, 8 insertions(+), 143 deletions(-) diff --git a/docs/source/developer_guide/dependencies.rst b/docs/source/developer_guide/dependencies.rst index 426942f5faa..9b3f2c5dfd7 100644 --- a/docs/source/developer_guide/dependencies.rst +++ b/docs/source/developer_guide/dependencies.rst @@ -46,12 +46,10 @@ To add an estimator with a soft dependency, ensure the following: * the ``python_dependencies`` tag of the estimator is populated with a ``str``, or a ``list`` of ``str``, of import dependencies. Exceptions will automatically raised when constructing the estimator in an environment without the required packages. -* in the python module containing the estimator, the ``_check_soft_dependencies`` utility is called - at the top of the module, with ``severity="warning"``. This will raise an informative warning message already at module import. - See `here `__ * In a case where the package import differs from the package name, i.e., ``import package_string`` is different from ``pip install different-package-string`` (usually the case for packages containing a dash in the name), the ``_check_soft_dependencies`` - utility should be used in ``__init__``. Both the warning and constructor call should use the ``package_import_alias`` argument for this. + utility should be called in ``__init__`` before the ``super.__init__`` call, with ``severity="error"``. + The ``package_import_alias`` argument should be used to pass the information on package and import strings. * If the soft dependencies require specific python versions, the ``python_version`` tag should also be populated, with a PEP 440 compliant version specification ``str`` such as ``"<3.10"`` or ``">3.6,~=3.8"``. * If including docstring examples that use soft dependencies, ensure to skip doctest. To do this add a ``# doctest: +SKIP`` to the end of each diff --git a/extension_templates/classification.py b/extension_templates/classification.py index e3ec675e36d..560c1fde6aa 100644 --- a/extension_templates/classification.py +++ b/extension_templates/classification.py @@ -42,11 +42,7 @@ # todo: add any necessary imports here # todo: if any imports are sktime soft dependencies: -# * make sure to fill in the "python_dependencies" tag with the package import name -# * add a _check_soft_dependencies warning here, example: -# -# from sktime.utils.validation._dependencies import check_soft_dependencies -# _check_soft_dependencies("soft_dependency_name", severity="warning") +# make sure to fill in the "python_dependencies" tag with the package import name class MyTimeSeriesClassifier(BaseClassifier): diff --git a/extension_templates/dist_kern_panel.py b/extension_templates/dist_kern_panel.py index 1a33dbc1821..3123641930c 100644 --- a/extension_templates/dist_kern_panel.py +++ b/extension_templates/dist_kern_panel.py @@ -30,11 +30,7 @@ # todo: add any necessary imports here # todo: if any imports are sktime soft dependencies: -# * make sure to fill in the "python_dependencies" tag with the package import name -# * add a _check_soft_dependencies warning here, example: -# -# from sktime.utils.validation._dependencies import check_soft_dependencies -# _check_soft_dependencies("soft_dependency_name", severity="warning") +# make sure to fill in the "python_dependencies" tag with the package import name class MyTrafoPwPanel(BasePairwiseTransformerPanel): diff --git a/extension_templates/dist_kern_tab.py b/extension_templates/dist_kern_tab.py index 048b95001ae..0a279fb3032 100644 --- a/extension_templates/dist_kern_tab.py +++ b/extension_templates/dist_kern_tab.py @@ -30,11 +30,7 @@ # todo: add any necessary imports here # todo: if any imports are sktime soft dependencies: -# * make sure to fill in the "python_dependencies" tag with the package import name -# * add a _check_soft_dependencies warning here, example: -# -# from sktime.utils.validation._dependencies import check_soft_dependencies -# _check_soft_dependencies("soft_dependency_name", severity="warning") +# make sure to fill in the "python_dependencies" tag with the package import name class MyTrafoPw(BasePairwiseTransformer): diff --git a/extension_templates/forecasting.py b/extension_templates/forecasting.py index cfcd84b7275..e7b65bbc2df 100644 --- a/extension_templates/forecasting.py +++ b/extension_templates/forecasting.py @@ -51,11 +51,7 @@ # todo: add any necessary imports here # todo: if any imports are sktime soft dependencies: -# * make sure to fill in the "python_dependencies" tag with the package import name -# * add a _check_soft_dependencies warning here, example: -# -# from sktime.utils.validation._dependencies import check_soft_dependencies -# _check_soft_dependencies("soft_dependency_name", severity="warning") +# make sure to fill in the "python_dependencies" tag with the package import name class MyForecaster(BaseForecaster): diff --git a/extension_templates/param_est.py b/extension_templates/param_est.py index d8b34f7bb76..6ea9ba46139 100644 --- a/extension_templates/param_est.py +++ b/extension_templates/param_est.py @@ -38,11 +38,7 @@ # todo: add any necessary imports here # todo: if any imports are sktime soft dependencies: -# * make sure to fill in the "python_dependencies" tag with the package import name -# * add a _check_soft_dependencies warning here, example: -# -# from sktime.utils.validation._dependencies import check_soft_dependencies -# _check_soft_dependencies("soft_dependency_name", severity="warning") +# make sure to fill in the "python_dependencies" tag with the package import name class MyTimeSeriesParamFitter(BaseParamFitter): diff --git a/extension_templates/transformer.py b/extension_templates/transformer.py index 2d76543a6e2..8936eb5ce58 100644 --- a/extension_templates/transformer.py +++ b/extension_templates/transformer.py @@ -49,11 +49,7 @@ # todo: add any necessary sktime internal imports here # todo: if any imports are sktime soft dependencies: -# * make sure to fill in the "python_dependencies" tag with the package import name -# * add a _check_soft_dependencies warning here, example: -# -# from sktime.utils.validation._dependencies import check_soft_dependencies -# _check_soft_dependencies("soft_dependency_name", severity="warning") +# make sure to fill in the "python_dependencies" tag with the package import name class MyTransformer(BaseTransformer): diff --git a/sktime/alignment/dtw_python.py b/sktime/alignment/dtw_python.py index bd01751bb36..133edc7683c 100644 --- a/sktime/alignment/dtw_python.py +++ b/sktime/alignment/dtw_python.py @@ -12,14 +12,6 @@ from sktime.alignment.base import BaseAligner from sktime.utils.validation._dependencies import _check_soft_dependencies -_check_soft_dependencies( - "dtw-python", - package_import_alias={"dtw-python": "dtw"}, - severity="warning", - obj="AlignerDTW or AlignerDTWfromDist", - suppress_import_stdout=True, -) - class AlignerDTW(BaseAligner): """Aligner interface for dtw-python. diff --git a/sktime/annotation/adapters/_pyod.py b/sktime/annotation/adapters/_pyod.py index f085373c071..8caa0260d10 100644 --- a/sktime/annotation/adapters/_pyod.py +++ b/sktime/annotation/adapters/_pyod.py @@ -13,8 +13,6 @@ import pandas as pd -_check_soft_dependencies("pyod", severity="warning") - class PyODAnnotator(BaseSeriesAnnotator): """Transformer that applies outlier detector from pyOD. diff --git a/sktime/annotation/hmm_learn/gaussian.py b/sktime/annotation/hmm_learn/gaussian.py index 524974a3c23..e4dde1be224 100644 --- a/sktime/annotation/hmm_learn/gaussian.py +++ b/sktime/annotation/hmm_learn/gaussian.py @@ -8,13 +8,10 @@ """ from sktime.annotation.hmm_learn import BaseHMMLearn -from sktime.utils.validation._dependencies import _check_soft_dependencies __author__ = ["miraep8"] __all__ = ["GaussianHMM"] -_check_soft_dependencies("hmmlearn.hmm", severity="warning") - class GaussianHMM(BaseHMMLearn): """Hidden Markov Model with Gaussian emissions. diff --git a/sktime/annotation/hmm_learn/gmm.py b/sktime/annotation/hmm_learn/gmm.py index 67d02247d55..b3b1ba81ea7 100644 --- a/sktime/annotation/hmm_learn/gmm.py +++ b/sktime/annotation/hmm_learn/gmm.py @@ -8,15 +8,11 @@ """ from sktime.annotation.hmm_learn import BaseHMMLearn -from sktime.utils.validation._dependencies import _check_soft_dependencies __author__ = ["miraep8"] __all__ = ["GMMHMM"] -_check_soft_dependencies("hmmlearn.hmm", severity="warning") - - class GMMHMM(BaseHMMLearn): """ Hidden Markov Model with Gaussian mixture emissions. diff --git a/sktime/annotation/hmm_learn/poisson.py b/sktime/annotation/hmm_learn/poisson.py index 92998acc645..f8f411f3d28 100644 --- a/sktime/annotation/hmm_learn/poisson.py +++ b/sktime/annotation/hmm_learn/poisson.py @@ -8,13 +8,10 @@ """ from sktime.annotation.hmm_learn import BaseHMMLearn -from sktime.utils.validation._dependencies import _check_soft_dependencies __author__ = ["klam-data", "pyyim", "mgorlin"] __all__ = ["PoissonHMM"] -_check_soft_dependencies("hmmlearn.hmm", severity="warning") - class PoissonHMM(BaseHMMLearn): """ diff --git a/sktime/classification/deep_learning/cnn.py b/sktime/classification/deep_learning/cnn.py index af9c146e967..c043a58b233 100644 --- a/sktime/classification/deep_learning/cnn.py +++ b/sktime/classification/deep_learning/cnn.py @@ -12,8 +12,6 @@ from sktime.networks.cnn import CNNNetwork from sktime.utils.validation._dependencies import _check_dl_dependencies -_check_dl_dependencies(severity="warning") - class CNNClassifier(BaseDeepClassifier): """Time Convolutional Neural Network (CNN), as described in [1]_. diff --git a/sktime/classification/deep_learning/fcn.py b/sktime/classification/deep_learning/fcn.py index 33ce06f9f97..4d31e9caa80 100644 --- a/sktime/classification/deep_learning/fcn.py +++ b/sktime/classification/deep_learning/fcn.py @@ -12,8 +12,6 @@ from sktime.networks.fcn import FCNNetwork from sktime.utils.validation._dependencies import _check_dl_dependencies -_check_dl_dependencies(severity="warning") - class FCNClassifier(BaseDeepClassifier): """Fully Connected Neural Network (FCN), as described in [1]_. diff --git a/sktime/classification/deep_learning/lstmfcn.py b/sktime/classification/deep_learning/lstmfcn.py index 8c748c0be7f..45dfbf7160d 100644 --- a/sktime/classification/deep_learning/lstmfcn.py +++ b/sktime/classification/deep_learning/lstmfcn.py @@ -10,9 +10,6 @@ from sktime.classification.deep_learning.base import BaseDeepClassifier from sktime.networks.lstmfcn import LSTMFCNNetwork -from sktime.utils.validation._dependencies import _check_dl_dependencies - -_check_dl_dependencies(severity="warning") class LSTMFCNClassifier(BaseDeepClassifier): diff --git a/sktime/classification/deep_learning/mlp.py b/sktime/classification/deep_learning/mlp.py index bc9d817f53b..9f5e940ad0f 100644 --- a/sktime/classification/deep_learning/mlp.py +++ b/sktime/classification/deep_learning/mlp.py @@ -12,8 +12,6 @@ from sktime.networks.mlp import MLPNetwork from sktime.utils.validation._dependencies import _check_dl_dependencies -_check_dl_dependencies(severity="warning") - class MLPClassifier(BaseDeepClassifier): """Multi Layer Perceptron Network (MLP), as described in [1]_. diff --git a/sktime/classification/deep_learning/resnet.py b/sktime/classification/deep_learning/resnet.py index 1f85a883d0b..121fc7a57a5 100644 --- a/sktime/classification/deep_learning/resnet.py +++ b/sktime/classification/deep_learning/resnet.py @@ -12,8 +12,6 @@ from sktime.networks.resnet import ResNetNetwork from sktime.utils.validation._dependencies import _check_dl_dependencies -_check_dl_dependencies(severity="warning") - class ResNetClassifier(BaseDeepClassifier): """ diff --git a/sktime/classification/deep_learning/tapnet.py b/sktime/classification/deep_learning/tapnet.py index 9a498a3a006..d6bf04044a3 100644 --- a/sktime/classification/deep_learning/tapnet.py +++ b/sktime/classification/deep_learning/tapnet.py @@ -18,8 +18,6 @@ from sktime.networks.tapnet import TapNetNetwork from sktime.utils.validation._dependencies import _check_dl_dependencies -_check_dl_dependencies(severity="warning") - class TapNetClassifier(BaseDeepClassifier): """Time series attentional prototype network (TapNet), as described in [1]_. diff --git a/sktime/clustering/k_shapes.py b/sktime/clustering/k_shapes.py index 4a424844adc..e0ca8b3ab65 100755 --- a/sktime/clustering/k_shapes.py +++ b/sktime/clustering/k_shapes.py @@ -6,9 +6,6 @@ from numpy.random import RandomState from sktime.clustering.base import BaseClusterer, TimeSeriesInstances -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("tslearn", severity="warning") class TimeSeriesKShapes(BaseClusterer): diff --git a/sktime/clustering/kernel_k_means.py b/sktime/clustering/kernel_k_means.py index 6f6c6d46367..974be97c678 100755 --- a/sktime/clustering/kernel_k_means.py +++ b/sktime/clustering/kernel_k_means.py @@ -6,9 +6,6 @@ from numpy.random import RandomState from sktime.clustering.base import BaseClusterer, TimeSeriesInstances -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("tslearn", severity="warning") class TimeSeriesKernelKMeans(BaseClusterer): diff --git a/sktime/forecasting/adapters/_hcrystalball.py b/sktime/forecasting/adapters/_hcrystalball.py index caef2b7b1f9..59d2100259d 100644 --- a/sktime/forecasting/adapters/_hcrystalball.py +++ b/sktime/forecasting/adapters/_hcrystalball.py @@ -11,8 +11,6 @@ from sktime.forecasting.base import BaseForecaster from sktime.utils.validation._dependencies import _check_soft_dependencies -_check_soft_dependencies("hcrystalball", severity="warning") - def _check_fh(fh, cutoff): if fh is not None: diff --git a/sktime/forecasting/arima.py b/sktime/forecasting/arima.py index 9479585f475..676c9c7614d 100644 --- a/sktime/forecasting/arima.py +++ b/sktime/forecasting/arima.py @@ -7,9 +7,6 @@ __all__ = ["AutoARIMA", "ARIMA"] from sktime.forecasting.base.adapters._pmdarima import _PmdArimaAdapter -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("pmdarima", severity="warning") class AutoARIMA(_PmdArimaAdapter): diff --git a/sktime/forecasting/bats.py b/sktime/forecasting/bats.py index 5ad2fa508a9..ba609176a29 100644 --- a/sktime/forecasting/bats.py +++ b/sktime/forecasting/bats.py @@ -13,9 +13,6 @@ __all__ = ["BATS"] from sktime.forecasting.base.adapters import _TbatsAdapter -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("tbats", severity="warning") class BATS(_TbatsAdapter): diff --git a/sktime/forecasting/fbprophet.py b/sktime/forecasting/fbprophet.py index 91f388937de..1d274534ab8 100644 --- a/sktime/forecasting/fbprophet.py +++ b/sktime/forecasting/fbprophet.py @@ -9,9 +9,6 @@ from sktime.forecasting.base._base import DEFAULT_ALPHA from sktime.forecasting.base.adapters import _ProphetAdapter -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("prophet", severity="warning") class Prophet(_ProphetAdapter): diff --git a/sktime/forecasting/statsforecast.py b/sktime/forecasting/statsforecast.py index 2cd56583d9a..64d82355290 100644 --- a/sktime/forecasting/statsforecast.py +++ b/sktime/forecasting/statsforecast.py @@ -9,9 +9,6 @@ from typing import Dict, Optional from sktime.forecasting.base.adapters._statsforecast import _StatsForecastAdapter -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("statsforecast", severity="warning") class StatsForecastAutoARIMA(_StatsForecastAdapter): diff --git a/sktime/forecasting/tbats.py b/sktime/forecasting/tbats.py index e4aaaf9f29f..78cf4768072 100644 --- a/sktime/forecasting/tbats.py +++ b/sktime/forecasting/tbats.py @@ -13,9 +13,6 @@ __all__ = ["TBATS"] from sktime.forecasting.base.adapters import _TbatsAdapter -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("tbats", severity="warning") class TBATS(_TbatsAdapter): diff --git a/sktime/networks/cnn.py b/sktime/networks/cnn.py index 4ec39873f74..81f3df5e12d 100644 --- a/sktime/networks/cnn.py +++ b/sktime/networks/cnn.py @@ -6,8 +6,6 @@ from sktime.networks.base import BaseDeepNetwork from sktime.utils.validation._dependencies import _check_dl_dependencies -_check_dl_dependencies(severity="warning") - class CNNNetwork(BaseDeepNetwork): """Establish the network structure for a CNN. diff --git a/sktime/networks/fcn.py b/sktime/networks/fcn.py index e3e024a0a77..6ee99c306a3 100644 --- a/sktime/networks/fcn.py +++ b/sktime/networks/fcn.py @@ -6,8 +6,6 @@ from sktime.networks.base import BaseDeepNetwork from sktime.utils.validation._dependencies import _check_dl_dependencies -_check_dl_dependencies(severity="warning") - class FCNNetwork(BaseDeepNetwork): """Establish the network structure for a FCN. diff --git a/sktime/networks/lstmfcn.py b/sktime/networks/lstmfcn.py index 81aa2b523e2..bf68188927e 100644 --- a/sktime/networks/lstmfcn.py +++ b/sktime/networks/lstmfcn.py @@ -4,9 +4,6 @@ __author__ = ["jnrusson1", "solen0id"] from sktime.networks.base import BaseDeepNetwork -from sktime.utils.validation._dependencies import _check_dl_dependencies - -_check_dl_dependencies(severity="warning") class LSTMFCNNetwork(BaseDeepNetwork): diff --git a/sktime/networks/lstmfcn_layers.py b/sktime/networks/lstmfcn_layers.py index 8f3b444ad50..2280e28a38c 100644 --- a/sktime/networks/lstmfcn_layers.py +++ b/sktime/networks/lstmfcn_layers.py @@ -2,11 +2,6 @@ """Attention Layers used in by the LSTM-FCN Network. Ported over from sktime-dl.""" -from sktime.utils.validation._dependencies import _check_dl_dependencies - -_check_dl_dependencies(severity="warning") - - def make_attention_lstm(): """Return AttentionLSTM class used by the LSTM-FCN Network.""" from tensorflow.keras import activations diff --git a/sktime/networks/mlp.py b/sktime/networks/mlp.py index 5dc6d6215b5..d335ef8d574 100644 --- a/sktime/networks/mlp.py +++ b/sktime/networks/mlp.py @@ -6,8 +6,6 @@ from sktime.networks.base import BaseDeepNetwork from sktime.utils.validation._dependencies import _check_dl_dependencies -_check_dl_dependencies(severity="warning") - class MLPNetwork(BaseDeepNetwork): """Establish the network structure for a MLP. diff --git a/sktime/networks/tapnet.py b/sktime/networks/tapnet.py index 12407e962a9..b0d58c3cd5e 100644 --- a/sktime/networks/tapnet.py +++ b/sktime/networks/tapnet.py @@ -15,13 +15,6 @@ _check_soft_dependencies, ) -_check_soft_dependencies( - "keras-self-attention", - package_import_alias={"keras-self-attention": "keras_self_attention"}, - severity="warning", -) -_check_dl_dependencies(severity="warning") - class TapNetNetwork(BaseDeepNetwork): """Establish Network structure for TapNet. diff --git a/sktime/transformations/panel/catch22wrapper.py b/sktime/transformations/panel/catch22wrapper.py index 2facaf490de..825ba276e04 100644 --- a/sktime/transformations/panel/catch22wrapper.py +++ b/sktime/transformations/panel/catch22wrapper.py @@ -14,9 +14,6 @@ from sktime.transformations.base import BaseTransformer from sktime.transformations.panel import catch22 from sktime.utils.validation import check_n_jobs -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("pycatch22", severity="warning") class Catch22Wrapper(BaseTransformer): diff --git a/sktime/transformations/panel/signature_based/_compute.py b/sktime/transformations/panel/signature_based/_compute.py index 78c582e14b8..8d2a87d4b38 100644 --- a/sktime/transformations/panel/signature_based/_compute.py +++ b/sktime/transformations/panel/signature_based/_compute.py @@ -8,9 +8,6 @@ _rescale_signature, ) from sktime.transformations.panel.signature_based._window import _window_getter -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("esig", severity="warning") class _WindowSignatureTransform(BaseTransformer): diff --git a/sktime/transformations/panel/signature_based/_rescaling.py b/sktime/transformations/panel/signature_based/_rescaling.py index cd03d71b671..92c36eb34bc 100644 --- a/sktime/transformations/panel/signature_based/_rescaling.py +++ b/sktime/transformations/panel/signature_based/_rescaling.py @@ -12,10 +12,6 @@ import numpy as np -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("esig", severity="warning") - def _rescale_path(path, depth): """Rescale input path by depth! ** (1 / depth). diff --git a/sktime/transformations/panel/tsfresh.py b/sktime/transformations/panel/tsfresh.py index 8bf3dcc0314..8606e2b4900 100644 --- a/sktime/transformations/panel/tsfresh.py +++ b/sktime/transformations/panel/tsfresh.py @@ -10,9 +10,6 @@ from sktime.datatypes._panel._convert import from_nested_to_long from sktime.transformations.base import BaseTransformer from sktime.utils.validation import check_n_jobs -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("tsfresh", severity="warning") class _TSFreshFeatureExtractor(BaseTransformer): diff --git a/sktime/transformations/series/bkfilter.py b/sktime/transformations/series/bkfilter.py index ae4b59a3293..9f21d552d90 100644 --- a/sktime/transformations/series/bkfilter.py +++ b/sktime/transformations/series/bkfilter.py @@ -13,9 +13,6 @@ import pandas as pd from sktime.transformations.base import BaseTransformer -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("statsmodels", severity="warning") class BKFilter(BaseTransformer): diff --git a/sktime/transformations/series/cffilter.py b/sktime/transformations/series/cffilter.py index 384f53a74d4..4866518e837 100644 --- a/sktime/transformations/series/cffilter.py +++ b/sktime/transformations/series/cffilter.py @@ -13,9 +13,6 @@ import pandas as pd from sktime.transformations.base import BaseTransformer -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("statsmodels", severity="warning") class CFFilter(BaseTransformer): @@ -43,7 +40,6 @@ class CFFilter(BaseTransformer): > x : If X is 1d, X=x. If 2d, x is assumed to be in columns. > nobs : len(x) - Examples -------- >>> from sktime.transformations.series.cffilter import CFFilter # doctest: +SKIP diff --git a/sktime/transformations/series/filter.py b/sktime/transformations/series/filter.py index 21f4a457e46..30720efc2ef 100644 --- a/sktime/transformations/series/filter.py +++ b/sktime/transformations/series/filter.py @@ -7,9 +7,6 @@ import numpy as np from sktime.transformations.base import BaseTransformer -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("mne", severity="warning") class Filter(BaseTransformer): diff --git a/sktime/transformations/series/hpfilter.py b/sktime/transformations/series/hpfilter.py index 98dc17d0385..083aa01deab 100644 --- a/sktime/transformations/series/hpfilter.py +++ b/sktime/transformations/series/hpfilter.py @@ -15,9 +15,6 @@ import pandas as pd from sktime.transformations.base import BaseTransformer -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("statsmodels", severity="warning") class HPFilter(BaseTransformer): diff --git a/sktime/transformations/series/kalman_filter.py b/sktime/transformations/series/kalman_filter.py index 33d142e94d5..a490e8beb21 100644 --- a/sktime/transformations/series/kalman_filter.py +++ b/sktime/transformations/series/kalman_filter.py @@ -21,9 +21,6 @@ from sktime.transformations.base import BaseTransformer from sktime.utils.validation._dependencies import _check_soft_dependencies -_check_soft_dependencies("pykalman", severity="warning") -_check_soft_dependencies("filterpy", severity="warning") - def _get_t_matrix(time_t, matrices, shape, time_steps): """Extract matrix to be used at iteration `time_t` of the Kalman filter iterations. diff --git a/sktime/transformations/series/matrix_profile.py b/sktime/transformations/series/matrix_profile.py index 576d7f7cd61..442893e1c60 100644 --- a/sktime/transformations/series/matrix_profile.py +++ b/sktime/transformations/series/matrix_profile.py @@ -7,9 +7,6 @@ __all__ = ["MatrixProfileTransformer"] from sktime.transformations.base import BaseTransformer -from sktime.utils.validation._dependencies import _check_soft_dependencies - -_check_soft_dependencies("stumpy", severity="warning") class MatrixProfileTransformer(BaseTransformer):