We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a207913 commit 180ec8bCopy full SHA for 180ec8b
src/systems/abstractsystem.jl
@@ -420,7 +420,13 @@ Base.@deprecate default_p(x) defaults(x) false
420
function defaults(sys::AbstractSystem)
421
systems = get_systems(sys)
422
defs = get_defaults(sys)
423
- isempty(systems) ? defs : mapreduce(namespace_defaults, merge, systems; init=defs)
+ # `mapfoldr` is really important!!! We should prefer the base model for
424
+ # defaults, because people write:
425
+ #
426
+ # `compose(ODESystem(...; defaults=defs), ...)`
427
428
+ # Thus, right associativity is required and crucial for correctness.
429
+ isempty(systems) ? defs : mapfoldr(namespace_defaults, merge, systems; init=defs)
430
end
431
432
states(sys::AbstractSystem, v) = renamespace(sys, v)
0 commit comments