Skip to content

Commit 3f1c730

Browse files
committed
try adding a parent field
1 parent 3605672 commit 3f1c730

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/reactionsystem.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,16 @@ struct ReactionSystem{V <: NetworkProperties} <:
325325
complete: if a model `sys` is complete, then `sys.x` no longer performs namespacing.
326326
"""
327327
complete::Bool
328+
"""
329+
The hierarchical parent system before simplification that MTK now seems to require for
330+
hierarchical namespacing to work in indexing.
331+
"""
332+
parent::Any
328333

329334
# inner constructor is considered private and may change between non-breaking releases.
330335
function ReactionSystem(eqs, rxs, iv, sivs, unknowns, spcs, ps, var_to_name, observed,
331336
name, systems, defaults, connection_type, nps, cls, cevs, devs,
332-
metadata = nothing, complete = false; checks::Bool = true)
337+
metadata = nothing, complete = false, parent = nothing; checks::Bool = true)
333338

334339
# Checks that all parameters have the appropriate Symbolics type.
335340
for p in ps
@@ -358,7 +363,7 @@ struct ReactionSystem{V <: NetworkProperties} <:
358363
rs = new{typeof(nps)}(
359364
eqs, rxs, iv, sivs, unknowns, spcs, ps, var_to_name, observed,
360365
name, systems, defaults, connection_type, nps, cls, cevs,
361-
devs, metadata, complete)
366+
devs, metadata, complete, parent)
362367
checks && validate(rs)
363368
rs
364369
end

0 commit comments

Comments
 (0)