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

MethodError in examples. #30

Closed
KBodolai opened this issue May 20, 2024 · 2 comments
Closed

MethodError in examples. #30

KBodolai opened this issue May 20, 2024 · 2 comments

Comments

@KBodolai
Copy link

Tying to the JOSS Review: openjournals/joss-reviews#6605.

I've been going through the examples, I had no issue with the example in the home section of the docs, but when I try to run the linear system and the Lotka-Volterra example, I get the following error when running:

@named constraint_system = ConstraintSystem(constraint_equations, optimization_variables, [])
ERROR: MethodError: vcat(::ComponentArrays.ComponentVector{Num, Vector{Num}, Tuple{ComponentArrays.Axis{(controls = 1:0, initial_conditions = 1:0, measurements = ViewAxis(1:10, Axis(w₁ = 1:10,)), regularization = 11)}}}, ::Vector{Any}) is ambiguous.

Candidates:
  vcat(V::AbstractVector...)
    @ Base abstractarray.jl:1616
  vcat(A::AbstractVecOrMat...)
    @ Base abstractarray.jl:1678
  vcat(A::Union{Number, AbstractVecOrMat}...)
    @ Base abstractarray.jl:1990
  vcat(A::Union{LinearAlgebra.UniformScaling, AbstractVecOrMat}...)
    @ LinearAlgebra ~/julia-1.9.0/share/julia/stdlib/v1.9/LinearAlgebra/src/uniformscaling.jl:411
  vcat(A::Union{Number, LinearAlgebra.UniformScaling, AbstractVecOrMat}...)
    @ LinearAlgebra ~/julia-1.9.0/share/julia/stdlib/v1.9/LinearAlgebra/src/uniformscaling.jl:413
  vcat(A::AbstractArray, B::AbstractArray)
    @ Base abstractarray.jl:1988
  vcat(A::AbstractArray...)
    @ Base abstractarray.jl:1989
  vcat(x::ComponentArrays.ComponentVector{<:Number}, args...)
    @ ComponentArrays ~/.julia/packages/ComponentArrays/pJerZ/src/array_interface.jl:61

Possible fix, define
  vcat(::ComponentArrays.ComponentVector{<:Number}, ::AbstractVector)

Stacktrace:
 [1] _
   @ ~/.julia/packages/ModelingToolkit/oIgbi/src/systems/optimization/constraints_system.jl:80 [inlined]
 [2] ConstraintsSystem
   @ ~/.julia/packages/ModelingToolkit/oIgbi/src/systems/optimization/constraints_system.jl:73 [inlined]
 [3] ConstraintsSystem(constraints::Vector{Inequality}, states::ComponentArrays.ComponentVector{Num, Vector{Num}, Tuple{ComponentArrays.Axis{(controls = 1:0, initial_conditions = 1:0, measurements = ViewAxis(1:10, Axis(w₁ = 1:10,)), regularization = 11)}}}, ps::Vector{Any}; observed::Vector{Any}, name::Symbol, default_u0::Dict{Any, Any}, default_p::Dict{Any, Any}, defaults::Dict{Any, Any}, systems::Vector{ConstraintsSystem}, connector_type::Nothing, continuous_events::Nothing, discrete_events::Nothing, checks::Bool, metadata::Nothing)
   @ ModelingToolkit ~/.julia/packages/ModelingToolkit/oIgbi/src/systems/optimization/constraints_system.jl:132
 [4] top-level scope
   @ ~/.julia/packages/ModelingToolkit/oIgbi/src/systems/abstractsystem.jl:1003

This comes from a new installation of Julia, following the installation steps and running the examples as presented in the docs. I'll have some more time to inspect the issue later this week, but in the meantime, any idea of what may be causing this?

Cheers,
K.

@AlCap23
Copy link
Member

AlCap23 commented May 21, 2024

Thanks @KBodolai !

Yes, this is a missing Num[] in the ConstraintSystem and it seems I forgot to update the docs accordingly 😅 .

@AlCap23
Copy link
Member

AlCap23 commented May 21, 2024

It seems there is an error in the docs build. The PR #31 updated the docs, but it did not get published.

@AlCap23 AlCap23 closed this as completed May 22, 2024
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

No branches or pull requests

2 participants