diff --git a/.github/workflows/DocPreviewCleanup.yml b/.github/workflows/DocPreviewCleanup.yml new file mode 100644 index 000000000..5be23b964 --- /dev/null +++ b/.github/workflows/DocPreviewCleanup.yml @@ -0,0 +1,33 @@ +name: Doc Preview Cleanup + +on: + pull_request: + types: [closed] + +# Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time +concurrency: + group: doc-preview-cleanup + cancel-in-progress: false + +jobs: + doc-preview-cleanup: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v4 + with: + ref: gh-pages + - name: Delete preview and history + push changes + run: | + if [ -d "${preview_dir}" ]; then + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf "${preview_dir}" + git commit -m "delete preview" + git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + git push --force origin gh-pages-new:gh-pages + fi + env: + preview_dir: previews/PR${{ github.event.number }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3c2fdf76..d389b5316 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,9 +29,9 @@ jobs: fail-fast: false matrix: version: - - '1.6' + - '1.10' - '1' - # - 'nightly' + - 'pre' os: - ubuntu-latest arch: diff --git a/Project.toml b/Project.toml index 2ac5b7a2a..69461b7c4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "BAT" uuid = "c0cd4b16-88b7-57fa-983b-ab80aecada7e" -version = "3.2.1" +version = "3.3.0" [deps] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" @@ -51,7 +51,6 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Random123 = "74087812-796a-5b5d-8853-05524746bad3" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -Requires = "ae029012-a4dd-5104-9daa-d747884805df" Sobol = "ed01d8cd-4d21-5b2a-85b4-cc3bdc58bad4" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" @@ -146,7 +145,6 @@ Printf = "1" Random = "1" Random123 = "1.2" RecipesBase = "0.7, 0.8, 1.0" -Requires = "0.5, 1" Sobol = "1.4" StableRNGs = "1" StaticArrays = "0.12, 1.0" @@ -160,17 +158,4 @@ TypedTables = "1.2" UltraNest = "0.1" ValueShapes = "0.11" ZygoteRules = "0.2" -julia = "1.6" - -[extras] -ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" -AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d" -Cuba = "8a292aeb-7a57-582c-b821-06e4c11590b1" -Folds = "41a02a25-b8f0-4f67-bc48-60067656b558" -HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" -NestedSamplers = "41ceaf6f-1696-4a54-9b49-2e7a9ec3782e" -Optim = "429524aa-4258-5aef-a3af-852621145aeb" -Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" -Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -Transducers = "28d57a85-8fef-5791-bfe6-a80928e7c999" -UltraNest = "6822f173-b0be-4018-9ee2-28bf56348d09" +julia = "1.10" diff --git a/README.md b/README.md index 86974964d..f4ec4a7fd 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,9 @@ julia> using Pkg julia> pkg"add BAT" ``` -**Note:** BAT.jl requires Julia >= v1.6, we recommend to use Julia >= v1.10 for optimal performance. +Note: BAT.jl requires Julia >= v1.10, we recommend to use +[the latest stable Julia version](https://julialang.org/downloads/) +for optimal performance. ## Documentation diff --git a/docs/src/index.md b/docs/src/index.md index a78758bc9..7a4b0f816 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -12,7 +12,7 @@ BAT.jl originated as a rewrite/redesign of [BAT](https://github.com/bat/bat), th !!! note - BAT.jl requires Julia >= v1.6, we recommend to use Julia >= v1.9 for optimal performance. + BAT.jl requires Julia >= v1.10, we recommend to use [the latest stable Julia version](https://julialang.org/downloads/) for optimal performance. ## Table of contents diff --git a/docs/src/installation.md b/docs/src/installation.md index 1afa8436b..09833850b 100644 --- a/docs/src/installation.md +++ b/docs/src/installation.md @@ -21,7 +21,7 @@ Julia is available for Linux, OS-X and Windows, and easy to install: !!! note - BAT.jl requires Julia >= v1.6, we strongly recommend to use the latest Julia version for optimal performance. + BAT.jl requires Julia >= v1.10, we recommend to use [the latest stable Julia version](https://julialang.org/downloads/) for optimal performance. ## Installing BAT.jl and related Julia packages diff --git a/ext/BATAdvancedHMCExt.jl b/ext/BATAdvancedHMCExt.jl index 9fcb9093d..1f375078d 100644 --- a/ext/BATAdvancedHMCExt.jl +++ b/ext/BATAdvancedHMCExt.jl @@ -2,11 +2,7 @@ module BATAdvancedHMCExt -@static if isdefined(Base, :get_extension) - using AdvancedHMC -else - using ..AdvancedHMC -end +using AdvancedHMC using BAT BAT.pkgext(::Val{:AdvancedHMC}) = BAT.PackageExtension{:AdvancedHMC}() diff --git a/ext/BATCubaExt.jl b/ext/BATCubaExt.jl index 6eafa4d45..8c5172ade 100644 --- a/ext/BATCubaExt.jl +++ b/ext/BATCubaExt.jl @@ -2,11 +2,7 @@ module BATCubaExt -@static if isdefined(Base, :get_extension) - using Cuba -else - using ..Cuba -end +using Cuba using BAT BAT.pkgext(::Val{:Cuba}) = BAT.PackageExtension{:Cuba}() diff --git a/ext/BATFoldsExt.jl b/ext/BATFoldsExt.jl index f09e146e5..073564913 100644 --- a/ext/BATFoldsExt.jl +++ b/ext/BATFoldsExt.jl @@ -2,11 +2,7 @@ module BATFoldsExt -@static if isdefined(Base, :get_extension) - using Folds, Transducers -else - using ..Folds, ..Transducers -end +using Folds, Transducers using BAT diff --git a/ext/BATHDF5Ext.jl b/ext/BATHDF5Ext.jl index 9b289178f..d9b53e255 100644 --- a/ext/BATHDF5Ext.jl +++ b/ext/BATHDF5Ext.jl @@ -2,13 +2,8 @@ module BATHDF5Ext -@static if isdefined(Base, :get_extension) - using HDF5 - using HDF5: H5DataStore -else - using ..HDF5 - using ..HDF5: H5DataStore -end +using HDF5 +using HDF5: H5DataStore using BAT using BAT: MCMCSampleIDVector diff --git a/ext/BATNestedSamplersExt.jl b/ext/BATNestedSamplersExt.jl index a4cee4509..515ce6d41 100644 --- a/ext/BATNestedSamplersExt.jl +++ b/ext/BATNestedSamplersExt.jl @@ -2,11 +2,7 @@ module BATNestedSamplersExt -@static if isdefined(Base, :get_extension) - using NestedSamplers -else - using ..NestedSamplers -end +using NestedSamplers using BAT using HeterogeneousComputing diff --git a/ext/BATOptimExt.jl b/ext/BATOptimExt.jl index d12f77754..11b7a5f61 100644 --- a/ext/BATOptimExt.jl +++ b/ext/BATOptimExt.jl @@ -2,11 +2,7 @@ module BATOptimExt -@static if isdefined(Base, :get_extension) - import Optim -else - import ..Optim -end +import Optim using BAT BAT.pkgext(::Val{:Optim}) = BAT.PackageExtension{:Optim}() diff --git a/ext/BATOptimizationExt.jl b/ext/BATOptimizationExt.jl index d468d3604..e029cea0d 100644 --- a/ext/BATOptimizationExt.jl +++ b/ext/BATOptimizationExt.jl @@ -2,13 +2,7 @@ module BATOptimizationExt -# seems to cause compatibility issues between different Julia versions. -# @static if isdefined(Base, :get_extension) -# import Optimization -# else -# import ..Optimization -# end -import ..Optimization +import Optimization using BAT BAT.pkgext(::Val{:Optimization}) = BAT.PackageExtension{:Optimization}() diff --git a/ext/BATPlotsExt.jl b/ext/BATPlotsExt.jl index 7c6c4095f..a00922694 100644 --- a/ext/BATPlotsExt.jl +++ b/ext/BATPlotsExt.jl @@ -1,12 +1,10 @@ # This file is a part of BAT.jl, licensed under the MIT License (MIT). +# ToDo: Move BAT plotting into BATPlotsExt. + module BATPlotsExt -@static if isdefined(Base, :get_extension) - using Plots -else - using ..Plots -end +using Plots using BAT diff --git a/ext/BATUltraNestExt.jl b/ext/BATUltraNestExt.jl index fc9f451a7..ad3dccc68 100644 --- a/ext/BATUltraNestExt.jl +++ b/ext/BATUltraNestExt.jl @@ -2,11 +2,7 @@ module BATUltraNestExt -@static if isdefined(Base, :get_extension) - using UltraNest -else - using ..UltraNest -end +using UltraNest using BAT diff --git a/src/BAT.jl b/src/BAT.jl index ce83c8f35..6a18d7a52 100644 --- a/src/BAT.jl +++ b/src/BAT.jl @@ -43,7 +43,6 @@ using Parameters using PDMats using PositiveFactorizations using RecipesBase -using Requires using StaticArrays using StatsBase using StructArrays @@ -128,23 +127,4 @@ include("deprecations.jl") # include("precompile.jl") - -@static if !isdefined(Base, :get_extension) - using Requires -end - -function __init__() - @static if !isdefined(Base, :get_extension) - @require AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d" include("../ext/BATAdvancedHMCExt.jl") - @require Folds = "41a02a25-b8f0-4f67-bc48-60067656b558" @require Transducers = "28d57a85-8fef-5791-bfe6-a80928e7c999" include("../ext/BATFoldsExt.jl") - @require Cuba = "8a292aeb-7a57-582c-b821-06e4c11590b1" include("../ext/BATCubaExt.jl") - @require HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" include("../ext/BATHDF5Ext.jl") - @require NestedSamplers = "41ceaf6f-1696-4a54-9b49-2e7a9ec3782e" include("../ext/BATNestedSamplersExt.jl") - @require Optim = "429524aa-4258-5aef-a3af-852621145aeb" include("../ext/BATOptimExt.jl") - @require Optimization = "429524aa-4258-5aef-a3af-852621145aeb" @require ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" include("../ext/BATOptimizationExt.jl") - @require Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" include("../ext/BATPlotsExt.jl") - @require UltraNest = "6822f173-b0be-4018-9ee2-28bf56348d09" include("../ext/BATUltraNestExt.jl") - end -end - end # module diff --git a/src/plotting/recipes_diagnostics.jl b/src/plotting/recipes_diagnostics.jl index cee6d9d72..78a49d364 100644 --- a/src/plotting/recipes_diagnostics.jl +++ b/src/plotting/recipes_diagnostics.jl @@ -27,7 +27,7 @@ MCMCDiagnostics(samples::DensitySampleVector, chainresults = []) = description ? ndescription = 1 : ndescription = 0 size --> (ndiagnostics*350+100, nparams*nchains*200) - layout --> Main.Plots.grid(nparams*nchains, ndiagnostics+ndescription) + layout --> _Plots_grid(nparams*nchains, ndiagnostics+ndescription) ctr = 1 diff --git a/src/plotting/vsel_processing.jl b/src/plotting/vsel_processing.jl index 289860124..f74ac2655 100644 --- a/src/plotting/vsel_processing.jl +++ b/src/plotting/vsel_processing.jl @@ -214,7 +214,7 @@ end # :a⌞1ˌ3ˌ5⌟ = : a \llcorner 1 \verti 3 \verti 5 \lrcorner function encode_name(name::Union{Expr, String}) - # Nested replace to make Julia v1.6 happy: + # Nested replace to make Julia v1.6 happy: # ToDo: simplify, now that we require Julia v1.10 code = replace(replace(replace(replace(replace( string(name)," " => ""), "[" => "⌞"), ":" => "ː"), "," => "ˌ"), "]" => "⌟" ) diff --git a/test/optimization/test_mode_estimators.jl b/test/optimization/test_mode_estimators.jl index 42b14b1c7..b003635f3 100644 --- a/test/optimization/test_mode_estimators.jl +++ b/test/optimization/test_mode_estimators.jl @@ -5,7 +5,6 @@ using LinearAlgebra, Distributions, StatsBase, ValueShapes, Random123, DensityIn using UnPack, InverseFunctions using AutoDiffOperators, ForwardDiff using Optim, OptimizationOptimJL -include("../../ext/BATOptimizationExt.jl") @testset "mode_estimators" begin prior = NamedTupleDist( diff --git a/test/samplers/nested_sampling/test_nested_sampling.jl b/test/samplers/nested_sampling/test_nested_sampling.jl index 7006d5800..8f0562e40 100644 --- a/test/samplers/nested_sampling/test_nested_sampling.jl +++ b/test/samplers/nested_sampling/test_nested_sampling.jl @@ -8,7 +8,7 @@ Test.@testset "nested_sampling" begin # Python ultranest package doesn't seem to be available via Conda on # 32-bit systems, GLIBCXX version conflicts cause trouble for CI # on older Julia versions: - if Int == Int64 && VERSION > v"1.8" && ("UltraNest" in keys(Pkg.project().dependencies)) + if Int == Int64 && ("UltraNest" in keys(Pkg.project().dependencies)) include("test_ultranest.jl") end if ("NestedSamplers" in keys(Pkg.project().dependencies))