Skip to content

Commit

Permalink
Merge pull request #3 from JaimeRZP/NoBolt
Browse files Browse the repository at this point in the history
NoBolt for release
  • Loading branch information
JaimeRZP authored Oct 1, 2023
2 parents 1a929fb + 49b9b59 commit 528fd50
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 57 deletions.
2 changes: 1 addition & 1 deletion Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.9.3"
manifest_format = "2.0"
project_hash = "8cbb223fb1bc13003cdac808c2a640bd859706d1"
project_hash = "38777d06b992a33542bab2fcfaa3bece835c0dbf"

[[deps.Adapt]]
deps = ["LinearAlgebra", "Requires"]
Expand Down
14 changes: 3 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,13 @@ NPZ = "15e1cf62-19b3-5cfa-8e77-841668bca605"
NumericalIntegration = "e7bfaba1-d571-5449-8927-abc22e82249b"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[extensions]
BoltExt = "Bolt"

[compat]
Statistics = "1.7, 1.8, 1.9"
QuadGK = "2.9"
Interpolations = "0.14.7"
NumericalIntegration = "0.2.0, 0.3.0"
Requires = "1.3"
NPZ = "0.4"
NumericalIntegration = "0.2.0, 0.3.0"
PythonCall = "0.9"
QuadGK = "2.9"
Statistics = "1.7, 1.8, 1.9"
julia = "1.9"

[extras]
Bolt = "d94d39b4-3f51-4e5a-bfd8-f3b08e8f2b62"
31 changes: 0 additions & 31 deletions ext/BoltExt.jl

This file was deleted.

10 changes: 0 additions & 10 deletions src/LimberJack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,9 @@ include("theory.jl")
# c/(100 km/s/Mpc) in Mpc
const CLIGHT_HMPC = 2997.92458

if !isdefined(Base, :get_extension)
using Requires
end

function __init__()
emupk_files = npzread(joinpath(artifact"emupk", "emupk.npz"))
global emulator = Emulator(emupk_files)

@static if !isdefined(Base, :get_extension)
@require Bolt = "d94d39b4-3f51-4e5a-bfd8-f3b08e8f2b62" begin
include("../ext/BoltExt.jl")
end
end
end

end # module
11 changes: 9 additions & 2 deletions src/boltzmann.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,15 @@ function lin_Pk0(mode::Val{:EisHu}, cpar::CosmoPar, settings::Settings)
return pk0
end

lin_Pk0(mode::Symbol, cpar::CosmoPar, settings::Settings) = lin_Pk0(Val(mode), cpar, settings)
lin_Pk0(@nospecialize(mode), cpar::CosmoPar, settings::Settings) = error("Tk mode $(typeof(i)) not supported.")
function lin_Pk0(mode::Val{:Custom}, cpar::CosmoPar, settings::Settings; kwargs...)
ks_c, pk_c = kwargs[:pk_custom]
pki_c = cubic_spline_interpolation(ks_c, Pk_c, extrapolation_bc=Line())
pk0 = pki_c(settings.ks)
return pk0
end

lin_Pk0(mode::Symbol, cpar::CosmoPar, settings::Settings; kwargs...) = lin_Pk0(Val(mode), cpar, settings; kwargs...)
lin_Pk0(@nospecialize(mode), cpar::CosmoPar, settings::Settings; kwargs...) = error("Tk mode $(typeof(i)) not supported.")

function _get_kernel(arr1, arr2, hyper)
arr1_w = @.(arr1/exp(hyper[2:6]))
Expand Down
2 changes: 1 addition & 1 deletion src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Cosmology(cpar::CosmoPar, settings::Settings; kwargs...) = begin
logk, nk = settings.logk, settings.nk
ks = settings.ks
dlogk = settings.dlogk
pk0, pki = lin_Pk0(cpar, settings)
pk0, pki = lin_Pk0(cpar, settings; kwargs...)
# Compute redshift-distance relation
norm = CLIGHT_HMPC / cpar.h
chis = zeros(cosmo_type, nz_chi)
Expand Down
6 changes: 5 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ test_main=true
if test_main
println("testing main functions")
end
#=
test_Bolt = false
if test_Bolt
println("testing Bolt.jl")
end
end
=#
extensive= false
if extensive
println("extensive")
Expand Down Expand Up @@ -769,6 +771,7 @@ if test_main
end
end

#=
if test_Bolt
Bolt_test_output = Dict{String}{Vector}()
Expand Down Expand Up @@ -832,4 +835,5 @@ if test_Bolt
end
end
end
=#

0 comments on commit 528fd50

Please sign in to comment.