From f6f833c5797adfef0f29b08bc37e280fbeeaa54e Mon Sep 17 00:00:00 2001 From: Alexey Stukalov Date: Thu, 8 Feb 2024 00:41:30 -0800 Subject: [PATCH 1/8] CI: add dependabot.yml --- .github/dependabot.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..ff6499d68 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" \ No newline at end of file From 882bf99fb3369228ba6c7a99b72ae0ee0c55368a Mon Sep 17 00:00:00 2001 From: Alexey Stukalov Date: Thu, 8 Feb 2024 00:46:08 -0800 Subject: [PATCH 2/8] CI: use julia-actions/cache --- .github/workflows/CI.yml | 7 +------ .github/workflows/CI_ecosystem.yml | 7 +------ .github/workflows/CI_extended.yml | 7 +------ .github/workflows/documentation.yml | 1 + 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9dd5ab6b7..b706a4fd0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -26,12 +26,7 @@ jobs: with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test_v2-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 diff --git a/.github/workflows/CI_ecosystem.yml b/.github/workflows/CI_ecosystem.yml index 98a79eb0b..88159fd00 100644 --- a/.github/workflows/CI_ecosystem.yml +++ b/.github/workflows/CI_ecosystem.yml @@ -32,12 +32,7 @@ jobs: with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test_extended-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 diff --git a/.github/workflows/CI_extended.yml b/.github/workflows/CI_extended.yml index 4cc24d90d..c3e7561a2 100644 --- a/.github/workflows/CI_extended.yml +++ b/.github/workflows/CI_extended.yml @@ -32,12 +32,7 @@ jobs: with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test_extended-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e7dacab73..5e4b3e2c5 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,6 +18,7 @@ jobs: - uses: julia-actions/setup-julia@latest with: version: '1' + - uses: julia-actions/cache@v1 - name: Install dependencies run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - name: Build and deploy From 44dca63c214e792d27b183debb3cd6d23a33d38d Mon Sep 17 00:00:00 2001 From: Alexey Stukalov Date: Thu, 8 Feb 2024 00:46:47 -0800 Subject: [PATCH 3/8] CI: use julia-docdeploy --- .github/workflows/documentation.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 5e4b3e2c5..4164c3683 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -19,10 +19,8 @@ jobs: with: version: '1' - uses: julia-actions/cache@v1 - - name: Install dependencies - run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - name: Build and deploy + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-docdeploy@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key - run: julia --color=yes --project=docs/ docs/make.jl + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} From 3823a5d997e90864728c55bbf195611709eeac01 Mon Sep 17 00:00:00 2001 From: Alexey Stukalov Date: Sun, 10 Mar 2024 22:22:51 -0700 Subject: [PATCH 4/8] cov_and_mean(): fix rows splatting --- src/additional_functions/helper.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/additional_functions/helper.jl b/src/additional_functions/helper.jl index 26d079b00..dca309389 100644 --- a/src/additional_functions/helper.jl +++ b/src/additional_functions/helper.jl @@ -114,11 +114,11 @@ function sparse_outer_mul!(C, A, B::Vector, ind) #computes A*S*B -> C, where ind end function cov_and_mean(rows; corrected = false) - data = permutedims(hcat(rows...)) + data = reduce(vcat, rows) size(rows, 1) > 1 ? obs_cov = Statistics.cov(data; corrected = corrected) : obs_cov = reshape([0.0],1,1) - obs_mean = vcat(Statistics.mean(data, dims = 1)...) + obs_mean = vec(Statistics.mean(data, dims = 1)) return obs_cov, obs_mean end From 92b8eace703beaad2f47b028acac647b96759338 Mon Sep 17 00:00:00 2001 From: Alexey Stukalov Date: Sun, 10 Mar 2024 22:23:25 -0700 Subject: [PATCH 5/8] get_matrix_derivative(): fix splatting --- src/additional_functions/parameters.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/additional_functions/parameters.jl b/src/additional_functions/parameters.jl index b381e1c32..13aa1cd41 100644 --- a/src/additional_functions/parameters.jl +++ b/src/additional_functions/parameters.jl @@ -103,7 +103,7 @@ function get_matrix_derivative(M_indices, parameters, n_long) ones(length(M_indices[i])), n_long) for i in 1:length(parameters)] - ∇M = hcat(∇M...) + ∇M = reduce(hcat, ∇M) return ∇M From ae7cf6b68af0c3298e6c8d4cdbc8864fa07c692c Mon Sep 17 00:00:00 2001 From: Alexey Stukalov Date: Sun, 10 Mar 2024 22:28:50 -0700 Subject: [PATCH 6/8] test: cleanup params assignment --- test/examples/multigroup/multigroup.jl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/examples/multigroup/multigroup.jl b/test/examples/multigroup/multigroup.jl index a86371caa..5ef6bd8c6 100644 --- a/test/examples/multigroup/multigroup.jl +++ b/test/examples/multigroup/multigroup.jl @@ -21,25 +21,24 @@ dat_miss_g2 = dat_missing[dat_missing.school .== "Grant-White", :] ############################################################################################ x = Symbol.(:x, 1:36) -#x = [x...] F = zeros(9, 12) F[diagind(F)] .= 1.0 A = Matrix{Any}(zeros(12, 12)) A[1, 10] = 1.0; A[4, 11] = 1.0; A[7, 12] = 1.0 -A[2:3, 10] .= [x...][16:17]; A[5:6, 11] .= [x...][18:19]; A[8:9, 12] .= [x...][20:21]; +A[2:3, 10] .= x[16:17]; A[5:6, 11] .= x[18:19]; A[8:9, 12] .= x[20:21]; # group 1 S1 = Matrix{Any}(zeros(12, 12)) -S1[diagind(S1)] .= [x...][1:12] +S1[diagind(S1)] .= x[1:12] S1[10, 11] = x[13]; S1[11, 10] = x[13] S1[10, 12] = x[14]; S1[12, 10] = x[14] S1[12, 11] = x[15]; S1[11, 12] = x[15] # group 2 S2 = Matrix{Any}(zeros(12, 12)) -S2[diagind(S2)] .= [x...][22:33] +S2[diagind(S2)] .= x[22:33] S2[10, 11] = x[34]; S2[11, 10] = x[34] S2[10, 12] = x[35]; S2[12, 10] = x[35] S2[12, 11] = x[36]; S2[11, 12] = x[36] From 6d9c00004d158e061c1a341ff20460dc463da058 Mon Sep 17 00:00:00 2001 From: Alexey Stukalov Date: Sun, 10 Mar 2024 22:55:45 -0700 Subject: [PATCH 7/8] fixup cov_and_mean() --- src/additional_functions/helper.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/additional_functions/helper.jl b/src/additional_functions/helper.jl index dca309389..ffb02684e 100644 --- a/src/additional_functions/helper.jl +++ b/src/additional_functions/helper.jl @@ -114,7 +114,7 @@ function sparse_outer_mul!(C, A, B::Vector, ind) #computes A*S*B -> C, where ind end function cov_and_mean(rows; corrected = false) - data = reduce(vcat, rows) + data = mapreduce(transpose, vcat, rows) size(rows, 1) > 1 ? obs_cov = Statistics.cov(data; corrected = corrected) : obs_cov = reshape([0.0],1,1) From d0b2feedc5965746f837d3a783c482ea10e21e48 Mon Sep 17 00:00:00 2001 From: Maximilian-Stefan-Ernst <34346372+Maximilian-Stefan-Ernst@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:43:36 +0100 Subject: [PATCH 8/8] Update src/additional_functions/helper.jl --- src/additional_functions/helper.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/additional_functions/helper.jl b/src/additional_functions/helper.jl index ffb02684e..91095e071 100644 --- a/src/additional_functions/helper.jl +++ b/src/additional_functions/helper.jl @@ -114,7 +114,7 @@ function sparse_outer_mul!(C, A, B::Vector, ind) #computes A*S*B -> C, where ind end function cov_and_mean(rows; corrected = false) - data = mapreduce(transpose, vcat, rows) + data = transpose(reduce(hcat, rows)) size(rows, 1) > 1 ? obs_cov = Statistics.cov(data; corrected = corrected) : obs_cov = reshape([0.0],1,1)