Skip to content

Some ODESystem fields such as metadata are lost when using the extend function #2502

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

Closed
avinashresearch1 opened this issue Feb 27, 2024 · 0 comments · Fixed by #2867
Closed
Labels
bug Something isn't working

Comments

@avinashresearch1
Copy link
Contributor

Minimal Reproducible Example 👇

julia> @named sys1 = ODESystem(Equation[],t, [],[]; metadata = Dict(:a => 2))
Model sys1 with 0 equations
States (0):
Parameters (0):

julia> @named sys2 = ODESystem(Equation[],t, [],[])
Model sys2 with 0 equations
States (0):
Parameters (0):

julia> sys_extend = extend(sys1, sys2)
Model sys1 with 0 equations
States (0):
Parameters (0):

julia> sys_extend.metadata

julia> sys1.metadata
Dict{Symbol, Int64} with 1 entry:
  :a => 2

Expected behavior
One would expect to retain the metadata in the extended system

Environment

[49dc2e85] Calculus v0.5.1
  [0c46a032] DifferentialEquations v7.12.0
⌅ [961ee093] ModelingToolkit v8.75.0
⌃ [16a59e39] ModelingToolkitStandardLibrary v2.3.4
  [2774e3e8] NLsolve v4.5.1
⌃ [1dea7af3] OrdinaryDiffEq v6.70.1
  [91a5bcdd] Plots v1.40.1
  [189a3867] Reexport v1.2.2
  [1bc83da4] SafeTestsets v0.1.0
⌃ [0bca4576] SciMLBase v2.24.0
  [efcf1570] Setfield v1.1.1
⌃ [2efcf032] SymbolicIndexingInterface v0.3.5
  [d1185830] SymbolicUtils v1.5.0
⌃ [0c5d862f] Symbolics v5.17.0
  [3a884ed6] UnPack v1.0.2
  [37e2e46d] LinearAlgebra
  [2f01184e] SparseArrays v1.10.0
@avinashresearch1 avinashresearch1 added the bug Something isn't working label Feb 27, 2024
@hersle hersle mentioned this issue Jul 17, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant