-
Notifications
You must be signed in to change notification settings - Fork 58
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
query
errors when specifying parameters
#939
Comments
query
sometimes errors with AttrTypes
of different Julia typesquery
errors when specifying parameters
Alas, I guess this was not fixed in #923? |
I'm not sure @epatters, in this case, the error occurs when specifying the parameter of a part ID, rather than when using the parameters to specify attributes (which is weird). But in any case, I'll check it out in detail when I have time, making a note of the behavior here. |
Hi @epatters I found out the root cause of the error. The error occurs in this line Catlab.jl/src/wiring_diagrams/Algebras.jl Line 195 in 982ea6e
force is called to compose functions together. Checking it in detail show the following:
Breaking for error:
ERROR: MethodError: no method matching Catlab.CategoricalAlgebra.FinSets.FinDomFunctionVector(::Vector{Real}, ::TypeSet{Union{Float64, Int64}})
Closest candidates are:
Catlab.CategoricalAlgebra.FinSets.FinDomFunctionVector(::V, ::Codom) where {T, V<:AbstractVector{T}, Codom<:SetOb{T}}
@ Catlab ~/Desktop/git/Catlab.jl/src/categorical_algebra/FinSets.jl:267
Catlab.CategoricalAlgebra.FinSets.FinDomFunctionVector(::AbstractVector{T}) where T
@ Catlab ~/Desktop/git/Catlab.jl/src/categorical_algebra/FinSets.jl:276
Catlab.CategoricalAlgebra.FinSets.FinDomFunctionVector(::AbstractVector, ::FinSet{Int64}, ::Any)
@ Catlab ~/Desktop/git/Catlab.jl/src/categorical_algebra/FinSets.jl:279
Stacktrace:
[1] force(f::Catlab.CategoricalAlgebra.Sets.CompositeFunction{Catlab.CategoricalAlgebra.FinSets.FinSetInt, TypeSet{Union{Float64, Int64}}, Catlab.CategoricalAlgebra.Sets.CompositeFunction{Catlab.CategoricalAlgebra.FinSets.FinSetInt, Catlab.CategoricalAlgebra.FinSets.FinSetInt, Catlab.CategoricalAlgebra.Sets.CompositeFunction{Catlab.CategoricalAlgebra.FinSets.FinSetInt, Catlab.CategoricalAlgebra.FinSets.FinSetInt, Catlab.CategoricalAlgebra.Sets.CompositeFunction{Catlab.CategoricalAlgebra.FinSets.FinSetInt, Catlab.CategoricalAlgebra.FinSets.FinSetInt, Catlab.CategoricalAlgebra.Sets.CompositeFunction{Catlab.CategoricalAlgebra.FinSets.FinSetInt, Catlab.CategoricalAlgebra.FinSets.FinSetInt, Catlab.CategoricalAlgebra.Sets.SetFunctionCallable{Int64, Int64, Catlab.CategoricalAlgebra.FinSets.FinSetInt, Catlab.CategoricalAlgebra.FinSets.FinSetInt}, Catlab.CategoricalAlgebra.FinSets.FinDomFunctionVector{Int64, Vector{Int64}, Catlab.CategoricalAlgebra.FinSets.FinSetInt}}, Catlab.CategoricalAlgebra.FinSets.FinDomFunctionVector{Int64, Vector{Int64}, Catlab.CategoricalAlgebra.FinSets.FinSetInt}}, Catlab.CategoricalAlgebra.FinSets.FinDomFunctionVector{Int64, Vector{Int64}, Catlab.CategoricalAlgebra.FinSets.FinSetInt}}, Catlab.CategoricalAlgebra.FinSets.FinDomFunctionVector{Int64, Vector{Int64}, Catlab.CategoricalAlgebra.FinSets.FinSetInt}}, Catlab.CategoricalAlgebra.FinSets.FinDomFunctionVector{Union{Float64, Int64}, Vector{Union{Float64, Int64}}, TypeSet{Union{Float64, Int64}}}})
@ Catlab.CategoricalAlgebra.FinSets ~/Desktop/git/Catlab.jl/src/categorical_algebra/FinSets.jl:295
In force(f) at /Users/wusea/Desktop/git/Catlab.jl/src/categorical_algebra/FinSets.jl:295
>295 force(f::FinDomFunction{Int}) = FinDomFunctionVector(map(f, dom(f)), codom(f))
About to run: <(Catlab.CategoricalAlgebra.FinSets.FinDomFunctionVector)(Real[7, 7, 5, 6.0, 6.0, 6.0], TypeSet(Union{...>
1|julia> f
compose(compose(compose(compose(compose(FinFunction(#58, FinSet(6), FinSet(6)), FinFunction([4, 7, 9, 12, 14, 16], 6, 16)), FinFunction([2, 8, 14, 16, 23, 30, 31, 37, 41, 47, 54, 56, 65, 66, 72, 76], 16, 80)), FinFunction([1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16], 80, 16)), FinFunction([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], 16, 16)), FinDomFunction(Union{Float64, Int64}[7, 6.0, 6.0, 7, 7, 5, 7, 6.0, 5, 5, 7, 6.0, 5, 6.0, 7, 6.0], FinSet(16), TypeSet(Union{Float64, Int64}))) So it seems that when the final composition is called, for some reason the type information of the vector that defines the function being of force(compose(
FinFunction([1,2,2], 3, 4),
FinDomFunction(Union{Float64,Int64}[500, 2.342, 90, 0.342], FinSet(4), TypeSet(Union{Float64,Int64}))
)) One "solution" that works is changing the definition of Catlab.jl/src/categorical_algebra/FinSets.jl Lines 260 to 269 in 982ea6e
FinDomFunctionVector{T,V<:AbstractVector{<:T}, Codom<:SetOb{T}} . But I am not sure if this is a good solution as it reaches quite far into the depths of the software design.
|
query
errors when specifying the parameter (ID of a certain object) when using a union type for anAttrType
in the following schema. OnCatlab v0.16.17
.The text was updated successfully, but these errors were encountered: