Skip to content

Commit 3d428f7

Browse files
Merge pull request #2324 from sathvikbhagavan/sb/docstrings
docs: Fix Systems docstrings
2 parents d31b252 + b9beec3 commit 3d428f7

File tree

8 files changed

+101
-99
lines changed

8 files changed

+101
-99
lines changed

src/systems/diffeqs/odesystem.jl

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ eqs = [D(x) ~ σ*(y-x),
2424
"""
2525
struct ODESystem <: AbstractODESystem
2626
"""
27-
tag: a tag for the system. If two systems have the same tag, then they are
27+
A tag for the system. If two systems have the same tag, then they are
2828
structurally identical.
2929
"""
3030
tag::UInt
@@ -35,8 +35,8 @@ struct ODESystem <: AbstractODESystem
3535
"""
3636
Dependent (state) variables. Must not contain the independent variable.
3737
38-
N.B.: If torn_matching !== nothing, this includes all variables. Actual
39-
ODE states are determined by the SelectedState() entries in `torn_matching`.
38+
N.B.: If `torn_matching !== nothing`, this includes all variables. Actual
39+
ODE states are determined by the `SelectedState()` entries in `torn_matching`.
4040
"""
4141
states::Vector
4242
"""Parameter variables. Must not contain the independent variable."""
@@ -65,86 +65,86 @@ struct ODESystem <: AbstractODESystem
6565
"""
6666
ctrl_jac::RefValue{Any}
6767
"""
68-
`Wfact` matrix. Note: this field will not be defined until
68+
Note: this field will not be defined until
6969
[`generate_factorized_W`](@ref) is called on the system.
7070
"""
7171
Wfact::RefValue{Matrix{Num}}
7272
"""
73-
`Wfact_t` matrix. Note: this field will not be defined until
73+
Note: this field will not be defined until
7474
[`generate_factorized_W`](@ref) is called on the system.
7575
"""
7676
Wfact_t::RefValue{Matrix{Num}}
7777
"""
78-
Name: the name of the system
78+
The name of the system.
7979
"""
8080
name::Symbol
8181
"""
82-
systems: The internal systems. These are required to have unique names.
82+
The internal systems. These are required to have unique names.
8383
"""
8484
systems::Vector{ODESystem}
8585
"""
86-
defaults: The default values to use when initial conditions and/or
86+
The default values to use when initial conditions and/or
8787
parameters are not supplied in `ODEProblem`.
8888
"""
8989
defaults::Dict
9090
"""
91-
torn_matching: Tearing result specifying how to solve the system.
91+
Tearing result specifying how to solve the system.
9292
"""
9393
torn_matching::Union{Matching, Nothing}
9494
"""
95-
connector_type: type of the system
95+
Type of the system.
9696
"""
9797
connector_type::Any
9898
"""
99-
preface: inject assignment statements before the evaluation of the RHS function.
99+
Inject assignment statements before the evaluation of the RHS function.
100100
"""
101101
preface::Any
102102
"""
103-
continuous_events: A `Vector{SymbolicContinuousCallback}` that model events.
103+
A `Vector{SymbolicContinuousCallback}` that model events.
104104
The integrator will use root finding to guarantee that it steps at each zero crossing.
105105
"""
106106
continuous_events::Vector{SymbolicContinuousCallback}
107107
"""
108-
discrete_events: A `Vector{SymbolicDiscreteCallback}` that models events. Symbolic
108+
A `Vector{SymbolicDiscreteCallback}` that models events. Symbolic
109109
analog to `SciMLBase.DiscreteCallback` that executes an affect when a given condition is
110110
true at the end of an integration step.
111111
"""
112112
discrete_events::Vector{SymbolicDiscreteCallback}
113113
"""
114-
metadata: metadata for the system, to be used by downstream packages.
114+
Metadata for the system, to be used by downstream packages.
115115
"""
116116
metadata::Any
117117
"""
118-
gui_metadata: metadata for MTK GUI.
118+
Metadata for MTK GUI.
119119
"""
120120
gui_metadata::Union{Nothing, GUIMetadata}
121121
"""
122-
tearing_state: cache for intermediate tearing state
122+
Cache for intermediate tearing state.
123123
"""
124124
tearing_state::Any
125125
"""
126-
substitutions: substitutions generated by tearing.
126+
Substitutions generated by tearing.
127127
"""
128128
substitutions::Any
129129
"""
130-
complete: if a model `sys` is complete, then `sys.x` no longer performs namespacing.
130+
If a model `sys` is complete, then `sys.x` no longer performs namespacing.
131131
"""
132132
complete::Bool
133133
"""
134-
discrete_subsystems: a list of discrete subsystems.
134+
A list of discrete subsystems.
135135
"""
136136
discrete_subsystems::Any
137137
"""
138-
unknown_states: a list of actual states needed to be solved by solvers. Only
138+
A list of actual states needed to be solved by solvers. Only
139139
used for ODAEProblem.
140140
"""
141141
unknown_states::Union{Nothing, Vector{Any}}
142142
"""
143-
split_idxs: a vector of vectors of indices for the split parameters.
143+
A vector of vectors of indices for the split parameters.
144144
"""
145145
split_idxs::Union{Nothing, Vector{Vector{Int}}}
146146
"""
147-
parent: the hierarchical parent system before simplification.
147+
The hierarchical parent system before simplification.
148148
"""
149149
parent::Any
150150

src/systems/diffeqs/sdesystem.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ noiseeqs = [0.1*x,
2828
"""
2929
struct SDESystem <: AbstractODESystem
3030
"""
31-
tag: a tag for the system. If two systems have the same tag, then they are
31+
A tag for the system. If two systems have the same tag, then they are
3232
structurally identical.
3333
"""
3434
tag::UInt
@@ -66,57 +66,57 @@ struct SDESystem <: AbstractODESystem
6666
"""
6767
ctrl_jac::RefValue{Any}
6868
"""
69-
`Wfact` matrix. Note: this field will not be defined until
69+
Note: this field will not be defined until
7070
[`generate_factorized_W`](@ref) is called on the system.
7171
"""
7272
Wfact::RefValue
7373
"""
74-
`Wfact_t` matrix. Note: this field will not be defined until
74+
Note: this field will not be defined until
7575
[`generate_factorized_W`](@ref) is called on the system.
7676
"""
7777
Wfact_t::RefValue
7878
"""
79-
Name: the name of the system
79+
The name of the system.
8080
"""
8181
name::Symbol
8282
"""
83-
Systems: the internal systems. These are required to have unique names.
83+
The internal systems. These are required to have unique names.
8484
"""
8585
systems::Vector{SDESystem}
8686
"""
87-
defaults: The default values to use when initial conditions and/or
87+
The default values to use when initial conditions and/or
8888
parameters are not supplied in `ODEProblem`.
8989
"""
9090
defaults::Dict
9191
"""
92-
type: type of the system
92+
Type of the system.
9393
"""
9494
connector_type::Any
9595
"""
96-
continuous_events: A `Vector{SymbolicContinuousCallback}` that model events.
96+
A `Vector{SymbolicContinuousCallback}` that model events.
9797
The integrator will use root finding to guarantee that it steps at each zero crossing.
9898
"""
9999
continuous_events::Vector{SymbolicContinuousCallback}
100100
"""
101-
discrete_events: A `Vector{SymbolicDiscreteCallback}` that models events. Symbolic
101+
A `Vector{SymbolicDiscreteCallback}` that models events. Symbolic
102102
analog to `SciMLBase.DiscreteCallback` that executes an affect when a given condition is
103103
true at the end of an integration step.
104104
"""
105105
discrete_events::Vector{SymbolicDiscreteCallback}
106106
"""
107-
metadata: metadata for the system, to be used by downstream packages.
107+
Metadata for the system, to be used by downstream packages.
108108
"""
109109
metadata::Any
110110
"""
111-
gui_metadata: metadata for MTK GUI.
111+
Metadata for MTK GUI.
112112
"""
113113
gui_metadata::Union{Nothing, GUIMetadata}
114114
"""
115-
complete: if a model `sys` is complete, then `sys.x` no longer performs namespacing.
115+
If a model `sys` is complete, then `sys.x` no longer performs namespacing.
116116
"""
117117
complete::Bool
118118
"""
119-
parent: the hierarchical parent system before simplification.
119+
The hierarchical parent system before simplification.
120120
"""
121121
parent::Any
122122

src/systems/discrete_system/discrete_system.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ eqs = [D(x) ~ σ*(y-x),
2525
"""
2626
struct DiscreteSystem <: AbstractTimeDependentSystem
2727
"""
28-
tag: a tag for the system. If two systems have the same tag, then they are
28+
A tag for the system. If two systems have the same tag, then they are
2929
structurally identical.
3030
"""
3131
tag::UInt
@@ -46,48 +46,48 @@ struct DiscreteSystem <: AbstractTimeDependentSystem
4646
"""Observed states."""
4747
observed::Vector{Equation}
4848
"""
49-
Name: the name of the system
49+
The name of the system
5050
"""
5151
name::Symbol
5252
"""
53-
systems: The internal systems. These are required to have unique names.
53+
The internal systems. These are required to have unique names.
5454
"""
5555
systems::Vector{DiscreteSystem}
5656
"""
57-
defaults: The default values to use when initial conditions and/or
57+
The default values to use when initial conditions and/or
5858
parameters are not supplied in `DiscreteProblem`.
5959
"""
6060
defaults::Dict
6161
"""
62-
preface: inject assignment statements before the evaluation of the RHS function.
62+
Inject assignment statements before the evaluation of the RHS function.
6363
"""
6464
preface::Any
6565
"""
66-
connector_type: type of the system
66+
Type of the system.
6767
"""
6868
connector_type::Any
6969
"""
70-
metadata: metadata for the system, to be used by downstream packages.
70+
Metadata for the system, to be used by downstream packages.
7171
"""
7272
metadata::Any
7373
"""
74-
gui_metadata: metadata for MTK GUI.
74+
Metadata for MTK GUI.
7575
"""
7676
gui_metadata::Union{Nothing, GUIMetadata}
7777
"""
78-
tearing_state: cache for intermediate tearing state
78+
Cache for intermediate tearing state.
7979
"""
8080
tearing_state::Any
8181
"""
82-
substitutions: substitutions generated by tearing.
82+
Substitutions generated by tearing.
8383
"""
8484
substitutions::Any
8585
"""
86-
complete: if a model `sys` is complete, then `sys.x` no longer performs namespacing.
86+
If a model `sys` is complete, then `sys.x` no longer performs namespacing.
8787
"""
8888
complete::Bool
8989
"""
90-
parent: the hierarchical parent system before simplification.
90+
The hierarchical parent system before simplification.
9191
"""
9292
parent::Any
9393

src/systems/jumps/jumpsystem.jl

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ j₃ = MassActionJump(2*β+γ, [R => 1], [S => 1, R => -1])
4949
"""
5050
struct JumpSystem{U <: ArrayPartition} <: AbstractTimeDependentSystem
5151
"""
52-
tag: a tag for the system. If two systems have the same tag, then they are
52+
A tag for the system. If two systems have the same tag, then they are
5353
structurally identical.
5454
"""
5555
tag::UInt
@@ -66,38 +66,39 @@ struct JumpSystem{U <: ArrayPartition} <: AbstractTimeDependentSystem
6666
ps::Vector
6767
"""Array variables."""
6868
var_to_name::Any
69+
"""Observed states."""
6970
observed::Vector{Equation}
70-
"""The name of the system. . These are required to have unique names."""
71+
"""The name of the system."""
7172
name::Symbol
72-
"""The internal systems."""
73+
"""The internal systems. These are required to have unique names."""
7374
systems::Vector{JumpSystem}
7475
"""
75-
defaults: The default values to use when initial conditions and/or
76+
The default values to use when initial conditions and/or
7677
parameters are not supplied in `ODEProblem`.
7778
"""
7879
defaults::Dict
7980
"""
80-
type: type of the system
81+
Type of the system.
8182
"""
8283
connector_type::Any
8384
"""
84-
discrete_events: A `Vector{SymbolicDiscreteCallback}` that models events. Symbolic
85+
A `Vector{SymbolicDiscreteCallback}` that models events. Symbolic
8586
analog to `SciMLBase.DiscreteCallback` that executes an affect when a given condition is
86-
true at the end of an integration step. *Note, one must make sure to call
87+
true at the end of an integration step. Note, one must make sure to call
8788
`reset_aggregated_jumps!(integrator)` if using a custom affect function that changes any
88-
state value or parameter.*
89+
state value or parameter.
8990
"""
9091
discrete_events::Vector{SymbolicDiscreteCallback}
9192
"""
92-
metadata: metadata for the system, to be used by downstream packages.
93+
Metadata for the system, to be used by downstream packages.
9394
"""
9495
metadata::Any
9596
"""
96-
gui_metadata: metadata for MTK GUI.
97+
Metadata for MTK GUI.
9798
"""
9899
gui_metadata::Union{Nothing, GUIMetadata}
99100
"""
100-
complete: if a model `sys` is complete, then `sys.x` no longer performs namespacing.
101+
If a model `sys` is complete, then `sys.x` no longer performs namespacing.
101102
"""
102103
complete::Bool
103104

0 commit comments

Comments
 (0)