-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add _sum
for KernelSum{<:AbstractVector}
and associated tests
#547
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #547 +/- ##
=======================================
Coverage 90.88% 90.89%
=======================================
Files 52 52
Lines 1459 1460 +1
=======================================
+ Hits 1326 1327 +1
Misses 133 133 ☔ View full report in Codecov by Sentry. |
@@ -45,6 +45,7 @@ Base.length(k::KernelSum) = length(k.kernels) | |||
|
|||
_sum(f, ks::Tuple, args...) = f(first(ks), args...) + _sum(f, Base.tail(ks), args...) | |||
_sum(f, ks::Tuple{Tx}, args...) where {Tx} = f(only(ks), args...) | |||
_sum(f, ks::AbstractVector, args...) = sum(k -> f(k, args...), ks) |
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.
Codecov says the line is not covered by tests?
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.
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.
Strange, the Github annotation was complaining about this line.
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.
I can still see it here: https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/pull/547/files
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.
But I trust the codecov webpage more, maybe the annotation is just outdated.
Summary
Add the
_sum
interface for vectors, allowing to useVector
inKernelSum
. This is to fix #497Proposed changes
Add a method for
_sum
and add the same tests existing forKerrnelSum{<:Tuple}
toKernelSum{<:AbstractVector}
.What alternatives have you considered?
🤷
Breaking changes
none