From febfe36fbb5c2f947c4956eebfe6d4ce08768763 Mon Sep 17 00:00:00 2001 From: VNMabus Date: Thu, 12 Oct 2023 14:18:17 +0200 Subject: [PATCH 1/7] Fix some warnings. --- skfda/datasets/_real_datasets.py | 5 ++--- skfda/exploratory/visualization/_boxplot.py | 5 ++--- skfda/exploratory/visualization/_magnitude_shape_plot.py | 3 +-- skfda/ml/classification/_depth_classifiers.py | 6 +++--- .../dim_reduction/feature_extraction/__init__.py | 1 + skfda/preprocessing/dim_reduction/projection/__init__.py | 1 + skfda/preprocessing/smoothing/kernel_smoothers.py | 1 + skfda/representation/basis/_bspline_basis.py | 3 ++- skfda/representation/basis/_constant_basis.py | 1 + skfda/representation/basis/_finite_element_basis.py | 1 + skfda/representation/basis/_fourier_basis.py | 1 + skfda/representation/basis/_monomial_basis.py | 1 + skfda/representation/basis/_tensor_basis.py | 1 + skfda/representation/basis/_vector_basis.py | 1 + 14 files changed, 19 insertions(+), 12 deletions(-) diff --git a/skfda/datasets/_real_datasets.py b/skfda/datasets/_real_datasets.py index 28415c76c..d345ebdcf 100644 --- a/skfda/datasets/_real_datasets.py +++ b/skfda/datasets/_real_datasets.py @@ -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 @@ -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: diff --git a/skfda/exploratory/visualization/_boxplot.py b/skfda/exploratory/visualization/_boxplot.py index 19aae239b..e315a92f0 100644 --- a/skfda/exploratory/visualization/_boxplot.py +++ b/skfda/exploratory/visualization/_boxplot.py @@ -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 @@ -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" @@ -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 diff --git a/skfda/exploratory/visualization/_magnitude_shape_plot.py b/skfda/exploratory/visualization/_magnitude_shape_plot.py index bb5c56d51..6fc13fbdf 100644 --- a/skfda/exploratory/visualization/_magnitude_shape_plot.py +++ b/skfda/exploratory/visualization/_magnitude_shape_plot.py @@ -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 @@ -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' diff --git a/skfda/ml/classification/_depth_classifiers.py b/skfda/ml/classification/_depth_classifiers.py index 47e29e239..c258d608b 100644 --- a/skfda/ml/classification/_depth_classifiers.py +++ b/skfda/ml/classification/_depth_classifiers.py @@ -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. @@ -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:: @@ -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:: diff --git a/skfda/preprocessing/dim_reduction/feature_extraction/__init__.py b/skfda/preprocessing/dim_reduction/feature_extraction/__init__.py index 70fdefb97..d55d51315 100644 --- a/skfda/preprocessing/dim_reduction/feature_extraction/__init__.py +++ b/skfda/preprocessing/dim_reduction/feature_extraction/__init__.py @@ -8,4 +8,5 @@ 'Please use "dim_reduction" for FPCA' 'or "feature_construction" for feature construction techniques', category=DeprecationWarning, + stacklevel=2, ) diff --git a/skfda/preprocessing/dim_reduction/projection/__init__.py b/skfda/preprocessing/dim_reduction/projection/__init__.py index f028b2627..a56b0ff83 100644 --- a/skfda/preprocessing/dim_reduction/projection/__init__.py +++ b/skfda/preprocessing/dim_reduction/projection/__init__.py @@ -5,4 +5,5 @@ warnings.warn( 'The module "projection" is deprecated. Please use "dim_reduction"', category=DeprecationWarning, + stacklevel=2, ) diff --git a/skfda/preprocessing/smoothing/kernel_smoothers.py b/skfda/preprocessing/smoothing/kernel_smoothers.py index ae3b7ac85..fbe9d68ad 100644 --- a/skfda/preprocessing/smoothing/kernel_smoothers.py +++ b/skfda/preprocessing/smoothing/kernel_smoothers.py @@ -18,6 +18,7 @@ "The \"kernel_smoothers\" module is deprecated. " "Use the \"KernelSmoother\" class instead", DeprecationWarning, + stacklevel=2, ) diff --git a/skfda/representation/basis/_bspline_basis.py b/skfda/representation/basis/_bspline_basis.py index 15059e49c..3c3981db4 100644 --- a/skfda/representation/basis/_bspline_basis.py +++ b/skfda/representation/basis/_bspline_basis.py @@ -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, ) diff --git a/skfda/representation/basis/_constant_basis.py b/skfda/representation/basis/_constant_basis.py index 6d7d6e24b..3305ba21a 100644 --- a/skfda/representation/basis/_constant_basis.py +++ b/skfda/representation/basis/_constant_basis.py @@ -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) diff --git a/skfda/representation/basis/_finite_element_basis.py b/skfda/representation/basis/_finite_element_basis.py index a2a64b0d1..6f8142b68 100644 --- a/skfda/representation/basis/_finite_element_basis.py +++ b/skfda/representation/basis/_finite_element_basis.py @@ -229,4 +229,5 @@ def __init__( "The FiniteElement class is deprecated. Use " "FiniteElementBasis instead.", DeprecationWarning, + stacklevel=2, ) diff --git a/skfda/representation/basis/_fourier_basis.py b/skfda/representation/basis/_fourier_basis.py index c8d324330..cb7b737bd 100644 --- a/skfda/representation/basis/_fourier_basis.py +++ b/skfda/representation/basis/_fourier_basis.py @@ -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, diff --git a/skfda/representation/basis/_monomial_basis.py b/skfda/representation/basis/_monomial_basis.py index be6370398..35129ac3a 100644 --- a/skfda/representation/basis/_monomial_basis.py +++ b/skfda/representation/basis/_monomial_basis.py @@ -211,4 +211,5 @@ def __init__( warnings.warn( "The Monomial class is deprecated. Use MonomialBasis instead.", DeprecationWarning, + stacklevel=2, ) diff --git a/skfda/representation/basis/_tensor_basis.py b/skfda/representation/basis/_tensor_basis.py index f4f83dd2d..833395c2f 100644 --- a/skfda/representation/basis/_tensor_basis.py +++ b/skfda/representation/basis/_tensor_basis.py @@ -180,4 +180,5 @@ def __init__(self, basis_list: Iterable[Basis]): warnings.warn( "The Tensor class is deprecated. Use TensorBasis instead.", DeprecationWarning, + stacklevel=2, ) diff --git a/skfda/representation/basis/_vector_basis.py b/skfda/representation/basis/_vector_basis.py index 8c02af61b..ea5be4bb5 100644 --- a/skfda/representation/basis/_vector_basis.py +++ b/skfda/representation/basis/_vector_basis.py @@ -245,4 +245,5 @@ def __init__(self, basis_list: Iterable[Basis]) -> None: "The VectorValued class is deprecated. " "Use VectorValuedBasis instead.", DeprecationWarning, + stacklevel=2, ) From adb1cd8a8b179a01c4ec8a375a4acfdfae81c89b Mon Sep 17 00:00:00 2001 From: VNMabus Date: Fri, 13 Oct 2023 10:16:31 +0200 Subject: [PATCH 2/7] Small fix in doc. --- skfda/preprocessing/missing/_interpolate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skfda/preprocessing/missing/_interpolate.py b/skfda/preprocessing/missing/_interpolate.py index d09ea07b2..d97dff0d8 100644 --- a/skfda/preprocessing/missing/_interpolate.py +++ b/skfda/preprocessing/missing/_interpolate.py @@ -134,7 +134,7 @@ class MissingValuesInterpolation( For multivariate functions, such as surfaces all dimensions are considered. This is currently done using - :external:class:`~scipy.interpolation.LinearNDInterpolator`, which + :external:class:`~scipy.interpolate.LinearNDInterpolator`, which triangulates the space and performs linear barycentric interpolation: >>> X = FDataGrid( From 23d657102e47e1afd7b9ec42014f804f8b08dc79 Mon Sep 17 00:00:00 2001 From: VNMabus Date: Fri, 13 Oct 2023 10:21:28 +0200 Subject: [PATCH 3/7] Update version. --- skfda/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skfda/__init__.py b/skfda/__init__.py index f9434fa97..47a67be43 100644 --- a/skfda/__init__.py +++ b/skfda/__init__.py @@ -30,4 +30,4 @@ concatenate as concatenate, ) -__version__ = "0.9.dev1" +__version__ = "0.9" From 8789db072bf5dbb1b971454574ef1807b2584396 Mon Sep 17 00:00:00 2001 From: VNMabus Date: Fri, 13 Oct 2023 11:23:54 +0200 Subject: [PATCH 4/7] Update version. --- docs/_static/switcher.json | 2 +- skfda/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_static/switcher.json b/docs/_static/switcher.json index 71b626e80..f4e362095 100644 --- a/docs/_static/switcher.json +++ b/docs/_static/switcher.json @@ -5,7 +5,7 @@ "url": "https://fda.readthedocs.io/en/latest/" }, { - "name": "0.8.1 (stable)", + "name": "0.9 (stable)", "version": "stable", "url": "https://fda.readthedocs.io/en/stable/", "preferred": true diff --git a/skfda/__init__.py b/skfda/__init__.py index 47a67be43..f9434fa97 100644 --- a/skfda/__init__.py +++ b/skfda/__init__.py @@ -30,4 +30,4 @@ concatenate as concatenate, ) -__version__ = "0.9" +__version__ = "0.9.dev1" From 02bee403f1c1111284b24b9ed6654460f796ca5b Mon Sep 17 00:00:00 2001 From: VNMabus Date: Fri, 13 Oct 2023 11:47:57 +0200 Subject: [PATCH 5/7] Remove Python 3.8 support. --- .github/workflows/tests.yml | 2 +- pyproject.toml | 4 ++-- skfda/__init__.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f08ec8d3f..a3cfcd644 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9'] + python-version: ['3.9', '3.10'] steps: - uses: actions/checkout@v2 diff --git a/pyproject.toml b/pyproject.toml index dc5ea6708..97247f3b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "scikit-fda" description = "Functional Data Analysis Python package." readme = "README.rst" -requires-python = ">=3.8" +requires-python = ">=3.9" license = {file = "LICENSE.txt"} keywords = [ "functional data", @@ -20,7 +20,7 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", diff --git a/skfda/__init__.py b/skfda/__init__.py index f9434fa97..ac12bc7f5 100644 --- a/skfda/__init__.py +++ b/skfda/__init__.py @@ -30,4 +30,4 @@ concatenate as concatenate, ) -__version__ = "0.9.dev1" +__version__ = "0.9.1.dev1" From 4ebf2b65e02efd2192c06d5dfa9c4bbc8c4d3e92 Mon Sep 17 00:00:00 2001 From: VNMabus Date: Fri, 13 Oct 2023 12:00:01 +0200 Subject: [PATCH 6/7] Update readthedocs config. --- readthedocs.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/readthedocs.yml b/readthedocs.yml index 2c148156d..47b68f8d7 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -5,6 +5,11 @@ # Required version: 2 +build: + os: ubuntu-22.04 + tools: + python: "3.9" + # Build documentation in the docs/ directory with Sphinx sphinx: builder: html @@ -18,7 +23,6 @@ sphinx: # Optionally set the version of Python and requirements required to build your docs python: - version: "3.8" install: - requirements: readthedocs-requirements.txt - method: pip From d9228519dedc5750b2020fd465309bc1b28baab8 Mon Sep 17 00:00:00 2001 From: VNMabus Date: Fri, 13 Oct 2023 13:22:19 +0200 Subject: [PATCH 7/7] Remove useless requirement files. Optional dependences for building the docs live now in pyproject.toml. --- binder/requirements.txt | 2 +- pyproject.toml | 15 +++++++++++++++ readthedocs-requirements.txt | 14 -------------- readthedocs.yml | 5 +++-- requirements.txt | 7 ------- 5 files changed, 19 insertions(+), 24 deletions(-) delete mode 100644 readthedocs-requirements.txt delete mode 100644 requirements.txt diff --git a/binder/requirements.txt b/binder/requirements.txt index b913cb3e4..9ee80ec8d 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1,4 +1,4 @@ --r ../readthedocs-requirements.txt +scikit-fda[docs] jupytext sphinx-gallery<=0.7.0 . \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 97247f3b5..edf05d3ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,21 @@ dependencies = [ ] [project.optional-dependencies] +docs = [ + "basemap", + "basemap-data", + "basemap-data-hires", + "ipykernel", + "jupyter-sphinx", + "myst-parser", + "pillow", + "pydata-sphinx-theme", + "pytest", + "setuptools>=41.2", + "sphinx>=3", + "sphinx-gallery", + "sphinxcontrib-bibtex", +] test = [ "pytest", "pytest-env", diff --git a/readthedocs-requirements.txt b/readthedocs-requirements.txt deleted file mode 100644 index f646304da..000000000 --- a/readthedocs-requirements.txt +++ /dev/null @@ -1,14 +0,0 @@ --r ./requirements.txt -basemap -basemap-data -basemap-data-hires -ipykernel -Sphinx>=3 -pydata-sphinx-theme -sphinx-gallery -pillow -setuptools>=41.2 -jupyter-sphinx -myst-parser -pytest -sphinxcontrib-bibtex \ No newline at end of file diff --git a/readthedocs.yml b/readthedocs.yml index 47b68f8d7..46689c30d 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -24,6 +24,7 @@ sphinx: # Optionally set the version of Python and requirements required to build your docs python: install: - - requirements: readthedocs-requirements.txt - method: pip - path: . \ No newline at end of file + path: . + extra_requirements: + - docs \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 2a806336a..000000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -matplotlib -numpy -scipy -setuptools -scikit-learn -multimethod>=1.2 -findiff