Skip to content

Commit

Permalink
Add the ignore dictionary and test it prototypically on one function.
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertuer committed Nov 30, 2024
1 parent 6cc6ce0 commit d5712ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/ValidationManifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ Generate the Validation manifold
is associated with. This can be useful for debugging purposes.
* `ignores=Dict{Union{Function,Symbol},Union{Symbol,Bool}()` a dictionary of disabled checks
"""
struct ValidationManifold{𝔽,M<:AbstractManifold{𝔽},D<:Dict{<:Union{Symbol, Function},Union{Bool, Vector{Symbol}}}} <: AbstractDecoratorManifold{𝔽}
struct ValidationManifold{
𝔽,
M<:AbstractManifold{𝔽},
D<:Dict{<:Union{Symbol,Function},Union{Bool,Vector{Symbol}}},
} <: AbstractDecoratorManifold{𝔽}
manifold::M
mode::Symbol
store_base_point::Bool
Expand All @@ -63,8 +67,8 @@ function ValidationManifold(
M::AbstractManifold;
error::Symbol = :error,
store_base_point::Bool = false,
ignore::D=Dict{Union{Symbol, Function},Union{Bool, Vector{Sumbol}}}(),
)
ignore::D = Dict{Union{Symbol,Function},Union{Bool,Vector{Symbol}}}(),
) where {D<:Dict{<:Union{Symbol,Function},<:Union{Bool,Vector{Symbol}}}}
return ValidationManifold(M, error, store_base_point, ignore)
end

Expand All @@ -85,7 +89,7 @@ Otherwise the test is active.
This function is internal and used very often, co it has a very short name;
`_vMc` stands for "`ValidationManifold` check".
"""
function _vMc(f::Function, type::Symbol dict)
function _vMc(f::Function, type::Symbol, dict)
(haskey(dict, type) && !dict[type]) && return false
(haskey(dict, f)) && (type dict[f]) && return false
return true

Check warning on line 95 in src/ValidationManifold.jl

View check run for this annotation

Codecov / codecov/patch

src/ValidationManifold.jl#L92-L95

Added lines #L92 - L95 were not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion test/validation_manifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ end
end
@testset "Types and Conversion" begin
@test convert(typeof(M), A) == M
@test convert(typeof(A), M) == A
@test_broken convert(typeof(A), M) == A
@test base_manifold(A) == M
@test base_manifold(base_manifold(A)) == base_manifold(A)
@test ManifoldsBase.representation_size(A) == ManifoldsBase.representation_size(M)
Expand Down

0 comments on commit d5712ca

Please sign in to comment.