Skip to content

Commit 4bcd491

Browse files
docs: add docstrings for get_/has_ event functions
1 parent 973e9eb commit 4bcd491

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/systems/callbacks.jl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,23 @@ function discrete_events(sys::AbstractSystem)
941941
cbs
942942
end
943943

944+
"""
945+
$(TYPEDSIGNATURES)
946+
947+
Returns whether the system `sys` has the internal field `discrete_events`.
948+
949+
See also [`get_discrete_events`](@ref).
950+
"""
944951
has_discrete_events(sys::AbstractSystem) = isdefined(sys, :discrete_events)
952+
"""
953+
$(TYPEDSIGNATURES)
954+
955+
Get the internal field `discrete_events` of a system `sys`.
956+
It only includes `discrete_events` local to `sys`; not those of its subsystems,
957+
like `unknowns(sys)`, `parameters(sys)` and `equations(sys)` does.
958+
959+
See also [`has_discrete_events`](@ref).
960+
"""
945961
function get_discrete_events(sys::AbstractSystem)
946962
has_discrete_events(sys) || return SymbolicDiscreteCallback[]
947963
getfield(sys, :discrete_events)
@@ -984,7 +1000,23 @@ function continuous_events(sys::AbstractSystem)
9841000
filter(!isempty, cbs)
9851001
end
9861002

1003+
"""
1004+
$(TYPEDSIGNATURES)
1005+
1006+
Returns whether the system `sys` has the internal field `continuous_events`.
1007+
1008+
See also [`get_continuous_events`](@ref).
1009+
"""
9871010
has_continuous_events(sys::AbstractSystem) = isdefined(sys, :continuous_events)
1011+
"""
1012+
$(TYPEDSIGNATURES)
1013+
1014+
Get the internal field `continuous_events` of a system `sys`.
1015+
It only includes `continuous_events` local to `sys`; not those of its subsystems,
1016+
like `unknowns(sys)`, `parameters(sys)` and `equations(sys)` does.
1017+
1018+
See also [`has_continuous_events`](@ref).
1019+
"""
9881020
function get_continuous_events(sys::AbstractSystem)
9891021
has_continuous_events(sys) || return SymbolicContinuousCallback[]
9901022
getfield(sys, :continuous_events)

0 commit comments

Comments
 (0)