-
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hopefully num->BasicSymbolic for states
- Loading branch information
1 parent
4647656
commit 9262249
Showing
2 changed files
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -627,7 +627,7 @@ function namespace_expr(O, sys, n = nameof(sys); ivs = independent_variables(sys | |
O | ||
end | ||
end | ||
|
||
_nonum(@nospecialize x) = x isa Num ? x.val : x | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
chriselrod
Author
Contributor
|
||
function states(sys::AbstractSystem) | ||
sts = get_states(sys) | ||
systems = get_systems(sys) | ||
|
@@ -637,9 +637,13 @@ function states(sys::AbstractSystem) | |
system_states = reduce(vcat, namespace_variables.(systems)) | ||
isempty(sts) ? system_states : [sts; system_states] | ||
end | ||
isempty(nonunique_states) && return nonunique_states | ||
# `Vector{Any}` is incompatible with the `SymbolicIndexingInterface`, which uses | ||
# `elsymtype = symbolic_type(eltype(_arg))` | ||
# which inappropriately returns `NotSymbolic()` | ||
if nonunique_states isa Vector{Any} | ||
nonunique_states = _nonum.(nonunique_states) | ||
end | ||
@assert typeof(nonunique_states) !== Vector{Any} | ||
unique(nonunique_states) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is Symbolics.unwrap, but we shouldn't be unwrapping in states because then they won't act as numbers or be == to what the user defined.