Skip to content

Conversation

AayushSabharwal
Copy link
Member

Before:

julia> function Foo(; name, p = 1)
           @parameters p = p
           @variables x(t)
           return ODESystem(D(x) ~ p, t; name)
       end
Foo (generic function with 1 method)

julia> function Bar(; name, p = 2)
           @parameters p = p
           @variables x(t)
           @named foo = Foo(; p)
           return ODESystem(D(x) ~ p + t, t; systems = [foo], name)
       end
Bar (generic function with 1 method)

julia> @named bar = Bar()
Model bar with 2 equations
Unknowns (2):
  x(t)
  foo₊x(t)
Parameters (1):
  p [defaults to 2]

After:

julia> @named bar = Bar()
Model bar with 2 equations
Unknowns (2):
  x(t)
  foo₊x(t)
Parameters (2):
  p [defaults to 2]
  foo₊p [defaults to p]

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

@ChrisRackauckas ChrisRackauckas merged commit e9aa6e3 into SciML:master Sep 25, 2024
21 of 25 checks passed
@AayushSabharwal AayushSabharwal deleted the as/scope-discovery branch September 25, 2024 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants