Skip to content

Commit 3141ef3

Browse files
authored
Function docstring formatting (#45)
1 parent ccf7238 commit 3141ef3

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

src/SSMProblems.jl

+52-52
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ abstract type ObservationProcess end
3737
"""
3838
distribution(dyn::LatentDynamics, extra)
3939
40-
Return the initialisation distribution for the latent dynamics.
40+
Return the initialisation distribution for the latent dynamics.
4141
42-
The method should return the distribution of the initial state of the latent dynamics.
43-
The returned value should be a `Distributions.Distribution` object that implements
44-
sampling and log-density calculations.
42+
The method should return the distribution of the initial state of the latent dynamics.
43+
The returned value should be a `Distributions.Distribution` object that implements
44+
sampling and log-density calculations.
4545
46-
See also [`LatentDynamics`](@ref).
46+
See also [`LatentDynamics`](@ref).
4747
48-
# Returns
49-
- `Distributions.Distribution`: The distribution of the initial state.
48+
# Returns
49+
- `Distributions.Distribution`: The distribution of the initial state.
5050
"""
5151
function distribution(dyn::LatentDynamics, extra)
5252
throw(MethodError(distribution, (dyn, extra)))
@@ -55,17 +55,17 @@ end
5555
"""
5656
distribution(dyn::LatentDynamics, step::Integer, state, extra)
5757
58-
Return the transition distribution for the latent dynamics.
58+
Return the transition distribution for the latent dynamics.
5959
60-
The method should return the distribution of the state for the next time step given the
61-
current state `state` at time step `step`. The returned value should be a
62-
`Distributions.Distribution` object that implements sampling and log-density
63-
calculations.
60+
The method should return the distribution of the state for the next time step given the
61+
current state `state` at time step `step`. The returned value should be a
62+
`Distributions.Distribution` object that implements sampling and log-density
63+
calculations.
6464
65-
See also [`LatentDynamics`](@ref).
65+
See also [`LatentDynamics`](@ref).
6666
67-
# Returns
68-
- `Distributions.Distribution`: The distribution of the new state.
67+
# Returns
68+
- `Distributions.Distribution`: The distribution of the new state.
6969
"""
7070
function distribution(dyn::LatentDynamics, step::Integer, state, extra)
7171
throw(MethodError(distribution, (dyn, step, state, extra)))
@@ -74,16 +74,16 @@ end
7474
"""
7575
distribution(obs::ObservationProcess, step::Integer, state, extra)
7676
77-
Return the observation distribution for the observation process.
77+
Return the observation distribution for the observation process.
7878
79-
The method should return the distribution of an observation given the current state
80-
`state` at time step `step`. The returned value should be a `Distributions.Distribution`
81-
object that implements sampling and log-density calculations.
79+
The method should return the distribution of an observation given the current state
80+
`state` at time step `step`. The returned value should be a `Distributions.Distribution`
81+
object that implements sampling and log-density calculations.
8282
83-
See also [`ObservationProcess`](@ref).
83+
See also [`ObservationProcess`](@ref).
8484
85-
# Returns
86-
- `Distributions.Distribution`: The distribution of the observation.
85+
# Returns
86+
- `Distributions.Distribution`: The distribution of the observation.
8787
"""
8888
function distribution(obs::ObservationProcess, step::Integer, state, extra)
8989
throw(MethodError(distribution, (obs, step, state, extra)))
@@ -112,15 +112,15 @@ end
112112
"""
113113
simulate([rng::AbstractRNG], dyn::LatentDynamics, step::Integer, state, extra)
114114
115-
Simulate a transition of the latent dynamics.
115+
Simulate a transition of the latent dynamics.
116116
117-
The method should return a random state for the next time step given the state `state`
118-
at the current time step, `step`.
117+
The method should return a random state for the next time step given the state `state`
118+
at the current time step, `step`.
119119
120-
The default behaviour is generate a random sample from distribution returned by the
121-
corresponding `distribution()` method.
120+
The default behaviour is generate a random sample from distribution returned by the
121+
corresponding `distribution()` method.
122122
123-
See also [`LatentDynamics`](@ref).
123+
See also [`LatentDynamics`](@ref).
124124
"""
125125
function simulate(rng::AbstractRNG, dyn::LatentDynamics, step::Integer, state, extra)
126126
return rand(rng, distribution(dyn, step, state, extra))
@@ -132,15 +132,15 @@ end
132132
"""
133133
simulate([rng::AbstractRNG], process::ObservationProcess, step::Integer, state, extra)
134134
135-
Simulate an observation given the current state.
135+
Simulate an observation given the current state.
136136
137-
The method should return a random observation given the current state `state` at time
138-
step `step`.
137+
The method should return a random observation given the current state `state` at time
138+
step `step`.
139139
140-
The default behaviour is generate a random sample from distribution returned by the
141-
corresponding `distribution()` method.
140+
The default behaviour is generate a random sample from distribution returned by the
141+
corresponding `distribution()` method.
142142
143-
See also [`ObservationProcess`](@ref).
143+
See also [`ObservationProcess`](@ref).
144144
"""
145145
function simulate(rng::AbstractRNG, obs::ObservationProcess, step::Integer, state, extra)
146146
return rand(rng, distribution(obs, step, state, extra))
@@ -152,15 +152,15 @@ end
152152
"""
153153
logdensity(dyn::LatentDynamics, new_state, extra)
154154
155-
Compute the log-density of an initial state for the latent dynamics.
155+
Compute the log-density of an initial state for the latent dynamics.
156156
157-
The method should return the log-density of the initial state `new_state` for the
158-
initial time step of the latent dynamics.
157+
The method should return the log-density of the initial state `new_state` for the
158+
initial time step of the latent dynamics.
159159
160-
The default behaviour is to compute the log-density of the distribution return by the
161-
corresponding `distribution()` method.
160+
The default behaviour is to compute the log-density of the distribution return by the
161+
corresponding `distribution()` method.
162162
163-
See also [`LatentDynamics`](@ref).
163+
See also [`LatentDynamics`](@ref).
164164
"""
165165
function logdensity(dyn::LatentDynamics, new_state, extra)
166166
return logpdf(distribution(dyn, extra), new_state)
@@ -169,15 +169,15 @@ end
169169
"""
170170
logdensity(dyn::LatentDynamics, step::Integer, state, new_state, extra)
171171
172-
Compute the log-density of a transition of the latent dynamics.
172+
Compute the log-density of a transition of the latent dynamics.
173173
174-
The method should return the log-density of the new state `new_state` given the current
175-
state `state` at time step `step`.
174+
The method should return the log-density of the new state `new_state` given the current
175+
state `state` at time step `step`.
176176
177-
The default behaviour is to compute the log-density of the distribution return by the
178-
corresponding `distribution()` method.
177+
The default behaviour is to compute the log-density of the distribution return by the
178+
corresponding `distribution()` method.
179179
180-
See also [`LatentDynamics`](@ref).
180+
See also [`LatentDynamics`](@ref).
181181
"""
182182
function logdensity(dyn::LatentDynamics, step::Integer, state, new_state, extra)
183183
return logpdf(distribution(dyn, step, state, extra), new_state)
@@ -186,15 +186,15 @@ end
186186
"""
187187
logdensity(obs::ObservationProcess, step::Integer, state, observation, extra)
188188
189-
Compute the log-density of an observation given the current state.
189+
Compute the log-density of an observation given the current state.
190190
191-
The method should return the log-density of the observation `observation` given the
192-
current state `state` at time step `step`.
191+
The method should return the log-density of the observation `observation` given the
192+
current state `state` at time step `step`.
193193
194-
The default behaviour is to compute the log-density of the distribution return by the
195-
corresponding `distribution()` method.
194+
The default behaviour is to compute the log-density of the distribution return by the
195+
corresponding `distribution()` method.
196196
197-
See also [`ObservationProcess`](@ref).
197+
See also [`ObservationProcess`](@ref).
198198
"""
199199
function logdensity(obs::ObservationProcess, step::Integer, state, observation, extra)
200200
return logpdf(distribution(obs, step, state, extra), observation)

0 commit comments

Comments
 (0)