From 566303065a5490c9fb7f068f292cbbd97d3c6029 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Mar 2022 22:04:58 +0100 Subject: [PATCH] CompatHelper: bump compat for AbstractMCMC to 4, (keep existing compat) (#28) * CompatHelper: bump compat for AbstractMCMC to 4, (keep existing compat) * Update tests * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Bump version * Drop support for Julia < 1.3 * Fix action Co-authored-by: CompatHelper Julia Co-authored-by: David Widmann Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/CI.yml | 13 ++----------- .github/workflows/Docs.yml | 6 ++---- Project.toml | 6 +++--- test/simple.jl | 28 ++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c804eb1..b367de2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: version: - - '1.0' + - '1.3' - '1' - 'nightly' os: @@ -43,16 +43,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-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 with: diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml index 4edeebf..e5e942b 100644 --- a/.github/workflows/Docs.yml +++ b/.github/workflows/Docs.yml @@ -18,14 +18,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest + - uses: julia-actions/setup-julia@v1 with: version: '1' - - 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-docdeploy@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key JULIA_DEBUG: Documenter # Print `@debug` statements (https://github.com/JuliaDocs/Documenter.jl/issues/955) - run: julia --project=docs/ docs/make.jl diff --git a/Project.toml b/Project.toml index 46477bc..286b622 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "EllipticalSliceSampling" uuid = "cad2338a-1db2-11e9-3401-43bc07c9ede2" authors = ["David Widmann "] -version = "0.4.7" +version = "0.5.0" [deps] AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001" @@ -11,10 +11,10 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] -AbstractMCMC = "3.2" +AbstractMCMC = "3.2, 4" ArrayInterface = "2, 3, 4, 5" Distributions = "0.22, 0.23, 0.24, 0.25" -julia = "1" +julia = "1.3" [extras] Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" diff --git a/test/simple.jl b/test/simple.jl index eed2c6a..1f4696c 100644 --- a/test/simple.jl +++ b/test/simple.jl @@ -33,6 +33,13 @@ @test all(length(x) == 2_000 for x in samples) @test mean(mean, samples) ≈ μ atol = 0.05 @test mean(var, samples) ≈ σ² atol = 0.05 + + # initial parameter + init_x = randn(5) + samples = sample( + ESSModel(prior, ℓ), ESS(), alg, 10, 5; progress=false, init_params=init_x + ) + @test map(first, samples) == init_x end # initial parameter @@ -66,6 +73,13 @@ @test all(length(x) == 2_000 for x in samples) @test mean(mean, samples) ≈ μ atol = 0.05 @test mean(var, samples) ≈ σ² atol = 0.05 + + # initial parameter + init_x = randn(5) + samples = sample( + ESSModel(prior, ℓ), ESS(), alg, 10, 5; progress=false, init_params=init_x + ) + @test map(first, samples) == init_x end # initial parameter @@ -100,6 +114,13 @@ @test all(length(x) == 2_000 for x in samples) @test mean(mean, samples) ≈ μ atol = 0.05 @test mean(var, samples) ≈ σ² atol = 0.05 + + # initial parameter + init_x = [randn(1) for _ in 1:5] + samples = sample( + ESSModel(prior, ℓvec), ESS(), alg, 10, 5; progress=false, init_params=init_x + ) + @test map(first, samples) == init_x end # initial parameter @@ -136,6 +157,13 @@ @test all(length(x) == 2_000 for x in samples) @test mean(mean, samples) ≈ μ atol = 0.05 @test mean(var, samples) ≈ σ² atol = 0.05 + + # initial parameter + init_x = [randn(1) for _ in 1:5] + samples = sample( + ESSModel(prior, ℓvec), ESS(), alg, 10, 5; progress=false, init_params=init_x + ) + @test map(first, samples) == init_x end # initial parameter