Skip to content

Commit

Permalink
Fix the pn_observation_noise check
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Feb 18, 2024
1 parent 8d7fd1f commit 3ab4520
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,27 @@ function ekargcheck(
)
end
end
if covariance_factorization == IsometricKroneckerCovariance && !(
pn_observation_noise isa Number
|| pn_observation_noise isa UniformScaling
|| pn_observation_noise isa Diagonal{<:Number,<:FillArrays.Fill})
throw(
ArgumentError(
"The supplied `pn_observation_noise` is not compatible with the chosen `IsometricKroneckerCovariance` factorization. Try one of `BlockDiagonalCovariance` or `DenseCovariance` instead!",
),
)
end
if covariance_factorization == BlockDiagonalCovariance && !(
pn_observation_noise isa Number
|| pn_observation_noise isa UniformScaling
|| pn_observation_noise isa Diagonal)
throw(
ArgumentError(
"The supplied `pn_observation_noise` is not compatible with the chosen `BlockDiagonalCovariance` factorization. Try `DenseCovariance` instead!",
),
)
if !(isnothing(pn_observation_noise) || ismissing(pn_observation_noise))
if covariance_factorization == IsometricKroneckerCovariance && !(
pn_observation_noise isa Number
|| pn_observation_noise isa UniformScaling
|| pn_observation_noise isa Diagonal{<:Number,<:FillArrays.Fill})
throw(
ArgumentError(
"The supplied `pn_observation_noise` is not compatible with the chosen `IsometricKroneckerCovariance` factorization. Try one of `BlockDiagonalCovariance` or `DenseCovariance` instead!",
),
)
end
if covariance_factorization == BlockDiagonalCovariance && !(
pn_observation_noise isa Number
|| pn_observation_noise isa UniformScaling
|| pn_observation_noise isa Diagonal)
throw(
ArgumentError(
"The supplied `pn_observation_noise` is not compatible with the chosen `BlockDiagonalCovariance` factorization. Try `DenseCovariance` instead!",
),
)
end
end
end

Expand Down

0 comments on commit 3ab4520

Please sign in to comment.