SciML / SciML/ModelingToolkitStandardLibrary.jl
`Torque` can no longer be instantiated
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 171
- Forks
- 49
- Avg merge
- 15h 50m
- Merged PRs (30d)
- 10
Description
On the new version 2, I can no longer instantiate a Torque component
julia> using ModelingToolkitStandardLibrary.Mechanical.Rotational
julia> @named torque = Torque()
ERROR: TypeError: non-boolean (Nothing) used in boolean context
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/ModelingToolkitStandardLibrary/iihAd/src/Mechanical/Rotational/utils.jl:142 [inlined]
[2] (::ModelingToolkitStandardLibrary.Mechanical.Rotational.var"#14#15"{Nothing})()
@ ModelingToolkitStandardLibrary.Mechanical.Rotational ~/.julia/packages/ModelingToolkit/GFEA2/src/systems/abstractsystem.jl:1172
[3] PartialElementaryOneFlangeAndSupport2(; name::Symbol, use_support::Nothing)
@ ModelingToolkitStandardLibrary.Mechanical.Rotational ~/.julia/packages/ModelingToolkit/GFEA2/src/systems/abstractsystem.jl:1172
[4] (::ModelingToolkitStandardLibrary.Mechanical.Rotational.var"#46#48")(; name::Symbol, use_support::Nothing, partial_element__use_support::Nothing)
@ ModelingToolkitStandardLibrary.Mechanical.Rotational ~/.julia/packages/ModelingToolkit/GFEA2/src/systems/model_parsing.jl:216
[5] (::ModelingToolkit.Model{ModelingToolkitStandardLibrary.Mechanical.Rotational.var"#46#48", Dict{Symbol, Any}})(; kw::Base.Pairs{Symbol, Symbol, Tuple{Symbol}, NamedTuple{(:name,), Tuple{Symbol}}})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/GFEA2/src/systems/model_parsing.jl:5
[6] top-level scope
@ ~/.julia/packages/ModelingToolkit/GFEA2/src/systems/abstractsystem.jl:1006
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing @named torque = Torque() with Julia and inspect src/Mechanical/Rotational/utils.jl around line 142, where the stack trace points. Trace how use_support is handled during Torque() construction; done means the component instantiates successfully without the reported Nothing boolean error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100