Skip to content

Commit 87b2e6d

Browse files
committed
Address comments
1 parent c4a3adf commit 87b2e6d

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

src/Utilities.jl

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function get_structure_vec(structure_vecs, name = nothing)
8888
else
8989
throw(
9090
ArgumentError(
91-
"Structure vectors $(collect(keys(structure_vecs))) are present. Please indicate which to use.",
91+
"Structure vectors $(collect(keys(structure_vecs))) are present. I received argument `name = nothing`, so I don't know which to use.",
9292
),
9393
)
9494
end
@@ -110,7 +110,7 @@ function get_structure_mat(structure_mats, name = nothing)
110110
else
111111
throw(
112112
ArgumentError(
113-
"Structure matrices $(collect(keys(structure_mats))) are present. Please indicate which to use.",
113+
"Structure matrices $(collect(keys(structure_mats))) are present. I received argument `name = nothing`, so I don't know which to use.",
114114
),
115115
)
116116
end
@@ -251,17 +251,27 @@ function initialize_and_encode_with_schedule!(
251251
processed_io_pairs = deepcopy(io_pairs)
252252

253253
input_structure_mats = deepcopy(input_structure_mats)
254-
!isnothing(prior_cov) && (input_structure_mats[:prior_cov] = prior_cov)
254+
if !isnothing(prior_cov)
255+
(input_structure_mats[:prior_cov] = prior_cov)
256+
end
255257

256258
output_structure_mats = deepcopy(output_structure_mats)
257-
!isnothing(obs_noise_cov) && (output_structure_mats[:obs_noise_cov] = obs_noise_cov)
259+
if !isnothing(obs_noise_cov)
260+
(output_structure_mats[:obs_noise_cov] = obs_noise_cov)
261+
end
258262

259263
input_structure_vecs = deepcopy(input_structure_vecs)
260-
!isnothing(prior_samples_in) && (input_structure_vecs[:prior_samples_in] = prior_samples_in)
264+
if !isnothing(prior_samples_in)
265+
(input_structure_vecs[:prior_samples_in] = prior_samples_in)
266+
end
261267

262268
output_structure_vecs = deepcopy(output_structure_vecs)
263-
!isnothing(observation) && (output_structure_vecs[:observation] = observation)
264-
!isnothing(prior_samples_out) && (output_structure_vecs[:prior_samples_out] = prior_samples_out)
269+
if !isnothing(observation)
270+
(output_structure_vecs[:observation] = observation)
271+
end
272+
if !isnothing(prior_samples_out)
273+
(output_structure_vecs[:prior_samples_out] = prior_samples_out)
274+
end
265275

266276
# apply_to is the string "in", "out" etc.
267277
for (processor, apply_to) in encoder_schedule

src/Utilities/decorrelator.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct Decorrelator{VV1, VV2, VV3, FT, AS <: AbstractString} <: DataContainerPro
3636
retain_var::FT
3737
"Switch to choose what form of matrix to use to decorrelate the data"
3838
decorrelate_with::AS
39-
""
39+
"When given, use the structure matrix by this name if `decorrelate_with` uses structure matrices. When `nothing`, try to use the only present structure matrix instead."
4040
structure_mat_name::Union{Nothing, Symbol}
4141
end
4242

0 commit comments

Comments
 (0)