From 964c651f07767ec0f9aacedf87d3e3ba3d6afddf Mon Sep 17 00:00:00 2001 From: Xianda Sun <5433119+sunxd3@users.noreply.github.com> Date: Tue, 26 Mar 2024 17:26:16 +0000 Subject: [PATCH] Improve CI (#166) Only substantial changes to the code is renaming `VOLUME_I` and `VOLUME_II` to `VOLUME_1\2`. Some test code are moved around. Test CI is factored into multiple smaller ones: - `mcmcchains` and `gibbs` tests will be retried if error for max 3 times --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/Benchmark.yml | 59 -------- .github/workflows/CompatHelper.yml | 45 ++++++ .github/workflows/Tests.yml | 76 ++++++---- Project.toml | 2 +- docs/src/example.md | 2 +- src/BUGSExamples/BUGSExamples.jl | 52 +++---- .../{Volume_I => Volume_1}/Blocker.jl | 0 .../{Volume_I => Volume_1}/Bones.jl | 0 .../{Volume_I => Volume_1}/Dogs.jl | 0 .../{Volume_I => Volume_1}/Dyes.jl | 0 .../{Volume_I => Volume_1}/Epil.jl | 0 .../{Volume_I => Volume_1}/Equiv.jl | 0 .../{Volume_I => Volume_1}/Inhalers.jl | 0 .../{Volume_I => Volume_1}/Kidney.jl | 0 .../{Volume_I => Volume_1}/LSAT.jl | 0 .../{Volume_I => Volume_1}/Leuk.jl | 0 .../{Volume_I => Volume_1}/LeukFr.jl | 0 .../{Volume_I => Volume_1}/Magnesium.jl | 0 .../{Volume_I => Volume_1}/Mice.jl | 0 .../{Volume_I => Volume_1}/Oxford.jl | 0 .../{Volume_I => Volume_1}/Pumps.jl | 0 .../{Volume_I => Volume_1}/Rats.jl | 0 .../{Volume_I => Volume_1}/Salm.jl | 0 .../{Volume_I => Volume_1}/Seeds.jl | 0 .../{Volume_I => Volume_1}/Stacks.jl | 0 .../{Volume_I => Volume_1}/Surgical.jl | 0 .../{Volume_II => Volume_2}/Alligators.jl | 0 .../{Volume_II => Volume_2}/BiRats.jl | 0 .../{Volume_II => Volume_2}/Eyes.jl | 0 .../Volume_4}/methadone/README.md | 0 .../Volume_4}/methadone/data1.csv | 0 .../Volume_4}/methadone/data2.csv | 0 .../Volume_4}/methadone/methadone.jl | 0 src/compiler_pass.jl | 2 +- src/utils.jl | 8 +- test/gibbs.jl | 7 +- test/gradient_tests/blockers.csv | 48 ------- test/gradient_tests/rats.csv | 66 --------- test/graphs.jl | 11 +- test/inference.jl | 18 ++- test/logp_tests/{ => BUGS_models}/blockers.jl | 0 test/logp_tests/{ => BUGS_models}/bones.jl | 6 +- test/logp_tests/{ => BUGS_models}/dogs.jl | 6 +- test/logp_tests/{ => BUGS_models}/rats.jl | 0 .../binomial.jl | 0 .../ddirich.jl | 0 .../{ => single_distribution_models}/dwish.jl | 0 .../{ => single_distribution_models}/gamma.jl | 0 .../{ => single_distribution_models}/lkj.jl | 0 test/logp_tests/test_logp.jl | 16 +++ test/parser/test_parser.jl | 5 + test/profile.jl | 6 +- test/runtests.jl | 136 ++++++------------ test/utils.jl | 6 +- 54 files changed, 225 insertions(+), 352 deletions(-) delete mode 100644 .github/workflows/Benchmark.yml create mode 100644 .github/workflows/CompatHelper.yml rename src/BUGSExamples/{Volume_I => Volume_1}/Blocker.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Bones.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Dogs.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Dyes.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Epil.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Equiv.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Inhalers.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Kidney.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/LSAT.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Leuk.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/LeukFr.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Magnesium.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Mice.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Oxford.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Pumps.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Rats.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Salm.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Seeds.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Stacks.jl (100%) rename src/BUGSExamples/{Volume_I => Volume_1}/Surgical.jl (100%) rename src/BUGSExamples/{Volume_II => Volume_2}/Alligators.jl (100%) rename src/BUGSExamples/{Volume_II => Volume_2}/BiRats.jl (100%) rename src/BUGSExamples/{Volume_II => Volume_2}/Eyes.jl (100%) rename {test => src/BUGSExamples/Volume_4}/methadone/README.md (100%) rename {test => src/BUGSExamples/Volume_4}/methadone/data1.csv (100%) rename {test => src/BUGSExamples/Volume_4}/methadone/data2.csv (100%) rename {test => src/BUGSExamples/Volume_4}/methadone/methadone.jl (100%) delete mode 100755 test/gradient_tests/blockers.csv delete mode 100755 test/gradient_tests/rats.csv rename test/logp_tests/{ => BUGS_models}/blockers.jl (100%) rename test/logp_tests/{ => BUGS_models}/bones.jl (91%) rename test/logp_tests/{ => BUGS_models}/dogs.jl (89%) rename test/logp_tests/{ => BUGS_models}/rats.jl (100%) rename test/logp_tests/{ => single_distribution_models}/binomial.jl (100%) rename test/logp_tests/{ => single_distribution_models}/ddirich.jl (100%) rename test/logp_tests/{ => single_distribution_models}/dwish.jl (100%) rename test/logp_tests/{ => single_distribution_models}/gamma.jl (100%) rename test/logp_tests/{ => single_distribution_models}/lkj.jl (100%) create mode 100644 test/logp_tests/test_logp.jl create mode 100644 test/parser/test_parser.jl diff --git a/.github/workflows/Benchmark.yml b/.github/workflows/Benchmark.yml deleted file mode 100644 index 4ac8f6f9f..000000000 --- a/.github/workflows/Benchmark.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Benchmarking - -on: - push: - branches: - - main - tags: ['*'] - pull_request: - -jobs: - profile: - name: Benchmarking Analysis Passes - runs-on: ubuntu-latest - continue-on-error: ${{ matrix.version == 'nightly' }} - strategy: - fail-fast: false - matrix: - version: - - '1' - os: - - ubuntu-latest - arch: - - x64 - include: - - version: '1' - os: ubuntu-latest - arch: x64 - coverage: false - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 - 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/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - env: - RUN_MODE: profile - - uses: julia-actions/julia-processcoverage@v1 - if: matrix.coverage - - uses: codecov/codecov-action@v1 - if: matrix.coverage - with: - file: lcov.info - - uses: coverallsapp/github-action@master - if: matrix.coverage - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: lcov.info diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml new file mode 100644 index 000000000..3dfba52e8 --- /dev/null +++ b/.github/workflows/CompatHelper.yml @@ -0,0 +1,45 @@ +name: CompatHelper +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: +permissions: + contents: write + pull-requests: write +jobs: + CompatHelper: + runs-on: ubuntu-latest + steps: + - name: Check if Julia is already available in the PATH + id: julia_in_path + run: which julia + continue-on-error: true + - name: Install Julia, but only if it is not already available in the PATH + uses: julia-actions/setup-julia@v1 + with: + version: '1' + arch: ${{ runner.arch }} + if: steps.julia_in_path.outcome != 'success' + - name: "Add the General registry via Git" + run: | + import Pkg + ENV["JULIA_PKG_SERVER"] = "" + Pkg.Registry.add("General") + shell: julia --color=yes {0} + - name: "Install CompatHelper" + run: | + import Pkg + name = "CompatHelper" + uuid = "aa819f21-2bde-4658-8897-bab36330d9b7" + version = "3" + Pkg.add(; name, uuid, version) + shell: julia --color=yes {0} + - name: "Run CompatHelper" + run: | + import CompatHelper + CompatHelper.main() + shell: julia --color=yes {0} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + # COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} \ No newline at end of file diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 17b8c0e89..99f553b42 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -1,55 +1,81 @@ -name: CI +name: Tests on: push: - branches: - - master + branches: ["master"] + paths: + - 'src/**/*' + - 'test/**/*' pull_request: + paths: + - 'src/**/*' + - 'test/**/*' + + workflow_dispatch: jobs: test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} + name: Julia ${{ matrix.version }} on ${{ matrix.os }} (${{ matrix.arch }}) runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.version == 'nightly' }} strategy: fail-fast: false matrix: - version: - - '1' - - '1.9' - - 'nightly' - os: - - ubuntu-latest - - macOS-latest - - windows-latest - arch: - - x64 + version: ['1', '1.9', 'nightly'] + os: [ubuntu-latest, macOS-latest, windows-latest] + arch: [x64] include: - version: '1' os: ubuntu-latest arch: x64 coverage: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts + - uses: actions/cache@v4 with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + path: | + ~/.julia + ~/.julia/artifacts + key: ${{ runner.os }}-julia-${{ matrix.version }}-${{ matrix.arch }}-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }} restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + ${{ runner.os }}-julia-${{ matrix.version }}-${{ matrix.arch }}- + ${{ runner.os }}-julia-${{ matrix.version }}- - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 + - name: Running elementary tests + uses: julia-actions/julia-runtest@v1 + env: + TEST_GROUP: "elementary" + - name: Running compilation tests + uses: julia-actions/julia-runtest@v1 + env: + TEST_GROUP: "compilation" + - name: Profile compiler passes + run: julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.test(;coverage=true);" >> $GITHUB_STEP_SUMMARY + env: + TEST_GROUP: "profile" + - name: Running `gibbs` tests + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 3 + command: julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.test(coverage=true);" + env: + TEST_GROUP: "gibbs" + - name: Running `mcmchains` tests + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 3 + command: julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.test(coverage=true);" + env: + TEST_GROUP: "mcmchains" - uses: julia-actions/julia-processcoverage@v1 if: matrix.coverage - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v4 if: matrix.coverage with: file: lcov.info diff --git a/Project.toml b/Project.toml index dc30f4c8a..a7c6278c5 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "JuliaBUGS" uuid = "ba9fb4c0-828e-4473-b6a1-cd2560fee5bf" -version = "0.5.1" +version = "0.5.2" [deps] AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001" diff --git a/docs/src/example.md b/docs/src/example.md index 99537de0a..bb9a74a3b 100644 --- a/docs/src/example.md +++ b/docs/src/example.md @@ -276,4 +276,4 @@ Note that the `init_params` argument is now a vector of initial parameters for e Sometimes the progress logger can cause problems in distributed setting, so we can disable it by setting `progress = false`. ## More Examples -We have transcribed all the examples from the first volume of the BUGS Examples ([original](https://www.multibugs.org/examples/latest/VolumeI.html) and [transcribed](https://github.com/TuringLang/JuliaBUGS.jl/tree/master/src/BUGSExamples/Volume_I)). All programs and data are included, and can be compiled using the steps described in the tutorial above. \ No newline at end of file +We have transcribed all the examples from the first volume of the BUGS Examples ([original](https://www.multibugs.org/examples/latest/VolumeI.html) and [transcribed](https://github.com/TuringLang/JuliaBUGS.jl/tree/master/src/BUGSExamples/VOLUME_1)). All programs and data are included, and can be compiled using the steps described in the tutorial above. \ No newline at end of file diff --git a/src/BUGSExamples/BUGSExamples.jl b/src/BUGSExamples/BUGSExamples.jl index 5582374b1..599aa2ac1 100644 --- a/src/BUGSExamples/BUGSExamples.jl +++ b/src/BUGSExamples/BUGSExamples.jl @@ -2,38 +2,38 @@ module BUGSExamples using JuliaBUGS: @bugs -include("Volume_I/Blocker.jl") -include("Volume_I/Bones.jl") -include("Volume_I/Dogs.jl") -include("Volume_I/Dyes.jl") -include("Volume_I/Epil.jl") -include("Volume_I/Equiv.jl") -include("Volume_I/Inhalers.jl") -include("Volume_I/Kidney.jl") -include("Volume_I/Leuk.jl") -include("Volume_I/LeukFr.jl") -include("Volume_I/LSAT.jl") -include("Volume_I/Magnesium.jl") -include("Volume_I/Mice.jl") -include("Volume_I/Oxford.jl") -include("Volume_I/Pumps.jl") -include("Volume_I/Rats.jl") -include("Volume_I/Salm.jl") -include("Volume_I/Seeds.jl") -include("Volume_I/Stacks.jl") -include("Volume_I/Surgical.jl") +include("Volume_1/Blocker.jl") +include("Volume_1/Bones.jl") +include("Volume_1/Dogs.jl") +include("Volume_1/Dyes.jl") +include("Volume_1/Epil.jl") +include("Volume_1/Equiv.jl") +include("Volume_1/Inhalers.jl") +include("Volume_1/Kidney.jl") +include("Volume_1/Leuk.jl") +include("Volume_1/LeukFr.jl") +include("Volume_1/LSAT.jl") +include("Volume_1/Magnesium.jl") +include("Volume_1/Mice.jl") +include("Volume_1/Oxford.jl") +include("Volume_1/Pumps.jl") +include("Volume_1/Rats.jl") +include("Volume_1/Salm.jl") +include("Volume_1/Seeds.jl") +include("Volume_1/Stacks.jl") +include("Volume_1/Surgical.jl") -include("Volume_II/BiRats.jl") -include("Volume_II/Eyes.jl") +include("Volume_2/BiRats.jl") +include("Volume_2/Eyes.jl") -const VOLUME_I = ( +const VOLUME_1 = ( blockers=blockers, bones=bones, dogs=dogs, dyes=dyes, epil=epil, equiv=equiv, - inhalers=inhalers, + # inhalers=inhalers, kidney=kidney, leuk=leuk, leukfr=leukfr, @@ -50,10 +50,10 @@ const VOLUME_I = ( surgical_realistic=surgical_realistic, ) -const VOLUME_II = (birats=birats, eyes=eyes) +const VOLUME_2 = (birats=birats, eyes=eyes) function has_ground_truth(m::Symbol) - if m in union(keys(VOLUME_I), keys(VOLUME_II)) + if m in union(keys(VOLUME_1), keys(VOLUME_2)) return haskey(getfield(BUGSExamples, m), :reference_results) else return false diff --git a/src/BUGSExamples/Volume_I/Blocker.jl b/src/BUGSExamples/Volume_1/Blocker.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Blocker.jl rename to src/BUGSExamples/Volume_1/Blocker.jl diff --git a/src/BUGSExamples/Volume_I/Bones.jl b/src/BUGSExamples/Volume_1/Bones.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Bones.jl rename to src/BUGSExamples/Volume_1/Bones.jl diff --git a/src/BUGSExamples/Volume_I/Dogs.jl b/src/BUGSExamples/Volume_1/Dogs.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Dogs.jl rename to src/BUGSExamples/Volume_1/Dogs.jl diff --git a/src/BUGSExamples/Volume_I/Dyes.jl b/src/BUGSExamples/Volume_1/Dyes.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Dyes.jl rename to src/BUGSExamples/Volume_1/Dyes.jl diff --git a/src/BUGSExamples/Volume_I/Epil.jl b/src/BUGSExamples/Volume_1/Epil.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Epil.jl rename to src/BUGSExamples/Volume_1/Epil.jl diff --git a/src/BUGSExamples/Volume_I/Equiv.jl b/src/BUGSExamples/Volume_1/Equiv.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Equiv.jl rename to src/BUGSExamples/Volume_1/Equiv.jl diff --git a/src/BUGSExamples/Volume_I/Inhalers.jl b/src/BUGSExamples/Volume_1/Inhalers.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Inhalers.jl rename to src/BUGSExamples/Volume_1/Inhalers.jl diff --git a/src/BUGSExamples/Volume_I/Kidney.jl b/src/BUGSExamples/Volume_1/Kidney.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Kidney.jl rename to src/BUGSExamples/Volume_1/Kidney.jl diff --git a/src/BUGSExamples/Volume_I/LSAT.jl b/src/BUGSExamples/Volume_1/LSAT.jl similarity index 100% rename from src/BUGSExamples/Volume_I/LSAT.jl rename to src/BUGSExamples/Volume_1/LSAT.jl diff --git a/src/BUGSExamples/Volume_I/Leuk.jl b/src/BUGSExamples/Volume_1/Leuk.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Leuk.jl rename to src/BUGSExamples/Volume_1/Leuk.jl diff --git a/src/BUGSExamples/Volume_I/LeukFr.jl b/src/BUGSExamples/Volume_1/LeukFr.jl similarity index 100% rename from src/BUGSExamples/Volume_I/LeukFr.jl rename to src/BUGSExamples/Volume_1/LeukFr.jl diff --git a/src/BUGSExamples/Volume_I/Magnesium.jl b/src/BUGSExamples/Volume_1/Magnesium.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Magnesium.jl rename to src/BUGSExamples/Volume_1/Magnesium.jl diff --git a/src/BUGSExamples/Volume_I/Mice.jl b/src/BUGSExamples/Volume_1/Mice.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Mice.jl rename to src/BUGSExamples/Volume_1/Mice.jl diff --git a/src/BUGSExamples/Volume_I/Oxford.jl b/src/BUGSExamples/Volume_1/Oxford.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Oxford.jl rename to src/BUGSExamples/Volume_1/Oxford.jl diff --git a/src/BUGSExamples/Volume_I/Pumps.jl b/src/BUGSExamples/Volume_1/Pumps.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Pumps.jl rename to src/BUGSExamples/Volume_1/Pumps.jl diff --git a/src/BUGSExamples/Volume_I/Rats.jl b/src/BUGSExamples/Volume_1/Rats.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Rats.jl rename to src/BUGSExamples/Volume_1/Rats.jl diff --git a/src/BUGSExamples/Volume_I/Salm.jl b/src/BUGSExamples/Volume_1/Salm.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Salm.jl rename to src/BUGSExamples/Volume_1/Salm.jl diff --git a/src/BUGSExamples/Volume_I/Seeds.jl b/src/BUGSExamples/Volume_1/Seeds.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Seeds.jl rename to src/BUGSExamples/Volume_1/Seeds.jl diff --git a/src/BUGSExamples/Volume_I/Stacks.jl b/src/BUGSExamples/Volume_1/Stacks.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Stacks.jl rename to src/BUGSExamples/Volume_1/Stacks.jl diff --git a/src/BUGSExamples/Volume_I/Surgical.jl b/src/BUGSExamples/Volume_1/Surgical.jl similarity index 100% rename from src/BUGSExamples/Volume_I/Surgical.jl rename to src/BUGSExamples/Volume_1/Surgical.jl diff --git a/src/BUGSExamples/Volume_II/Alligators.jl b/src/BUGSExamples/Volume_2/Alligators.jl similarity index 100% rename from src/BUGSExamples/Volume_II/Alligators.jl rename to src/BUGSExamples/Volume_2/Alligators.jl diff --git a/src/BUGSExamples/Volume_II/BiRats.jl b/src/BUGSExamples/Volume_2/BiRats.jl similarity index 100% rename from src/BUGSExamples/Volume_II/BiRats.jl rename to src/BUGSExamples/Volume_2/BiRats.jl diff --git a/src/BUGSExamples/Volume_II/Eyes.jl b/src/BUGSExamples/Volume_2/Eyes.jl similarity index 100% rename from src/BUGSExamples/Volume_II/Eyes.jl rename to src/BUGSExamples/Volume_2/Eyes.jl diff --git a/test/methadone/README.md b/src/BUGSExamples/Volume_4/methadone/README.md similarity index 100% rename from test/methadone/README.md rename to src/BUGSExamples/Volume_4/methadone/README.md diff --git a/test/methadone/data1.csv b/src/BUGSExamples/Volume_4/methadone/data1.csv similarity index 100% rename from test/methadone/data1.csv rename to src/BUGSExamples/Volume_4/methadone/data1.csv diff --git a/test/methadone/data2.csv b/src/BUGSExamples/Volume_4/methadone/data2.csv similarity index 100% rename from test/methadone/data2.csv rename to src/BUGSExamples/Volume_4/methadone/data2.csv diff --git a/test/methadone/methadone.jl b/src/BUGSExamples/Volume_4/methadone/methadone.jl similarity index 100% rename from test/methadone/methadone.jl rename to src/BUGSExamples/Volume_4/methadone/methadone.jl diff --git a/src/compiler_pass.jl b/src/compiler_pass.jl index bfffdd453..6a2d3cc4d 100644 --- a/src/compiler_pass.jl +++ b/src/compiler_pass.jl @@ -486,7 +486,7 @@ The function returns three values: Array elements and array variables are represented by tuples in the returned value. All `Colon` indexing is assumed to be concretized. # Examples -```jldoctest +```jldoctest; setup = :(using JuliaBUGS: evaluate_and_track_dependencies) julia> evaluate_and_track_dependencies(:(x[a]), (x=[missing, missing], a = missing)) (missing, (:a, (:x, 1:2))) diff --git a/src/utils.jl b/src/utils.jl index da0d43b69..0bc2b1b48 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -88,7 +88,7 @@ end Extract all the array variable names and number of dimensions from a given simple expression. # Examples: -```jldoctest +```jldoctest; setup = :(using JuliaBUGS: extract_variable_names_and_numdims) julia> extract_variable_names_and_numdims(:((a + b) * c), ()) (a = 0, b = 0, c = 0) @@ -154,7 +154,7 @@ will raise an error. # Example: ```jldoctest -extract_variable_names_and_numdims( +JuliaBUGS.extract_variable_names_and_numdims( @bugs begin for i in 1:N for j in 1:T @@ -434,7 +434,7 @@ Replace all `Colon()`s in `expr` with the corresponding array size. # Examples ```jldoctest -julia> concretize_colon_indexing(:(f(x[1, :])), (x = [1 2 3 4; 5 6 7 8; 9 10 11 12],)) +julia> JuliaBUGS.concretize_colon_indexing(:(f(x[1, :])), (x = [1 2 3 4; 5 6 7 8; 9 10 11 12],)) :(f(x[1, 1:4])) ``` """ @@ -460,7 +460,7 @@ This function evaluates expressions that consist solely of arithmetic operations is specifically designed for scenarios such as calculating array indices or determining loop boundaries. # Example: -```jldoctest +```jldoctest; setup = :(using JuliaBUGS: simple_arithmetic_eval) julia> simple_arithmetic_eval((a = 1, b = [1, 2]), 1) 1 diff --git a/test/gibbs.jl b/test/gibbs.jl index 973199429..99ad72810 100644 --- a/test/gibbs.jl +++ b/test/gibbs.jl @@ -1,3 +1,6 @@ +using JuliaBUGS: MHFromPrior, Gibbs +using DynamicPPL: DynamicPPL + @testset "Simple gibbs" begin model_def = @bugs begin # Likelihood @@ -32,7 +35,9 @@ :varinfo, begin vi = model.varinfo - SimpleVarInfo(DynamicPPL.values_as(vi, NamedTuple), vi.logp, vi.transformation) + DynamicPPL.SimpleVarInfo( + DynamicPPL.values_as(vi, NamedTuple), vi.logp, vi.transformation + ) end, ) diff --git a/test/gradient_tests/blockers.csv b/test/gradient_tests/blockers.csv deleted file mode 100755 index 4350df1a8..000000000 --- a/test/gradient_tests/blockers.csv +++ /dev/null @@ -1,48 +0,0 @@ -param,label,value,diffs AD,diffs FD -mu[1],0,0.0,-32.5,-32.5 -mu[2],1,0.0,-94.0,-94.0 -mu[3],2,0.0,-65.0,-65.0 -mu[4],3,0.0,-1297.5,-1297.5 -mu[5],4,0.0,-305.0,-305.0 -mu[6],5,0.0,-45.5,-45.50000001 -mu[7],6,0.0,-692.0,-692.0 -mu[8],7,0.0,-443.5,-443.5 -mu[9],8,0.0,-218.0,-218.0 -mu[10],9,0.0,-1592.5,-1592.5 -mu[11],10,0.0,-612.0,-612.0 -mu[12],11,0.0,-172.5,-172.5 -mu[13],12,0.0,-267.0,-267.0 -mu[14],13,0.0,-768.5,-768.5 -mu[15],14,0.0,-94.5,-94.5 -mu[16],15,0.0,-139.0,-139.0 -mu[17],16,0.0,-146.5,-146.5 -mu[18],17,0.0,-138.5,-138.5 -mu[19],18,0.0,-145.0,-145.0 -mu[20],19,0.0,-141.5,-141.5 -mu[21],20,0.0,-307.5,-307.5 -mu[22],21,0.0,-616.0,-616.0 -delta[1],22,0.0,-16.0,-16.0 -delta[2],23,0.0,-50.0,-49.99999999 -delta[3],24,0.0,-29.5,-29.5 -delta[4],25,0.0,-664.5,-664.5 -delta[5],26,0.0,-149.5,-149.5 -delta[6],27,0.0,-25.5,-25.5 -delta[7],28,0.0,-374.5,-374.5 -delta[8],29,0.0,-256.0,-256.0 -delta[9],30,0.0,-114.0,-114.0 -delta[10],31,0.0,-820.0,-820.0 -delta[11],32,0.0,-372.5,-372.5 -delta[12],33,0.0,-86.5,-86.5 -delta[13],34,0.0,-136.5,-136.5 -delta[14],35,0.0,-372.0,-372.0 -delta[15],36,0.0,-52.0,-52.00000001 -delta[16],37,0.0,-70.5,-70.5 -delta[17],38,0.0,-97.5,-97.5 -delta[18],39,0.0,-67.5,-67.5 -delta[19],40,0.0,-81.0,-81.0 -delta[20],41,0.0,-72.5,-72.5 -delta[21],42,0.0,-168.5,-168.5 -delta[22],43,0.0,-318.0,-318.0 -d,44,1.0,0.0,0.0 -tau,45,0.0,11.5,11.5 -delta.new,46,0.0,0.0,0.0 diff --git a/test/gradient_tests/rats.csv b/test/gradient_tests/rats.csv deleted file mode 100755 index 1a8b53a3f..000000000 --- a/test/gradient_tests/rats.csv +++ /dev/null @@ -1,66 +0,0 @@ -param,label,value,diffs AD,diffs FD -alpha[1],0,250.0,-151.0,-151.0 -alpha[2],1,250.0,-110.0,-110.0 -alpha[3],2,250.0,-86.0,-86.00000001 -alpha[4],3,250.0,-189.0,-189.0 -alpha[5],4,250.0,-194.0,-194.0 -alpha[6],5,250.0,-100.0,-100.0000001 -alpha[7],6,250.0,-209.0,-209.0 -alpha[8],7,250.0,-107.0,-107.0 -alpha[9],8,250.0,74.0,74.00000002 -alpha[10],9,250.0,-258.0,-257.9999999 -alpha[11],10,250.0,-56.0,-55.99999989 -alpha[12],11,250.0,-212.0,-212.0 -alpha[13],12,250.0,-138.0,-138.0 -alpha[14],13,250.0,-4.0,-4.000000044 -alpha[15],14,250.0,-136.0,-135.9999999 -alpha[16],15,250.0,-123.0,-122.9999999 -alpha[17],16,250.0,-191.0,-190.9999999 -alpha[18],17,250.0,-148.0,-147.9999999 -alpha[19],18,250.0,-79.0,-78.99999997 -alpha[20],19,250.0,-142.0,-141.9999999 -alpha[21],20,250.0,-106.0,-105.9999999 -alpha[22],21,250.0,-227.0,-227.0 -alpha[23],22,250.0,-210.0,-210.0000001 -alpha[24],23,250.0,-124.0,-124.0000001 -alpha[25],24,250.0,-179.0,-179.0000001 -alpha[26],25,250.0,-78.0,-78.00000007 -alpha[27],26,250.0,-76.0,-76.00000012 -alpha[28],27,250.0,-135.0,-135.0 -alpha[29],28,250.0,-265.0,-265.0000001 -alpha[30],29,250.0,-143.0,-143.0000001 -beta[1],30,6.0,18.0,17.99999998 -beta[2],31,6.0,648.0,647.9999999 -beta[3],32,6.0,284.0,283.9999998 -beta[4],33,6.0,-444.0,-444.0000001 -beta[5],34,6.0,340.0,339.9999999 -beta[6],35,6.0,88.0,87.99999981 -beta[7],36,6.0,-38.0,-38.00000006 -beta[8],37,6.0,242.0,241.9999999 -beta[9],38,6.0,648.0,647.9999999 -beta[10],39,6.0,-122.0,-122.0000001 -beta[11],40,6.0,487.0,486.9999998 -beta[12],41,6.0,53.0,52.9999999 -beta[13],42,6.0,81.0,80.99999992 -beta[14],43,6.0,417.0,416.9999999 -beta[15],44,6.0,-395.0,-395.0000001 -beta[16],45,6.0,-73.0,-73.00000012 -beta[17],46,6.0,151.0,150.9999999 -beta[18],47,6.0,-122.0,-122.0000001 -beta[19],48,6.0,235.0,234.9999998 -beta[20],49,6.0,11.0,10.99999994 -beta[21],50,6.0,235.0,234.9999998 -beta[22],51,6.0,-115.0,-115.0000002 -beta[23],52,6.0,-185.0,-185.0000001 -beta[24],53,6.0,-94.0,-94.0000001 -beta[25],54,6.0,557.0,557.0 -beta[26],55,6.0,326.0,325.9999998 -beta[27],56,6.0,-87.0,-87.00000006 -beta[28],57,6.0,-122.0,-122.0 -beta[29],58,6.0,-234.0,-234.0000001 -beta[30],59,6.0,60.0,59.99999994 -tau.c,60,1.0,-23485.0,-23485.00004 -alpha.c,61,150.0,2999.99985,2999.99985 -alpha.tau,62,1.0,-149985.0,-149985.0002 -beta.c,63,10.0,-120.00001,-120.0000069 -beta.tau,64,1.0,-225.0,-224.9999975 diff --git a/test/graphs.jl b/test/graphs.jl index 6f72f89b5..5820756e4 100644 --- a/test/graphs.jl +++ b/test/graphs.jl @@ -1,3 +1,6 @@ +using JuliaBUGS: + stochastic_inneighbors, stochastic_neighbors, stochastic_outneighbors, markov_blanket + test_model = @bugs begin a ~ dnorm(f, c) f = b - 1 @@ -62,7 +65,8 @@ mb_logp = begin end # order: b, l, c, a -@test mb_logp ≈ evaluate!!(cond_model, LogDensityContext(), [c_value])[2] rtol = 1e-8 +@test mb_logp ≈ evaluate!!(cond_model, JuliaBUGS.LogDensityContext(), [c_value])[2] rtol = + 1e-8 # test LogDensityContext @test begin @@ -75,8 +79,9 @@ end logp += logpdf(dnorm(2.0, 1.0), 4.0) # d, where g = 2.0 logp += logpdf(dnorm(4.0, 4.0), 5.0) # e, where h = 4.0 logp -end ≈ evaluate!!(model, LogDensityContext(), [-2.0, 4.0, 3.0, 2.0, 1.0, 4.0, 5.0])[2] atol = - 1e-8 +end ≈ evaluate!!( + model, JuliaBUGS.LogDensityContext(), [-2.0, 4.0, 3.0, 2.0, 1.0, 4.0, 5.0] +)[2] atol = 1e-8 # AuxiliaryNodeInfo test_model = @bugs begin diff --git a/test/inference.jl b/test/inference.jl index 337e7a99c..0f2bdec93 100644 --- a/test/inference.jl +++ b/test/inference.jl @@ -46,9 +46,9 @@ end end @testset "Inference results on examples: $m" for m in [:seeds, :rats, :equiv, :stacks] - data = JuliaBUGS.BUGSExamples.VOLUME_I[m].data - inits = JuliaBUGS.BUGSExamples.VOLUME_I[m].inits[1] - model = JuliaBUGS.compile(JuliaBUGS.BUGSExamples.VOLUME_I[m].model_def, data, inits) + data = JuliaBUGS.BUGSExamples.VOLUME_1[m].data + inits = JuliaBUGS.BUGSExamples.VOLUME_1[m].inits[1] + model = JuliaBUGS.compile(JuliaBUGS.BUGSExamples.VOLUME_1[m].model_def, data, inits) ad_model = ADgradient(:ReverseDiff, model; compile=Val(true)) @@ -68,7 +68,7 @@ end ) @assert JuliaBUGS.BUGSExamples.has_ground_truth(m) "No reference inference results for $m" - ref_inference_results = JuliaBUGS.BUGSExamples.VOLUME_I[m].reference_results + ref_inference_results = JuliaBUGS.BUGSExamples.VOLUME_1[m].reference_results @testset "$m: $var" for var in keys(ref_inference_results) @test summarize(samples_and_stats)[var].nt.mean[1] ≈ ref_inference_results[var].mean rtol = 0.2 @@ -78,11 +78,9 @@ end end @testset "Inference results on examples: m" for m in [:birats] - data = JuliaBUGS.BUGSExamples.VOLUME_II[m].data - inits = JuliaBUGS.BUGSExamples.VOLUME_II[m].inits[1] - model = JuliaBUGS.compile( - JuliaBUGS.BUGSExamples.VOLUME_II[m].model_def, data, inits - ) + data = JuliaBUGS.BUGSExamples.VOLUME_2[m].data + inits = JuliaBUGS.BUGSExamples.VOLUME_2[m].inits[1] + model = JuliaBUGS.compile(JuliaBUGS.BUGSExamples.VOLUME_2[m].model_def, data, inits) ad_model = ADgradient(:ReverseDiff, model; compile=Val(true)) @@ -102,7 +100,7 @@ end ) @assert JuliaBUGS.BUGSExamples.has_ground_truth(m) "No reference inference results for $m" - ref_inference_results = JuliaBUGS.BUGSExamples.VOLUME_II[m].reference_results + ref_inference_results = JuliaBUGS.BUGSExamples.VOLUME_2[m].reference_results @testset "$m: $var" for var in keys(ref_inference_results) @test summarize(samples_and_stats)[var].nt.mean[1] ≈ ref_inference_results[var].mean rtol = 0.2 diff --git a/test/logp_tests/blockers.jl b/test/logp_tests/BUGS_models/blockers.jl similarity index 100% rename from test/logp_tests/blockers.jl rename to test/logp_tests/BUGS_models/blockers.jl diff --git a/test/logp_tests/bones.jl b/test/logp_tests/BUGS_models/bones.jl similarity index 91% rename from test/logp_tests/bones.jl rename to test/logp_tests/BUGS_models/bones.jl index 2629979b5..0ef265e4c 100644 --- a/test/logp_tests/bones.jl +++ b/test/logp_tests/BUGS_models/bones.jl @@ -1,6 +1,6 @@ -bugs_model_def = JuliaBUGS.BUGSExamples.VOLUME_I[:bones].model_def -data = JuliaBUGS.BUGSExamples.VOLUME_I[:bones].data -inits = JuliaBUGS.BUGSExamples.VOLUME_I[:bones].inits[1] +bugs_model_def = JuliaBUGS.BUGSExamples.VOLUME_1[:bones].model_def +data = JuliaBUGS.BUGSExamples.VOLUME_1[:bones].data +inits = JuliaBUGS.BUGSExamples.VOLUME_1[:bones].inits[1] bugs_model = compile(bugs_model_def, data, inits) vi = bugs_model.varinfo diff --git a/test/logp_tests/dogs.jl b/test/logp_tests/BUGS_models/dogs.jl similarity index 89% rename from test/logp_tests/dogs.jl rename to test/logp_tests/BUGS_models/dogs.jl index 17f8079cc..4cdd83349 100644 --- a/test/logp_tests/dogs.jl +++ b/test/logp_tests/BUGS_models/dogs.jl @@ -1,6 +1,6 @@ -bugs_model_def = JuliaBUGS.BUGSExamples.VOLUME_I[:dogs].model_def -data = JuliaBUGS.BUGSExamples.VOLUME_I[:dogs].data -inits = JuliaBUGS.BUGSExamples.VOLUME_I[:dogs].inits[1] +bugs_model_def = JuliaBUGS.BUGSExamples.VOLUME_1[:dogs].model_def +data = JuliaBUGS.BUGSExamples.VOLUME_1[:dogs].data +inits = JuliaBUGS.BUGSExamples.VOLUME_1[:dogs].inits[1] bugs_model = compile(bugs_model_def, data, inits) vi = bugs_model.varinfo diff --git a/test/logp_tests/rats.jl b/test/logp_tests/BUGS_models/rats.jl similarity index 100% rename from test/logp_tests/rats.jl rename to test/logp_tests/BUGS_models/rats.jl diff --git a/test/logp_tests/binomial.jl b/test/logp_tests/single_distribution_models/binomial.jl similarity index 100% rename from test/logp_tests/binomial.jl rename to test/logp_tests/single_distribution_models/binomial.jl diff --git a/test/logp_tests/ddirich.jl b/test/logp_tests/single_distribution_models/ddirich.jl similarity index 100% rename from test/logp_tests/ddirich.jl rename to test/logp_tests/single_distribution_models/ddirich.jl diff --git a/test/logp_tests/dwish.jl b/test/logp_tests/single_distribution_models/dwish.jl similarity index 100% rename from test/logp_tests/dwish.jl rename to test/logp_tests/single_distribution_models/dwish.jl diff --git a/test/logp_tests/gamma.jl b/test/logp_tests/single_distribution_models/gamma.jl similarity index 100% rename from test/logp_tests/gamma.jl rename to test/logp_tests/single_distribution_models/gamma.jl diff --git a/test/logp_tests/lkj.jl b/test/logp_tests/single_distribution_models/lkj.jl similarity index 100% rename from test/logp_tests/lkj.jl rename to test/logp_tests/single_distribution_models/lkj.jl diff --git a/test/logp_tests/test_logp.jl b/test/logp_tests/test_logp.jl new file mode 100644 index 000000000..a6a34aec8 --- /dev/null +++ b/test/logp_tests/test_logp.jl @@ -0,0 +1,16 @@ +using JuliaBUGS: + BUGSGraph, DefaultContext, evaluate!!, get_params_varinfo, LogDensityContext +using DynamicPPL: DynamicPPL, getlogp, settrans!!, SimpleVarInfo, @model + +@testset "Log joint probability" begin + @testset "Single distribution models" begin + @testset "$s" for s in [:binomial, :gamma, :lkj, :dwish, :ddirich] + include("single_distribution_models/$s.jl") + end + end + @testset "BUGS models" begin + @testset "$s" for s in [:blockers, :bones, :dogs, :rats] + include("BUGS_models/$s.jl") + end + end +end diff --git a/test/parser/test_parser.jl b/test/parser/test_parser.jl new file mode 100644 index 000000000..9d6d0dae7 --- /dev/null +++ b/test/parser/test_parser.jl @@ -0,0 +1,5 @@ +@testset "Parser" begin + include("bugs_macro.jl") + include("bugs_parser.jl") + include("winbugs_examples.jl") +end diff --git a/test/profile.jl b/test/profile.jl index bf99dde3a..0aee38ec8 100644 --- a/test/profile.jl +++ b/test/profile.jl @@ -5,10 +5,10 @@ using JuliaBUGS: BUGSExamples suite = BenchmarkGroup() -for name in keys(BUGSExamples.VOLUME_I) +for name in keys(BUGSExamples.VOLUME_1) @info "Adding benchmark for $name" - model_def = BUGSExamples.VOLUME_I[name].model_def - data = BUGSExamples.VOLUME_I[name].data + model_def = BUGSExamples.VOLUME_1[name].model_def + data = BUGSExamples.VOLUME_1[name].data non_data_scalars, non_data_array_sizes = JuliaBUGS.determine_array_sizes( model_def, data diff --git a/test/runtests.jl b/test/runtests.jl index d9b2680dd..8cee00ff0 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,124 +1,70 @@ +using JuliaBUGS +using JuliaBUGS.BUGSPrimitives +using Documenter +using Test +using JuliaBUGS.BUGSPrimitives: mean +DocMeta.setdocmeta!(JuliaBUGS, :DocTestSetup, :(using JuliaBUGS); recursive=true) + using AbstractPPL using AbstractMCMC using AdvancedHMC using AdvancedMH using Bijectors using Distributions -using Documenter -using DynamicPPL -using DynamicPPL: getlogp, settrans!!, SimpleVarInfo -using Graphs, MetaGraphsNext -using JuliaBUGS -using JuliaBUGS: - BUGSGraph, - DefaultContext, - evaluate!!, - get_params_varinfo, - LogDensityContext, - MHFromPrior, - stochastic_inneighbors, - stochastic_neighbors, - stochastic_outneighbors, - markov_blanket, - Gibbs -using JuliaBUGS.BUGSPrimitives -using JuliaBUGS.BUGSPrimitives: mean +using Graphs +using MetaGraphsNext using LinearAlgebra -using LogDensityProblems, LogDensityProblemsAD +using LogDensityProblems +using LogDensityProblemsAD using MacroTools using MCMCChains using Random using ReverseDiff -using Test AbstractMCMC.setprogress!(false) -if get(ENV, "RUN_MODE", "test") == "profile" - include("profile.jl") -else - @testset "Function Unit Tests" begin - DocMeta.setdocmeta!( - JuliaBUGS, - :DocTestSetup, - :(using JuliaBUGS: - JuliaBUGS, - BUGSExamples, - @bugs, - evaluate_and_track_dependencies, - evaluate, - concretize_colon_indexing, - extract_variable_names_and_numdims, - extract_variables_in_bounds_and_lhs_indices, - simple_arithmetic_eval); - recursive=true, - ) - Documenter.doctest(JuliaBUGS; manual=false) - end - - include("bugs_primitives.jl") +const Tests = ("elementary", "compilation", "profile", "gibbs", "mcmchains", "all") - @testset "Parser" begin - include("parser/bugs_macro.jl") - include("parser/bugs_parser.jl") - include("parser/winbugs_examples.jl") - end - - include("compile.jl") - - include("cumulative_density.jl") +const test_group = get(ENV, "TEST_GROUP", "all") +if test_group ∉ Tests + error("Unknown test group: $test_group") +end - @testset "Compile WinBUGS Vol I examples: $m" for m in [ - :blockers, - :bones, - :dogs, - :dyes, - :epil, - :equiv, - :kidney, - :leuk, - :leukfr, - :lsat, - :magnesium, - :mice, - :oxford, - :pumps, - :rats, - :salm, - :seeds, - :stacks, - :surgical_simple, - :surgical_realistic, - ] - model_def = JuliaBUGS.BUGSExamples.VOLUME_I[m].model_def - data = JuliaBUGS.BUGSExamples.VOLUME_I[m].data - inits = JuliaBUGS.BUGSExamples.VOLUME_I[m].inits[1] - model = compile(model_def, data, inits) - end +@info "Running tests for groups: $test_group" - @testset "Utils" begin +if test_group == "elementary" || test_group == "all" + @testset "Unit Tests" begin + Documenter.doctest(JuliaBUGS; manual=false) include("utils.jl") end - + include("parser/test_parser.jl") include("passes.jl") + include("graphs.jl") +end - @testset "Log Probability Test" begin - @testset "Single stochastic variable test" begin - @testset "test for $s" for s in [:binomial, :gamma, :lkj, :dwish, :ddirich] - include("logp_tests/$s.jl") - end - end - @testset "BUGS examples" begin - @testset "test for $s" for s in [:blockers, :bones, :dogs, :rats] - include("logp_tests/$s.jl") - end +if test_group == "compilation" || test_group == "all" + @testset "BUGS examples volume 1" begin + @testset "$m" for m in keys(JuliaBUGS.BUGSExamples.VOLUME_1) + m = JuliaBUGS.BUGSExamples.VOLUME_1[m] + model = compile(m.model_def, m.data, m.inits[1]) end end - - @testset "Graph data structure" begin - include("graphs.jl") + @testset "Some corner cases" begin + include("bugs_primitives.jl") + include("compile.jl") + include("cumulative_density.jl") end + include("logp_tests/test_logp.jl") +end +if test_group == "profile" || test_group == "all" + include("profile.jl") +end + +if test_group == "gibbs" || test_group == "all" include("gibbs.jl") +end +if test_group == "mcmchains" || test_group == "all" include("ext/mcmchains.jl") end diff --git a/test/utils.jl b/test/utils.jl index 13c1b565c..605fb060a 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -22,9 +22,9 @@ end # Tests for `getparams`, using `Rats` model @testset "`getparams` with Rats" begin m = :rats - data = JuliaBUGS.BUGSExamples.VOLUME_I[m].data - inits = JuliaBUGS.BUGSExamples.VOLUME_I[m].inits[1] - model = JuliaBUGS.compile(JuliaBUGS.BUGSExamples.VOLUME_I[m].model_def, data, inits) + data = JuliaBUGS.BUGSExamples.VOLUME_1[m].data + inits = JuliaBUGS.BUGSExamples.VOLUME_1[m].inits[1] + model = JuliaBUGS.compile(JuliaBUGS.BUGSExamples.VOLUME_1[m].model_def, data, inits) # transformed @test LogDensityProblems.logdensity(