I noticed a slight inconsistency:
Retract often does pass down kwargs, inverse_retract as well, but exp, exp_fused, retract_fused (!), nor log seem to, for example in decorators or throughout the levels.
On the other hand we have
- a log that has keywords, cf. https://github.com/JuliaManifolds/Manifolds.jl/blob/89453904dc4870d171d588aec2219cd12d2c0f2a/src/manifolds/StiefelSubmersionMetric.jl#L183-L210
- we have a separate retraction with keywords stored
|
""" |
|
RetractionWithKeywords{R<:AbstractRetractionMethod,K} <: AbstractRetractionMethod |
|
|
|
Since retractions might have keywords, this type is a way to set them as an own type to be |
|
used as a specific retraction. |
|
Another reason for this type is that we dispatch on the retraction first and only the |
|
last layer would be implemented with keywords, so this way they can be passed down. |
|
|
|
## Fields |
|
|
|
* `retraction` the retraction that is decorated with keywords |
|
* `kwargs` the keyword arguments |
|
|
|
Note that you can nest this type. Then the most outer specification of a keyword is used. |
|
|
|
## Constructor |
|
|
|
RetractionWithKeywords(m::T; kwargs...) where {T <: AbstractRetractionMethod} |
|
|
|
Specify the subtype `T <: `[`AbstractRetractionMethod`](@ref) to have keywords `kwargs...`. |
|
""" |
|
struct RetractionWithKeywords{T <: AbstractRetractionMethod, K} <: AbstractRetractionMethod |
|
retraction::T |
|
kwargs::K |
|
end |
|
function RetractionWithKeywords(m::T; kwargs...) where {T <: AbstractRetractionMethod} |
|
return RetractionWithKeywords{T, typeof(kwargs)}(m, kwargs) |
|
end |
maybe for placed where they were not passed down
How can we best unify this?
Always passing down keywords is maybe a bit imprecise and one might “loose keywords” and not recognise they stayed unused?
Maybe the log above is not a log but an approximate log (we do not yet have a type for that) - and we could omit all “pass down of keywords” if we would be more strict with the second type linked.
What are your thoughts?
I noticed a slight inconsistency:
Retract often does pass down
kwargs,inverse_retractas well, butexp,exp_fused,retract_fused(!), norlogseem to, for example in decorators or throughout the levels.On the other hand we have
ManifoldsBase.jl/src/retractions.jl
Lines 88 to 115 in 9906efa
How can we best unify this?
Always passing down keywords is maybe a bit imprecise and one might “loose keywords” and not recognise they stayed unused?
Maybe the log above is not a log but an approximate log (we do not yet have a type for that) - and we could omit all “pass down of keywords” if we would be more strict with the second type linked.
What are your thoughts?