Skip to content

Commit 7c2c81e

Browse files
committed
fix formatting, expand docstring
1 parent fdcad91 commit 7c2c81e

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/ModelingToolkit.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ using PrecompileTools, Reexport
3535
using RecursiveArrayTools
3636

3737
using SymbolicIndexingInterface
38-
export independent_variables, unknowns, parameters, full_parameters, continuous_events, discrete_events
38+
export independent_variables, unknowns, parameters, full_parameters, continuous_events,
39+
discrete_events
3940
import SymbolicUtils
4041
import SymbolicUtils: istree, arguments, operation, similarterm, promote_symtype,
4142
Symbolic, isadd, ismul, ispow, issym, FnType,

src/systems/callbacks.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,12 @@ function namespace_callback(cb::SymbolicContinuousCallback, s)::SymbolicContinuo
139139
end
140140

141141
"""
142-
continuous_events(sys::AbstractSystem)
142+
continuous_events(sys::AbstractSystem)::Vector{SymbolicContinuousCallback}
143143
144-
Returns a vector of all the `continuous_events` in an abstract system and its component subsystems.
144+
Returns a vector of all the `continuous_events` in an abstract system and its component subsystems.
145+
The `SymbolicContinuousCallback`s in the returned vector are structs with two fields: `eqs` and
146+
`affect` which correspond to the first and second elements of a `Pair` used to define an event, i.e.
147+
`eqs => affect`.
145148
"""
146149
function continuous_events(sys::AbstractSystem)
147150
obs = get_continuous_events(sys)
@@ -240,9 +243,12 @@ SymbolicDiscreteCallbacks(cbs::Vector{<:SymbolicDiscreteCallback}) = cbs
240243
SymbolicDiscreteCallbacks(::Nothing) = SymbolicDiscreteCallback[]
241244

242245
"""
243-
discrete_events(sys::AbstractSystem)
246+
discrete_events(sys::AbstractSystem) :: Vector{SymbolicDiscreteCallback}
244247
245-
Returns a vector of all the `discrete_events` in an abstract system and its component subsystems.
248+
Returns a vector of all the `discrete_events` in an abstract system and its component subsystems.
249+
The `SymbolicDiscreteCallback`s in the returned vector are structs with two fields: `condition` and
250+
`affect` which correspond to the first and second elements of a `Pair` used to define an event, i.e.
251+
`condition => affect`.
246252
"""
247253
function discrete_events(sys::AbstractSystem)
248254
obs = get_discrete_events(sys)

0 commit comments

Comments
 (0)