Skip to content

Conversation

@AayushSabharwal
Copy link
Member

MWE:

julia> Sum(;name=:a, input.nin=2)
ERROR: syntax: invalid keyword argument name "input.nin" around REPL[8]:1
Stacktrace:
 [1] top-level scope
   @ REPL[8]:

julia> @macroexpand @mtkmodel Sum begin
           @components begin
               input = RealInput(; nin)
               output = RealOutput()
           end
           @equations begin
               output.u ~ sum(input.u)
           end
       end
:(Sum = (ModelingToolkit.Model)(((; name, input__nin = nothing)->begin
                  #= /Users/aayush/.julia/packages/ModelingToolkit/xLMQM/src/systems/model_parsing.jl:242 =#
                  begin
                      begin
                          input = RealInput(name = :input; nin = input__nin)
                          output = RealOutput(name = :output)
                      end
                      (ODESystem)((Equation)[output.u ~ sum(input.u)], t, [], []; systems = [input, output], name, gui_metadata = nothing)
                  end
              end), Dict{Symbol, Any}(:components => [[:input, :RealInput], [:output, :RealOutput]], :kwargs => Dict{Symbol, Any}(), :independent_variable => t, :equations => ["output.u ~ sum(input.u)"]), false))

julia> Sum(;name=:a, input__nin=2)
Model a with 1 equations
...

@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Merging #201 (68bd726) into main (a5c2c01) will decrease coverage by 0.32%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #201      +/-   ##
==========================================
- Coverage   56.08%   55.76%   -0.32%     
==========================================
  Files          48       48              
  Lines        1578     1587       +9     
==========================================
  Hits          885      885              
- Misses        693      702       +9     
Impacted Files Coverage Δ
src/Blocks/math.jl 95.00% <ø> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ChrisRackauckas ChrisRackauckas merged commit 5bde835 into SciML:main Jul 22, 2023
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