State-machine query operators in ModelingToolkitTearing throw UndefVarError for wrap
評価
調査の方向性
The failing query operators are generated by the loop at lib/ModelingToolkitTearing/src/clock_inference/state_machines.jl:71-83; start by reading those methods and the reported wrap error. Check the corresponding tests, since the issue says this file appears uncovered. Done means the four query operators work without UndefVarError; linked pull request #171 is already open.
索引モデルが issue の本文から書いたものです。
説明
Goal
I am adding Modelica-style state machines to SynchToolkit (JuliaComputing/SynchToolkit.jl#252). The state machines are declared with the operators in lib/ModelingToolkitTearing/src/clock_inference/state_machines.jl. Transition conditions and equations refer to the state of a machine through the query operators activeState, ticksInState, timeInState and entry.
What fails
Every method of these four operators throws on ModelingToolkitTearing 1.20.7, and the code on main is the same:
using ModelingToolkit
using ModelingToolkit: t_nounits as t
import ModelingToolkit.MTKTearing as MTKT
@named s1 = System(Equation[], t, [], [])
MTKT.activeState(s1)
ERROR: UndefVarError: `wrap` not defined in `ModelingToolkitTearing`
Suggestion: check for spelling errors or missing imports.
Hint: a global variable of this name also exists in Symbolics.
Stacktrace:
[1] activeState(x::System)
@ ModelingToolkitTearing ~/.julia/packages/ModelingToolkitTearing/gRDNi/src/clock_inference/state_machines.jl:77
The zero-argument methods (ticksInState(), timeInState(), entry()) fail in the same way. transition and initial_state work.
The methods are generated by the loop at state_machines.jl:71-83 and call wrap(term($s, x)). wrap is not exported by Symbolics 7. The file does not appear to be covered by tests.
Workaround
SynchToolkit defines its own activeState, ticksInState, timeInState and entry, which construct the terms with Symbolics.wrap(SymbolicUtils.term(f, s; type, shape)).
Host: demeter2 · Session: https://claude.ai/code/session_01S12pk8C416QqoxphWRcPz8 · Working directory: ~/.julia/dev/SynchToolkit/.claude/worktrees/ancient-waddling-spindle
- 主要言語
- Julia
- スター
- 8
- フォーク
- 14
- 平均マージ
- 8日 8時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaComputing/StateSelection.jl のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
-
Inlined linear SCC of three unknowns: the run-time solve dominates the cost of the right-hand sideオープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
JuliaComputing/StateSelection.jl#173 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
JuliaComputing/StateSelection.jl#172 · コメント 1 件 ·
-
`maybe_zeros` check does not look inside a division, so tearing divides by a parameter expression that is zero (NaN in initialization)対応中かも @mwhincup が 18 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
JuliaComputing/StateSelection.jl#166 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
JuliaComputing/StateSelection.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Sienna-Platform/InfrastructureSystems.jl#675 ·
メンテナーはふだん 2 日以内に返信
-
TargetEncoder reuses the first level's shrinkage factor for all levels when m > 0対応中かも @parth-patel010 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
JuliaAI/MLJTransforms.jl#95 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
SciML/RecursiveArrayTools.jl#687 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
SciML/LinearSolve.jl#1412 ·
メンテナーはふだん 8 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
SciML/Corleone.jl#179 ·
メンテナーはふだん 1 日以内に返信