Skip to content
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

changed ParentScope docs to better reflect best usage #2219

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions docs/src/basics/Composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,15 @@ In a hierarchical system, variables of the subsystem get namespaced by the name

```julia
@parameters t a b c d e f
p = [a #a is a local variable
ParentScope(b) # b is a variable that belongs to one level up in the hierarchy
ParentScope(ParentScope(c))# ParentScope can be nested
DelayParentScope(d) # skips one level before applying ParentScope
DelayParentScope(e, 2) # second argument allows skipping N levels
GlobalScope(f)]

# a is a local variable
b = ParentScope(b) # b is a variable that belongs to one level up in the hierarchy
c = ParentScope(ParentScope(c)) # ParentScope can be nested
d = DelayParentScope(d) # skips one level before applying ParentScope
e = DelayParentScope(e, 2) # second argument allows skipping N levels
f = GlobalScope(f)

p = [a, b, c, d, e, f]

level0 = ODESystem(Equation[], t, [], p; name = :level0)
level1 = ODESystem(Equation[], t, [], []; name = :level1) ∘ level0
Expand Down
Loading