-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix inner product integrate #522
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ 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
... and 1 file with indirect coverage changes 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 in Codecov by Sentry. |
skfda/misc/_math.py
Outdated
f1 = arg1(args)[:, 0, :] | ||
f2 = arg2(args)[:, 0, :] | ||
def integrand(*args: NDArrayFloat) -> NDArrayFloat: # noqa: WPS430 | ||
f_args = cast(NDArrayFloat, args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use np.asarray
instead.
skfda/tests/test_math.py
Outdated
np.testing.assert_allclose( | ||
skfda.misc.inner_product(fd, fd_basis), | ||
res, | ||
rtol=1e-4, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the actual tolerance? Can we put a lower rtol
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minimum tolerance for this test is of order 1e-14. It has been updated.
…UAM/scikit-fda into fix/inner_product_integrate
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 betweenFDataGrid
andFDataBasis
objects.