Skip to content

Commit

Permalink
Fix some warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
vnmabus committed Oct 12, 2023
1 parent 7b0c0b7 commit febfe36
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 12 deletions.
5 changes: 2 additions & 3 deletions skfda/datasets/_real_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@

import numpy as np
import pandas as pd
import rdata
from pandas import DataFrame, Series
from sklearn.utils import Bunch
from typing_extensions import Literal

import rdata

from ..representation import FDataGrid
from ..typing._numpy import NDArrayFloat, NDArrayInt

Expand Down Expand Up @@ -180,7 +179,7 @@ def fetch_ucr(
The UCR/UEA Time Series Classification repository, hosted at
www.timeseriesclassification.com includes plenty of
classification problems with univariate and multivariate time series
\ :footcite:p:`dau++_2019_ucr,bagnall++_2018_uea`.
:footcite:p:`dau++_2019_ucr,bagnall++_2018_uea`.
They are widely used in the functional data classification literature.
Args:
Expand Down
5 changes: 2 additions & 3 deletions skfda/exploratory/visualization/_boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from typing import Sequence, Tuple

import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.axes import Axes
from matplotlib.colors import Colormap
Expand Down Expand Up @@ -376,7 +375,7 @@ def __init__(

self._fdatagrid = fdatagrid
self._prob = prob
self._colormap = plt.cm.get_cmap('RdPu')
self._colormap = matplotlib.colormaps['RdPu']
self.barcol = "blue"
self.outliercol = "red"
self.mediancol = "black"
Expand Down Expand Up @@ -701,7 +700,7 @@ def __init__(
self._non_outlying_envelope = _envelopes.compute_envelope(inliers)

self._fdatagrid = fdatagrid
self.colormap = plt.cm.get_cmap('Greys')
self.colormap = matplotlib.colormaps['Greys']
self._boxcol = 1.0
self._outcol = 0.7

Expand Down
3 changes: 1 addition & 2 deletions skfda/exploratory/visualization/_magnitude_shape_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from typing import Any, Sequence

import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.artist import Artist
from matplotlib.axes import Axes
Expand Down Expand Up @@ -193,7 +192,7 @@ def __init__(

self._fdata = fdata
self._outliers = outliers
self._colormap = plt.cm.get_cmap('seismic')
self._colormap = matplotlib.colormaps['seismic']
self._color = 0.2
self._outliercol = 0.8
self.xlabel = 'MO'
Expand Down
6 changes: 3 additions & 3 deletions skfda/ml/classification/_depth_classifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class DDClassifier(
Depth-versus-depth (DD) classifer for functional data.
Transforms the data into a DD-plot and then classifies using a polynomial
of a chosen degree\ :footcite:p:`li++_2012_ddclassifier`.
of a chosen degree :footcite:p:`li++_2012_ddclassifier`.
The polynomial passes through zero and maximizes the accuracy of the
classification on the train dataset.
Expand Down Expand Up @@ -117,7 +117,7 @@ class DDClassifier(
See also:
:class:`~skfda.ml.classification.DDGClassifier`
:class:`~skfda.ml.classification.MaximumDepthClassifier`
:class:`~skfda.preprocessing.dim_reduction.feature_extraction._ddg_transformer`
:class:`~skfda.preprocessing.dim_reduction.feature_construction._ddg_transformer`
References:
.. footbibliography::
Expand Down Expand Up @@ -307,7 +307,7 @@ class DDGClassifier(
See also:
:class:`~skfda.ml.classification.DDClassifier`
:class:`~skfda.ml.classification.MaximumDepthClassifier`
:class:`~skfda.preprocessing.dim_reduction.feature_extraction._ddg_transformer`
:class:`~skfda.preprocessing.dim_reduction.feature_construction._ddg_transformer`
References:
.. footbibliography::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
'Please use "dim_reduction" for FPCA'
'or "feature_construction" for feature construction techniques',
category=DeprecationWarning,
stacklevel=2,
)
1 change: 1 addition & 0 deletions skfda/preprocessing/dim_reduction/projection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
warnings.warn(
'The module "projection" is deprecated. Please use "dim_reduction"',
category=DeprecationWarning,
stacklevel=2,
)
1 change: 1 addition & 0 deletions skfda/preprocessing/smoothing/kernel_smoothers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"The \"kernel_smoothers\" module is deprecated. "
"Use the \"KernelSmoother\" class instead",
DeprecationWarning,
stacklevel=2,
)


Expand Down
3 changes: 2 additions & 1 deletion skfda/representation/basis/_bspline_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ def __init__( # noqa: WPS238
knots=knots,
)
warnings.warn(
"The BSplines class is deprecated. Use BSplineBasis instead.",
"The BSpline class is deprecated. Use BSplineBasis instead.",
DeprecationWarning,
stacklevel=2,
)
1 change: 1 addition & 0 deletions skfda/representation/basis/_constant_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,6 @@ def __init__(self, domain_range: Optional[DomainRangeLike] = None) -> None:
warnings.warn(
"The Constant class is deprecated. Use ConstantBasis instead.",
DeprecationWarning,
stacklevel=2,
)
super().__init__(domain_range=domain_range)
1 change: 1 addition & 0 deletions skfda/representation/basis/_finite_element_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,5 @@ def __init__(
"The FiniteElement class is deprecated. Use "
"FiniteElementBasis instead.",
DeprecationWarning,
stacklevel=2,
)
1 change: 1 addition & 0 deletions skfda/representation/basis/_fourier_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ def __init__(
warnings.warn(
"The Fourier class is deprecated. Use FourierBasis instead.",
DeprecationWarning,
stacklevel=2,
)
super().__init__(
domain_range=domain_range,
Expand Down
1 change: 1 addition & 0 deletions skfda/representation/basis/_monomial_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,5 @@ def __init__(
warnings.warn(
"The Monomial class is deprecated. Use MonomialBasis instead.",
DeprecationWarning,
stacklevel=2,
)
1 change: 1 addition & 0 deletions skfda/representation/basis/_tensor_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,5 @@ def __init__(self, basis_list: Iterable[Basis]):
warnings.warn(
"The Tensor class is deprecated. Use TensorBasis instead.",
DeprecationWarning,
stacklevel=2,
)
1 change: 1 addition & 0 deletions skfda/representation/basis/_vector_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,5 @@ def __init__(self, basis_list: Iterable[Basis]) -> None:
"The VectorValued class is deprecated. "
"Use VectorValuedBasis instead.",
DeprecationWarning,
stacklevel=2,
)

0 comments on commit febfe36

Please sign in to comment.