Skip to content

Commit

Permalink
Merge branch 'master' into mg/hdf-0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-graham authored Mar 12, 2024
2 parents bcd1b71 + 9284bba commit 06676c1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ParticleDA"
uuid = "61cd1fb4-f4c4-4bc8-80c6-ea5639a6ca2e"
authors = ["Mosè Giordano and Tuomas Koskela and Dan Giles and Matt Graham"]
version = "1.0.1"
version = "1.1.0"

[deps]
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
Expand Down
4 changes: 0 additions & 4 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
GaussianRandomFields = "e4b2fa32-6e09-5554-b718-106ed5adafe9"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
Distributions = "0.22, 0.23, 0.24, 0.25"
FillArrays = "0.13"
GaussianRandomFields = "2.2.1"
HDF5 = "0.14, 0.15, 0.16, 0.17"
MPI = "0.20.8"
OrdinaryDiffEq = "6.40"
SciMLBase = "1.81"
PDMats = "0.11"
StableRNGs = "1"
YAML = "0.4"
Expand Down
9 changes: 4 additions & 5 deletions test/models/lineargaussian.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module LinearGaussian

using Distributions
using FillArrays
using HDF5
using Random
using PDMats
Expand Down Expand Up @@ -49,7 +48,7 @@ function diagonal_linear_gaussian_model_parameters(
:observation_matrix => ScalMat(
state_dimension, observation_coefficient
),
:initial_state_mean => Zeros(state_dimension),
:initial_state_mean => zeros(state_dimension),
:initial_state_covar => ScalMat(
state_dimension, initial_state_std^2
),
Expand Down Expand Up @@ -81,7 +80,7 @@ function stochastically_driven_dsho_model_parameters(
]'
],
:observation_matrix => ScalMat(2, 1.),
:initial_state_mean => Zeros(2),
:initial_state_mean => zeros(2),
:initial_state_covar => ScalMat(2, 1.),
:state_noise_covar => PDMat(
Q * exp(-ω * δ / Q) * [
Expand Down Expand Up @@ -120,8 +119,8 @@ function init(parameters_dict::Dict, n_tasks::Int=1)
MvNormal(m, c)
for (m, c) in (
(parameters.initial_state_mean, parameters.initial_state_covar),
(Zeros(state_dimension), parameters.state_noise_covar),
(Zeros(observation_dimension), parameters.observation_noise_covar),
(zeros(state_dimension), parameters.state_noise_covar),
(zeros(observation_dimension), parameters.observation_noise_covar),
)
)...
)
Expand Down
14 changes: 6 additions & 8 deletions test/models/lorenz63.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ module Lorenz63

using Base.Threads
using Distributions
using FillArrays
using HDF5
using Random
using PDMats
using OrdinaryDiffEq
using SciMLBase
using ParticleDA

Base.@kwdef struct Lorenz63ModelParameters{S <: Real, T <: Real}
Expand All @@ -27,9 +25,9 @@ function get_params(
return P(; (; (Symbol(k) => v for (k, v) in model_params_dict)...)...)
end

struct Lorenz63Model{S <: Real, T <: Real}
struct Lorenz63Model{S <: Real, T <: Real, I}
parameters::Lorenz63ModelParameters{S, T}
integrators::Vector{<:SciMLBase.AbstractODEIntegrator}
integrators::Vector{I}
initial_state_distribution::MvNormal{S}
state_noise_distribution::MvNormal{S}
observation_noise_distribution::MvNormal{T}
Expand Down Expand Up @@ -57,7 +55,7 @@ function init(
Tsit5();
save_everystep=false
)
for u in eachcol(Matrix{S}(undef, 3, n_tasks))
for u in eachcol(zeros(S, 3, n_tasks))
]
state_dimension = 3
observation_dimension = length(parameters.observed_indices)
Expand All @@ -67,9 +65,9 @@ function init(
(
MvNormal(m, isa(s, Vector) ? PDiagMat(s.^2) : ScalMat(length(m), s.^2))
for (m, s) in (
(Ones{S}(state_dimension), parameters.initial_state_std),
(Zeros{S}(state_dimension), parameters.state_noise_std),
(Zeros{T}(observation_dimension), parameters.observation_noise_std),
(ones(S, state_dimension), parameters.initial_state_std),
(zeros(S, state_dimension), parameters.state_noise_std),
(zeros(T, observation_dimension), parameters.observation_noise_std),
)
)...
)
Expand Down

0 comments on commit 06676c1

Please sign in to comment.