-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
feat!: do not scalarize parameters, fix some tests #2469
feat!: do not scalarize parameters, fix some tests #2469
Conversation
368b5e1
to
2447c8d
Compare
2447c8d
to
99b259c
Compare
1b028d5
to
c076e60
Compare
format |
c076e60
to
2a9204f
Compare
JuliaFormatter is getting updated a lot recently |
I have the same version of JuliaFormatter as CI, but locally it doesn't complain and here it does? |
220d6c3
to
decfb51
Compare
Co-authored-by: Aayush Sabharwal <[email protected]>
60396c3
to
812e004
Compare
src/systems/diffeqs/odesystem.jl
Outdated
@assert all(control -> any(isequal.(control, ps)), controls) "All controls must also be parameters." | ||
|
||
deqs = reduce(vcat, scalarize(deqs); init = Equation[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never scalarize during construction for MTKv9. We should just follow what I did in #2472
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If one wants a scalarized system for simulation, then one needs to call structural_simplify
.
!istree(O) && return vars | ||
if operation(O) === (getindex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want structural_simplify
to work correctly, we have to differentiate x
and x[1]
alone. https://github.com/SciML/ModelingToolkit.jl/pull/2472/files#diff-47c27891e951c8cd946b850dc2df31082624afdf57446c21cb6992f5f4b74aa2R351-R369 has the correct implementation
a84ee9c
to
1275d6e
Compare
All tests pass locally 🎉 v9 is good to go (after JuliaSymbolics/Symbolics.jl#1057 is fixed) |
@@ -232,7 +232,7 @@ end | |||
|
|||
function collect_defaults!(defs, vars) | |||
for v in vars | |||
(haskey(defs, v) || !hasdefault(v)) && continue | |||
(haskey(defs, v) || !hasdefault(unwrap(v))) && continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should v
ever be wrapped? It will be a pretty hard to catch bug.
We should bound Symbolics to be at least |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.