Skip to content

Commit

Permalink
Extend system descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
hersle committed Oct 20, 2024
1 parent ffc43d2 commit 428bc8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2972,12 +2972,13 @@ function extend(sys::AbstractSystem, basesys::AbstractSystem; name::Symbol = nam
cevs = union(get_continuous_events(basesys), get_continuous_events(sys))
devs = union(get_discrete_events(basesys), get_discrete_events(sys))
defs = merge(get_defaults(basesys), get_defaults(sys)) # prefer `sys`
desc = join(filter(desc -> !isempty(desc), get_description.([sys, basesys])), " ") # concatenate non-empty descriptions with space
meta = union_nothing(get_metadata(basesys), get_metadata(sys))
syss = union(get_systems(basesys), get_systems(sys))
args = length(ivs) == 0 ? (eqs, sts, ps) : (eqs, ivs[1], sts, ps)
kwargs = (parameter_dependencies = dep_ps, observed = obs, continuous_events = cevs,
discrete_events = devs, defaults = defs, systems = syss, metadata = meta,
name = name, gui_metadata = gui_metadata)
name = name, description = desc, gui_metadata = gui_metadata)

# collect fields specific to some system types
if basesys isa ODESystem
Expand Down

0 comments on commit 428bc8d

Please sign in to comment.