Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Julia v1.10 #448

Merged
merged 5 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/DocPreviewCleanup.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.10'
- '1'
# - 'nightly'
- 'pre'
os:
- ubuntu-latest
arch:
Expand Down
19 changes: 2 additions & 17 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions ext/BATAdvancedHMCExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}()
Expand Down
6 changes: 1 addition & 5 deletions ext/BATCubaExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}()
Expand Down
6 changes: 1 addition & 5 deletions ext/BATFoldsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 2 additions & 7 deletions ext/BATHDF5Ext.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions ext/BATNestedSamplersExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

module BATNestedSamplersExt

@static if isdefined(Base, :get_extension)
using NestedSamplers
else
using ..NestedSamplers
end
using NestedSamplers

using BAT
using HeterogeneousComputing
Expand Down
6 changes: 1 addition & 5 deletions ext/BATOptimExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}()
Expand Down
8 changes: 1 addition & 7 deletions ext/BATOptimizationExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}()
Expand Down
8 changes: 3 additions & 5 deletions ext/BATPlotsExt.jl
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 1 addition & 5 deletions ext/BATUltraNestExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

module BATUltraNestExt

@static if isdefined(Base, :get_extension)
using UltraNest
else
using ..UltraNest
end
using UltraNest

using BAT

Expand Down
20 changes: 0 additions & 20 deletions src/BAT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ using Parameters
using PDMats
using PositiveFactorizations
using RecipesBase
using Requires
using StaticArrays
using StatsBase
using StructArrays
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/plotting/recipes_diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
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)

Check warning on line 30 in src/plotting/recipes_diagnostics.jl

View check run for this annotation

Codecov / codecov/patch

src/plotting/recipes_diagnostics.jl#L30

Added line #L30 was not covered by tests

ctr = 1

Expand Down
2 changes: 1 addition & 1 deletion src/plotting/vsel_processing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)," " => ""), "[" => "⌞"), ":" => "ː"), "," => "ˌ"), "]" => "⌟"
)
Expand Down
1 change: 0 additions & 1 deletion test/optimization/test_mode_estimators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion test/samplers/nested_sampling/test_nested_sampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Loading