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

Investigate failure on latest ODE deps #2075

Closed
visr opened this issue Feb 17, 2025 · 2 comments · Fixed by #2083
Closed

Investigate failure on latest ODE deps #2075

visr opened this issue Feb 17, 2025 · 2 comments · Fixed by #2083
Labels
core Issues related to the computational core in Julia dependencies Pull requests that update a dependency file tech-debt Improvements related to technical debt

Comments

@visr
Copy link
Member

visr commented Feb 17, 2025

#2070 needed a2d39f4 before it could be merged. Whilst the error message involves a MethodError for reshape of a ComponentVector, it doesn't seem related to recent ComponentArray changes, as found in 211501b. Moving back from LinearSolve 3 to 2 brings many packages back, but allowed us to merge #2070. We can try again later and if it still happens try to find the reason and report upstream.

MethodError: no method matching  reshape(::Vector{Int64}, ::Tuple{ComponentArrays.CombinedAxis{ComponentArrays.Axis{(tabulated_rating_curve = 1:3, pump = 4:4, outlet = 5:4, user_demand_inflow = 5:4, user_demand_outflow = 5:4, linear_resistance = 5:6, manning_resistance = 7:7, evaporation = 8:11, infiltration = 12:15, integral = 16:15)}, Base.OneTo{Int64}}})\nThe function `reshape` exists, but no method is defined for this combination of argument types
@visr visr added core Issues related to the computational core in Julia dependencies Pull requests that update a dependency file tech-debt Improvements related to technical debt labels Feb 17, 2025
@github-project-automation github-project-automation bot moved this to To do in Ribasim Feb 17, 2025
@visr
Copy link
Member Author

visr commented Feb 19, 2025

Here is a stacktrace. It does seem ComponentArrays related, so I expect #2077 to help this as well.

This reshape fails because ComponentArrays returns custom axes(x) which don't have a method it seems.

https://github.com/JuliaDiff/FiniteDiff.jl/blob/a7eca2d4b73c4de12140d89df7621fcc90d29190/src/jacobians.jl#L422

ERROR: MethodError: no method matching reshape(::Vector{Int64}, ::Tuple{ComponentArrays.CombinedAxis{ComponentArrays.Axis{…}, Base.OneTo{…}}})
The function `reshape` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  reshape(::Array{T, M}, ::NTuple{N, Int64}) where {T, N, M}
   @ Base reshapedarray.jl:40
  reshape(::AbstractArray, ::Tuple{Vararg{Union{Colon, Int64}}})
   @ Base reshapedarray.jl:129
  reshape(::AbstractArray, ::NTuple{N, Int64} where N)
   @ Base reshapedarray.jl:122
  ...

Stacktrace:
  [1] reshape(parent::Vector{Int64}, dims::ComponentArrays.CombinedAxis{ComponentArrays.Axis{…}, Base.OneTo{…}})
    @ Base .\reshapedarray.jl:120
  [2] finite_difference_jacobian!(J::SparseArrays.SparseMatrixCSC{…}, f::SciMLBase.UJacobianWrapper{…}, x::ComponentArrays.ComponentVector{…}, cache::FiniteDiff.JacobianCache{…}, f_in::ComponentArrays.ComponentVector{…}; relstep::Float64, absstep::Float64, colorvec::Vector{…}, sparsity::SparseArrays.SparseMatrixCSC{…}, dir::Int64)
    @ FiniteDiff a:\.julia\packages\FiniteDiff\EBPBu\src\jacobians.jl:419
  [3] jacobian_finitediff_forward!(J::SparseArrays.SparseMatrixCSC{…}, f::Function, x::ComponentArrays.ComponentVector{…}, jac_config::FiniteDiff.JacobianCache{…}, forwardcache::ComponentArrays.ComponentVector{…}, integrator::OrdinaryDiffEqCore.ODEIntegrator{…})
    @ OrdinaryDiffEqDifferentiation a:\.julia\packages\OrdinaryDiffEqDifferentiation\6Bzim\src\derivative_wrappers.jl:219

@visr
Copy link
Member Author

visr commented Feb 20, 2025

This MethodError is fixed by SciML/ComponentArrays.jl#295. I made #2083 to check if that is enough to update the other packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues related to the computational core in Julia dependencies Pull requests that update a dependency file tech-debt Improvements related to technical debt
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant