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
Deprecate implicit obsdim
keyword argument and improve tests
#264
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Codecov Report
@@ Coverage Diff @@
## master #264 +/- ##
=======================================
Coverage 97.88% 97.88%
=======================================
Files 10 10
Lines 379 379
=======================================
Hits 371 371
Misses 8 8
Continue to review full report at Codecov.
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@@ -36,6 +30,11 @@ end | |||
Base.length(f::FiniteGP) = length(f.x) | |||
|
|||
(f::AbstractGP)(x...) = FiniteGP(f, x...) | |||
function (f::AbstractGP)( | |||
X::AbstractMatrix, args...; obsdim::Union{Int,Nothing}=KernelFunctions.defaultobs |
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.
why the args...
instead of sigma^2
here?
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.
To capture all possible arguments (if someone decides to create some other internal FiniteGP
constructors) and to not have to worry about default values of some arguments. Similar to what we do in KernelFunctions, with this PR we just forward everything to the vector case and handle arguments, default values, etc. there.
@@ -36,6 +30,11 @@ end | |||
Base.length(f::FiniteGP) = length(f.x) | |||
|
|||
(f::AbstractGP)(x...) = FiniteGP(f, x...) |
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.
Should it be
(f::AbstractGP)(x...) = FiniteGP(f, x...) | |
(f::AbstractGP)(x...; kwargs...) = FiniteGP(f, x...; kwargs...) |
or is it done automatically?
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.
No, it isn't done automatically (and hence one can't change obsdim
with the official API - but this is not tested either...). However, since FiniteGP
does not accept keyword arguments it is not really needed currently after applying the fixes and dispatches in this PR.
Just need another patch bump |
Done 🙂 |
Pendant to JuliaGaussianProcesses/KernelFunctions.jl#429.
The PR
obsdim
keyword argument such that the new defaultnothing
in KernelFunctions worksAbstractMatrix
handling to the user-facing API such that internally one only has to deal with vectors such asColVecs
andRowVecs
obsdim
keyword argumentFixes #257. Alternative to #260.