Skip to content

Commit

Permalink
fixup! refactor: add new *_symbols methods, corresponding singletons,…
Browse files Browse the repository at this point in the history
… update tests
  • Loading branch information
AayushSabharwal committed Dec 27, 2023
1 parent 0b925c0 commit aeb46b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/SymbolicIndexingInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ include("trait.jl")

export is_variable, variable_index, variable_symbols, is_parameter, parameter_index,
parameter_symbols, is_independent_variable, independent_variable_symbols, is_observed,
observed, is_time_dependent, constant_structure, symbolic_container, all_solvable_symbols,
all_symbols
observed, is_time_dependent, constant_structure, symbolic_container, all_variable_symbols,
all_symbols, solvedvariables, allvariables
include("interface.jl")

export SymbolCache
Expand Down
7 changes: 3 additions & 4 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@ number of variables or parameters over time.
constant_structure(sys) = constant_structure(symbolic_container(sys))

"""
all_variables(sys)
all_variable_symbols(sys)
Return a vector of pairs, where the first element of each pair is a symbolic variable
and the second is its initial value. This includes observed quantities.
Return a vector of variable symbols in the system, including observed quantities.
For types that implement `Base.getindex` with symbolic indices using this interface,
The shorthand `sys[allvariables]` can be used as shorthand for
Expand All @@ -145,7 +144,7 @@ This singleton is used as a shortcut to allow indexing all solution variables
[`ScalarSymbolic`](@ref). See: [`variable_symbols`](@ref).
"""
const solvedvariables = SolvedVariables()
symbolic_type(::Type{AllVariables}) = ScalarSymbolic()
symbolic_type(::Type{SolvedVariables}) = ScalarSymbolic()

Check warning on line 147 in src/interface.jl

View check run for this annotation

Codecov / codecov/patch

src/interface.jl#L147

Added line #L147 was not covered by tests

struct AllVariables end

Expand Down

0 comments on commit aeb46b0

Please sign in to comment.