Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/rename basis #490

Merged
merged 14 commits into from
Nov 15, 2022
Merged

Feature/rename basis #490

merged 14 commits into from
Nov 15, 2022

Conversation

Ddelval
Copy link
Contributor

@Ddelval Ddelval commented Oct 30, 2022

Closes #488 by renaming the current basis to add "Basis" as a suffix.
Additionally, the current basis classes are marked as deprecated and implemented as subclasses of the renamed one.

@Ddelval Ddelval linked an issue Oct 30, 2022 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Oct 30, 2022

Codecov Report

Base: 85.35% // Head: 85.40% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (966b335) compared to base (7b51542).
Patch coverage: 97.97% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #490      +/-   ##
===========================================
+ Coverage    85.35%   85.40%   +0.04%     
===========================================
  Files          139      139              
  Lines        11064    11100      +36     
===========================================
+ Hits          9444     9480      +36     
  Misses        1620     1620              
Impacted Files Coverage Δ
skfda/inference/hotelling/_hotelling.py 91.66% <ø> (ø)
skfda/misc/_math.py 84.37% <ø> (ø)
skfda/ml/regression/_linear_regression.py 98.07% <ø> (ø)
skfda/preprocessing/dim_reduction/_fpca.py 90.98% <ø> (ø)
.../feature_construction/_coefficients_transformer.py 100.00% <ø> (ø)
...ing/feature_construction/_evaluation_trasformer.py 89.47% <ø> (ø)
...eprocessing/registration/_landmark_registration.py 87.09% <ø> (ø)
...ocessing/registration/_lstsq_shift_registration.py 97.97% <ø> (ø)
skfda/preprocessing/smoothing/_basis.py 100.00% <ø> (ø)
skfda/representation/basis/_fdatabasis.py 80.65% <ø> (ø)
... and 30 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

ordered_evaluated_points = evaluated_points[-2::-1]

# Build the matrix
return scipy.linalg.hankel( # type: ignore[no-any-return]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Unused "type: ignore" comment

skfda/representation/basis/_finite_element_basis.py Outdated Show resolved Hide resolved
skfda/representation/basis/_bspline_basis.py Outdated Show resolved Hide resolved
@@ -278,7 +278,7 @@
##############################################################################
# Here we show the first five elements of a Fourier basis.

basis = skfda.representation.basis.Fourier(n_basis=5)
basis = skfda.representation.basis.FourierBasis(n_basis=5)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "FourierBasis", variable has type "MonomialBasis")

@@ -314,7 +314,7 @@
##############################################################################
# Here we show the first five elements of a B-spline basis.

basis = skfda.representation.basis.BSpline(n_basis=5)
basis = skfda.representation.basis.BSplineBasis(n_basis=5)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "BSplineBasis", variable has type "MonomialBasis")

@@ -365,12 +365,12 @@

fd = skfda.FDataGrid(X)

basis = skfda.representation.basis.Tensor([
skfda.representation.basis.Fourier( # X axis
basis = skfda.representation.basis.TensorBasis([

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "TensorBasis", variable has type "MonomialBasis")

@@ -435,7 +435,7 @@
##############################################################################
# We now represent the digits dataset in this basis.

basis = skfda.representation.basis.FiniteElement(
basis = skfda.representation.basis.FiniteElementBasis(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "FiniteElementBasis", variable has type "MonomialBasis")

@@ -475,12 +475,12 @@
# are now expressed in a Fourier basis, while we express precipitations as
# B-splines.

basis = skfda.representation.basis.VectorValued([
skfda.representation.basis.Fourier( # First coordinate function
basis = skfda.representation.basis.VectorValuedBasis([

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "VectorValuedBasis", variable has type "MonomialBasis")

examples/plot_extrapolation.py Outdated Show resolved Hide resolved
examples/plot_extrapolation.py Outdated Show resolved Hide resolved
examples/plot_fpca.py Outdated Show resolved Hide resolved
examples/plot_fpca.py Outdated Show resolved Hide resolved
@@ -14,7 +14,7 @@
import skfda
from skfda.inference.anova import oneway_anova
from skfda.representation import FDataGrid, FDataBasis
from skfda.representation.basis import Fourier
from skfda.representation.basis import FourierBasis

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pep8] reported by reviewdog 🐶
I005 isort found an unexpected missing import

skfda/tests/test_basis.py Outdated Show resolved Hide resolved
skfda/tests/test_neighbors.py Outdated Show resolved Hide resolved
skfda/tests/test_neighbors.py Outdated Show resolved Hide resolved
skfda/tests/test_neighbors.py Outdated Show resolved Hide resolved
skfda/tests/test_neighbors.py Outdated Show resolved Hide resolved
examples/plot_extrapolation.py Outdated Show resolved Hide resolved
@@ -1,19 +1,13 @@
from __future__ import annotations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it is better that the renamed classes live in the same module as the older ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I tried that at first, but I had some issues with Sphinx when trying to generate the documentation. When I moved the old classes into their own files, it worked, but it seems that those issues were caused by a mistake I fixed without noticing. It does seem to generate the documentation correctly with the old classes in the same files now.

@@ -278,7 +278,7 @@
##############################################################################
# Here we show the first five elements of a Fourier basis.

basis = skfda.representation.basis.Fourier(n_basis=5)
basis = skfda.representation.basis.FourierBasis(n_basis=5)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "FourierBasis", variable has type "MonomialBasis") [assignment]

@@ -314,7 +314,7 @@
##############################################################################
# Here we show the first five elements of a B-spline basis.

basis = skfda.representation.basis.BSpline(n_basis=5)
basis = skfda.representation.basis.BSplineBasis(n_basis=5)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "BSplineBasis", variable has type "MonomialBasis") [assignment]

@@ -365,12 +365,12 @@

fd = skfda.FDataGrid(X)

basis = skfda.representation.basis.Tensor([
skfda.representation.basis.Fourier( # X axis
basis = skfda.representation.basis.TensorBasis([

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "TensorBasis", variable has type "MonomialBasis") [assignment]

@@ -435,7 +435,7 @@
##############################################################################
# We now represent the digits dataset in this basis.

basis = skfda.representation.basis.FiniteElement(
basis = skfda.representation.basis.FiniteElementBasis(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "FiniteElementBasis", variable has type "MonomialBasis") [assignment]

@@ -475,12 +475,12 @@
# are now expressed in a Fourier basis, while we express precipitations as
# B-splines.

basis = skfda.representation.basis.VectorValued([
skfda.representation.basis.Fourier( # First coordinate function
basis = skfda.representation.basis.VectorValuedBasis([

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "VectorValuedBasis", variable has type "MonomialBasis") [assignment]

# **References:**
#
# [1] Antonio Cuevas, Manuel Febrero-Bande, and Ricardo Fraiman. "An anova test
# for functional data". *Computational Statistics Data Analysis*,
# [1] Antonio Cuevas, Manuel Febrero-Bande, and Ricardo Fraiman. "An anova

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pep8] reported by reviewdog 🐶
W291 trailing whitespace



class FiniteElement(FiniteElementBasis):
"""Finite element basis.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pep8] reported by reviewdog 🐶
D208 Docstring is over-indented

skfda/representation/basis/_bspline_basis.py Outdated Show resolved Hide resolved
skfda/representation/basis/_bspline_basis.py Outdated Show resolved Hide resolved
skfda/representation/basis/_bspline_basis.py Outdated Show resolved Hide resolved
skfda/representation/basis/_bspline_basis.py Outdated Show resolved Hide resolved
skfda/representation/basis/_bspline_basis.py Outdated Show resolved Hide resolved
skfda/representation/basis/_tensor_basis.py Outdated Show resolved Hide resolved
skfda/representation/basis/_tensor_basis.py Outdated Show resolved Hide resolved
skfda/representation/basis/_vector_basis.py Outdated Show resolved Hide resolved
skfda/representation/basis/_vector_basis.py Outdated Show resolved Hide resolved
skfda/representation/basis/_vector_basis.py Outdated Show resolved Hide resolved
@vnmabus vnmabus merged commit aee15f4 into develop Nov 15, 2022
@vnmabus vnmabus deleted the feature/renameBasis branch August 17, 2023 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename basis to add Basis suffix
2 participants