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

Add _sum for KernelSum{<:AbstractVector} and associated tests #547

Merged
merged 4 commits into from
Feb 8, 2024

Conversation

theogf
Copy link
Member

@theogf theogf commented Feb 6, 2024

Summary
Add the _sum interface for vectors, allowing to use Vector in KernelSum. This is to fix #497

Proposed changes

Add a method for _sum and add the same tests existing for KerrnelSum{<:Tuple} to KernelSum{<:AbstractVector}.

  • ...

What alternatives have you considered?
🤷

Breaking changes
none

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (49049b1) 90.88% compared to head (42316d9) 90.89%.

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.
📢 Have feedback on the report? Share it here.

test/kernels/kernelsum.jl Outdated Show resolved Hide resolved
@@ -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)
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

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.

@theogf theogf merged commit 87623ff into master Feb 8, 2024
18 of 22 checks passed
@theogf theogf deleted the tgf/fix-sum branch February 8, 2024 16:16
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.

KernelSum and KernelProduct with Vector of Kernel fails
2 participants