GAA-UAM / scikit-fda

Functional Data Analysis Python package
https://fda.readthedocs.io
BSD 3-Clause "New" or "Revised" License
309 stars 58 forks source link

Fix inner product integrate #522

Closed m5signorini closed 1 year ago

m5signorini commented 1 year ago

Currently, when doing the inner product between different types of functional data objects (for example, between FDataGrid and FDataBasis) if the functions are multivariate, then the product fails.

This is an error that occurs when using the method _inner_product_integrate, which is not usually called when dealing with the same types of functional objects. However, when using general Callable objects or when mixing types, it is called; failing when dealing with more than one variable.

This pull request aims to solve this issue while adding a new test for the inner_product. This test ensures that the product is correctly calculated between FDataGrid and FDataBasis objects.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 :tada:

Comparison is base (d5efb95) 85.63% compared to head (b6b7bb1) 85.66%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #522 +/- ## =========================================== + Coverage 85.63% 85.66% +0.02% =========================================== Files 143 143 Lines 11384 11397 +13 =========================================== + Hits 9749 9763 +14 + Misses 1635 1634 -1 ``` | [Impacted Files](https://codecov.io/gh/GAA-UAM/scikit-fda/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM) | Coverage Δ | | |---|---|---| | [skfda/misc/\_math.py](https://codecov.io/gh/GAA-UAM/scikit-fda/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvbWlzYy9fbWF0aC5weQ==) | `84.49% <100.00%> (+0.12%)` | :arrow_up: | | [skfda/tests/test\_math.py](https://codecov.io/gh/GAA-UAM/scikit-fda/pull/522?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvdGVzdHMvdGVzdF9tYXRoLnB5) | `98.71% <100.00%> (+0.23%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://codecov.io/gh/GAA-UAM/scikit-fda/pull/522/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.