Skip to content

Commit 83fdac2

Browse files
authored
Merge pull request #82 from CosmologicalEmulators/develop
Develop
2 parents 7396423 + 33aff09 commit 83fdac2

13 files changed

Lines changed: 199 additions & 62 deletions

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
- windows-latest
2727
- macos-latest
2828
steps:
29-
- uses: actions/checkout@v4
29+
- uses: actions/checkout@v5
3030
- uses: julia-actions/setup-julia@v2
3131
with:
3232
version: ${{ matrix.version }}
33-
- uses: actions/cache@v4
33+
- uses: actions/cache@v5
3434
env:
3535
cache-name: cache-artifacts
3636
with:

Project.toml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
name = "AbstractCosmologicalEmulators"
22
uuid = "c83c1981-e5c4-4837-9eb8-c9b1572acfc6"
3-
version = "0.9.4"
3+
version = "0.9.5"
44
authors = ["Marco Bonici <bonici.marco@gmail.com>"]
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
88
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
9-
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
109
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
11-
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
1210
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
1311
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
1412
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1513
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1614
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
17-
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
1815
NPZ = "15e1cf62-19b3-5cfa-8e77-841668bca605"
1916
SimpleChains = "de6bee2f-e2f4-4ec7-b6ed-219cc6f6e9e5"
20-
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2117

2218
[weakdeps]
19+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
2320
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
21+
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
2422
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
2523
Integrals = "de52edbc-65ea-441a-8357-d3a637375a31"
24+
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
2625
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
2726
SciMLSensitivity = "1ed8b502-d754-442c-8d5d-10ac956f44a1"
27+
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2828

2929
[extensions]
3030
BackgroundCosmologyExt = ["DataInterpolations", "FastGaussQuadrature", "Integrals", "LinearAlgebra", "OrdinaryDiffEqTsit5", "SciMLSensitivity"]
@@ -33,34 +33,43 @@ MooncakeExt = ["ForwardDiff", "Mooncake"]
3333
[compat]
3434
ADTypes = "1.21.0"
3535
Adapt = "3, 4"
36+
Aqua = "0.8"
3637
BenchmarkTools = "1.6.3"
3738
ChainRulesCore = "1.26"
3839
DataInterpolations = "6, 8"
3940
DifferentiationInterface = "0.7.16"
4041
FFTW = "1"
42+
FastChebInterp = "1.3"
4143
FastGaussQuadrature = "1"
44+
FiniteDifferences = "0.12"
4245
ForwardDiff = "0.10, 1"
4346
Integrals = "4.7.0, 5"
47+
JET = "0.9, 0.11"
4448
JSON = "1"
4549
LinearAlgebra = "1.10"
4650
Lux = "1"
4751
Mooncake = "0.4, 0.5"
4852
NPZ = "0.4"
4953
OrdinaryDiffEqTsit5 = "1"
54+
Random = "1.10"
5055
SciMLSensitivity = "7.90"
5156
SimpleChains = "0.4"
57+
Test = "1.10"
5258
Zygote = "0.7.10"
5359
julia = "1.10"
5460

5561
[extras]
5662
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
63+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
64+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
5765
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
5866
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
5967
FastChebInterp = "cf66c380-9a80-432c-aff8-4f9c79c0bdde"
6068
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
6169
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
6270
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
6371
Integrals = "de52edbc-65ea-441a-8357-d3a637375a31"
72+
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
6473
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
6574
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
6675
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
@@ -74,4 +83,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
7483
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
7584

7685
[targets]
77-
test = ["ADTypes", "DataInterpolations", "DifferentiationInterface", "FastChebInterp", "FastGaussQuadrature", "FiniteDifferences", "ForwardDiff", "Integrals", "JSON", "LinearAlgebra", "Lux", "Mooncake", "NPZ", "OrdinaryDiffEqTsit5", "Random", "SciMLSensitivity", "SimpleChains", "Test", "Zygote"]
86+
test = ["ADTypes", "Aqua", "BenchmarkTools", "DataInterpolations", "DifferentiationInterface", "FastChebInterp", "FastGaussQuadrature", "FiniteDifferences", "ForwardDiff", "Integrals", "JET", "JSON", "LinearAlgebra", "Lux", "Mooncake", "NPZ", "OrdinaryDiffEqTsit5", "Random", "SciMLSensitivity", "SimpleChains", "Test", "Zygote"]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
![size](https://img.shields.io/github/repo-size/CosmologicalEmulators/AbstractCosmologicalEmulators.jl)
66
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
77
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
8+
[![Aqua QA](https://juliatesting.github.io/Aqua.jl/dev/assets/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
9+
[![](https://img.shields.io/badge/%F0%9F%9B%A9%EF%B8%8F_tested_with-JET.jl-233f9a)](https://github.com/aviatesk/JET.jl)
810

911
`AbstractCosmologicalEmulators.jl` is the central `Julia` package within the the [CosmologicalEmulators](https://github.com/CosmologicalEmulators) Github organization, which defines methods and structs used by the other packages hosted by the organization.
1012

ext/BackgroundCosmologyExt/background.jl

Lines changed: 60 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# Define w0waCDMCosmology type
2-
@kwdef mutable struct w0waCDMCosmology <: AbstractCosmology
3-
ln10Aₛ::Number = 3.0
4-
nₛ::Number = 0.96
5-
h::Number = 0.67
6-
ωb::Number = 0.022
7-
ωc::Number = 0.12
8-
ωk::Number = 0.0
9-
::Number = 0.0
10-
w0::Number = -1.0
11-
wa::Number = 0.0
2+
@kwdef mutable struct w0waCDMCosmology{T1, T2, T3, T4, T5, T6, T7, T8, T9} <: AbstractCosmology
3+
ln10Aₛ::T1 = 3.0
4+
nₛ::T2 = 0.96
5+
h::T3 = 0.67
6+
ωb::T4 = 0.022
7+
ωc::T5 = 0.12
8+
ωk::T6 = 0.0
9+
::T7 = 0.0
10+
w0::T8 = -1.0
11+
wa::T9 = 0.0
1212
end
1313

14+
_call_interpolant(interp::Ref, y::T) where {T} = interp[](y)::T
15+
1416
function _F(y)
1517
f(x, y) = x^2 * (x^2 + y^2) / (1 + exp(x))
1618
domain = (zero(eltype(Inf)), Inf) # (lb, ub)
@@ -33,28 +35,37 @@ end
3335

3436
function _ΩνE2(a, Ωγ0, mν; kB=8.617342e-5, Tν=0.71611 * 2.7255, Neff=3.044)
3537
Γν = (4 / 11)^(1 / 3) * (Neff / 3)^(1 / 4)
36-
return 15 / π^4 * Γν^4 * Ωγ0 / a^4 * F_interpolant[](_get_y(mν, a))
38+
y = _get_y(mν, a)
39+
val = _call_interpolant(F_interpolant, y)
40+
return 15 / π^4 * Γν^4 * Ωγ0 / a^4 * val
3741
end
3842

3943
function _ΩνE2(a, Ωγ0, mν::AbstractVector; kB=8.617342e-5, Tν=0.71611 * 2.7255, Neff=3.044)
4044
Γν = (4 / 11)^(1 / 3) * (Neff / 3)^(1 / 4)
41-
sum_interpolant = sum(mymν -> F_interpolant[](_get_y(mymν, a)), mν)
45+
sum_interpolant = sum(mymν -> begin
46+
y = _get_y(mymν, a)
47+
_call_interpolant(F_interpolant, y)
48+
end, mν)
4249
return 15 / π^4 * Γν^4 * Ωγ0 / a^4 * sum_interpolant
4350
end
4451

4552
function _dΩνE2da(a, Ωγ0, mν; kB=8.617342e-5, Tν=0.71611 * 2.7255, Neff=3.044)
4653
Γν = (4 / 11)^(1 / 3) * (Neff / 3)^(1 / 4)
47-
return 15 / π^4 * Γν^4 * Ωγ0 * (-4 * F_interpolant[](_get_y(mν, a)) / a^5 +
48-
dFdy_interpolant[](_get_y(mν, a)) / a^4 * (mν / kB / Tν))
54+
y = _get_y(mν, a)
55+
val_F = _call_interpolant(F_interpolant, y)
56+
val_dFdy = _call_interpolant(dFdy_interpolant, y)
57+
return 15 / π^4 * Γν^4 * Ωγ0 * (-4 * val_F / a^5 +
58+
val_dFdy / a^4 * (mν / kB / Tν))
4959
end
5060

5161
function _dΩνE2da(a, Ωγ0, mν::AbstractVector; kB=8.617342e-5, Tν=0.71611 * 2.7255, Neff=3.044)
5262
Γν = (4 / 11)^(1 / 3) * (Neff / 3)^(1 / 4)
53-
sum_interpolant = 0.0
54-
for mymν in
55-
sum_interpolant += -4 * F_interpolant[](_get_y(mymν, a)) / a^5 +
56-
dFdy_interpolant[](_get_y(mymν, a)) / a^4 * (mymν / kB / Tν)
57-
end
63+
sum_interpolant = sum(mymν -> begin
64+
y = _get_y(mymν, a)
65+
val_F = _call_interpolant(F_interpolant, y)
66+
val_dFdy = _call_interpolant(dFdy_interpolant, y)
67+
-4 * val_F / a^5 + val_dFdy / a^4 * (mymν / kB / Tν)
68+
end, mν)
5869
return 15 / π^4 * Γν^4 * Ωγ0 * sum_interpolant
5970
end
6071

@@ -74,11 +85,19 @@ function _dρDEda(a, w0, wa)
7485
return 3 * (-(1 + w0 + wa) / a + wa) * _ρDE_a(a, w0, wa)
7586
end
7687

88+
function _E_a_scalar(a::Number, Ωcb0, Ωγ0, Ων0, ΩΛ0, Ωk0, h, mν, w0, wa)
89+
return sqrt(Ωγ0 * a^-4 + Ωcb0 * a^-3 + Ωk0 * a^-2 + ΩΛ0 * _ρDE_a(a, w0, wa) + _ΩνE2(a, Ωγ0, mν))
90+
end
91+
7792
function E_a(a, Ωcb0, h; mν=0.0, w0=-1.0, wa=0.0, Ωk0=0.0)
7893
Ωγ0 = 2.469e-5 / h^2
79-
Ων0 = _ΩνE2(1.0, Ωγ0, mν)
94+
Ων0 = _ΩνE2(1.0, Ωγ0, mν)::promote_type(Float64, typeof(Ωγ0), typeof(mν) <: AbstractVector ? eltype(mν) : typeof(mν))
8095
ΩΛ0 = 1.0 - (Ωγ0 + Ωcb0 + Ων0 + Ωk0)
81-
return @. sqrt(Ωγ0 * a^-4 + Ωcb0 * a^-3 + Ωk0 * a^-2 + ΩΛ0 * _ρDE_a(a, w0, wa) + _ΩνE2(a, Ωγ0, mν))
96+
if a isa AbstractArray
97+
return _E_a_scalar.(a, Ωcb0, Ωγ0, Ων0, ΩΛ0, Ωk0, h, Ref(mν), w0, wa)
98+
else
99+
return _E_a_scalar(a, Ωcb0, Ωγ0, Ων0, ΩΛ0, Ωk0, h, mν, w0, wa)
100+
end
82101
end
83102

84103
function E_a(a, cosmo::w0waCDMCosmology)
@@ -98,16 +117,24 @@ function E_z(z, cosmo::w0waCDMCosmology)
98117
return E_z(z, Ωcb0, cosmo.h; mν=cosmo.mν, w0=cosmo.w0, wa=cosmo.wa, Ωk0=Ωk0)
99118
end
100119

120+
function _dlogEdloga_scalar(a::Number, Ωcb0, Ωγ0, Ων0, ΩΛ0, Ωk0, h, mν, w0, wa)
121+
return a * 0.5 / (_E_a_scalar(a, Ωcb0, Ωγ0, Ων0, ΩΛ0, Ωk0, h, mν, w0, wa)^2) *
122+
(-3(Ωcb0)a^-4 - 4Ωγ0 * a^-5 - 2Ωk0 * a^-3 + ΩΛ0 * _dρDEda(a, w0, wa) + _dΩνE2da(a, Ωγ0, mν))
123+
end
124+
101125
function _dlogEdloga(a, Ωcb0, h; mν=0.0, w0=-1.0, wa=0.0, Ωk0=0.0)
102126
Ωγ0 = 2.469e-5 / h^2
103-
Ων0 = _ΩνE2(1.0, Ωγ0, mν)
127+
Ων0 = _ΩνE2(1.0, Ωγ0, mν)::promote_type(Float64, typeof(Ωγ0), typeof(mν) <: AbstractVector ? eltype(mν) : typeof(mν))
104128
ΩΛ0 = 1.0 - (Ωγ0 + Ωcb0 + Ων0 + Ωk0)
105-
return a * 0.5 / (E_a(a, Ωcb0, h; mν=mν, w0=w0, wa=wa, Ωk0=Ωk0)^2) *
106-
(-3(Ωcb0)a^-4 - 4Ωγ0 * a^-5 - 2Ωk0 * a^-3 + ΩΛ0 * _dρDEda(a, w0, wa) + _dΩνE2da(a, Ωγ0, mν))
129+
if a isa AbstractArray
130+
return _dlogEdloga_scalar.(a, Ωcb0, Ωγ0, Ων0, ΩΛ0, Ωk0, h, Ref(mν), w0, wa)
131+
else
132+
return _dlogEdloga_scalar(a, Ωcb0, Ωγ0, Ων0, ΩΛ0, Ωk0, h, mν, w0, wa)
133+
end
107134
end
108135

109136
function _Ωma(a, Ωcb0, h; mν=0.0, w0=-1.0, wa=0.0, Ωk0=0.0)
110-
return Ωcb0 * a^-3 / (E_a(a, Ωcb0, h; mν=mν, w0=w0, wa=wa, Ωk0=Ωk0))^2
137+
return Ωcb0 .* a.^-3 ./ (E_a(a, Ωcb0, h; mν=mν, w0=w0, wa=wa, Ωk0=Ωk0)).^2
111138
end
112139

113140
function _Ωma(a, cosmo::w0waCDMCosmology)
@@ -222,16 +249,18 @@ end
222249
function _growth_solver(z, Ωcb0, h; mν=0.0, w0=-1.0, wa=0.0, Ωk0=0.0)
223250
amin = 1 / 139
224251
loga = vcat(log.(_a_z.(z)))
225-
u₀ = [amin, amin]
252+
253+
T = promote_type(eltype(z), typeof(Ωcb0), typeof(h), typeof(mν), typeof(w0), typeof(wa), typeof(Ωk0))
254+
u₀ = T[amin, amin]
226255

227-
logaspan = (log(amin), log(1.01))#to ensure we cover the relevant range
256+
logaspan = (T(log(amin)), T(log(1.01)))#to ensure we cover the relevant range
228257

229-
p = [Ωcb0, mν, h, w0, wa, Ωk0]
258+
p = T[Ωcb0, mν, h, w0, wa, Ωk0]
230259

231-
prob = ODEProblem(_growth!, u₀, logaspan, p)
260+
prob = ODEProblem{true}(_growth!, u₀, logaspan, p)
232261

233-
sol = solve(prob, Tsit5(), reltol=1e-5; saveat=loga)[1:2, :]
234-
return sol
262+
sol = solve(prob, Tsit5(), reltol=1e-5; saveat=loga)
263+
return Array(sol)[1:2, :]::Matrix{T}
235264
end
236265

237266
function D_z(z, Ωcb0, h; mν=0.0, w0=-1.0, wa=0.0, Ωk0=0.0)

src/chebyshev.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@ struct ChebyshevPlan{ND, P, T}
88
K::NTuple{ND, Int}
99
nodes::NTuple{ND, Vector{T}}
1010
dim::NTuple{ND, Int}
11+
12+
function ChebyshevPlan{ND, P, T}(fft_plan::P, K::NTuple{ND, Int}, nodes::NTuple{ND, Vector{T}}, dim::NTuple{ND, Int}) where {ND, P, T}
13+
return new{ND, P, T}(fft_plan, K, nodes, dim)
14+
end
1115
end
1216

17+
function ChebyshevPlan(fft_plan, K, nodes, dim)
18+
return ChebyshevPlan{length(K), typeof(fft_plan), eltype(eltype(nodes))}(fft_plan, K, nodes, dim)
19+
end
20+
21+
1322
"""
1423
chebpoints(K::Int, x_min::T, x_max::T) where T
1524
@@ -31,7 +40,7 @@ Precomputes the Chebyshev nodes and the FFT plan required to compute coefficient
3140
K is the polynomial degree (K+1 nodes). For N-dimensional inputs, specify the `size_nd`
3241
tuple and the target dimension `dim`.
3342
"""
34-
function prepare_chebyshev_plan(x_mins::NTuple{N, T}, x_maxs::NTuple{N, T}, Ks::NTuple{N, Int}; size_nd::Union{Tuple, Nothing}=nothing, dim::NTuple{N, Int}=ntuple(i->i, N)) where {N, T}
43+
function prepare_chebyshev_plan(x_mins::NTuple{N, Any}, x_maxs::NTuple{N, Any}, Ks::NTuple{N, Int}; size_nd::Union{Tuple, Nothing}=nothing, dim::NTuple{N, Int}=ntuple(i->i, N)) where {N}
3544
nodes = ntuple(i -> chebpoints(Ks[i], x_mins[i], x_maxs[i]), N)
3645

3746
if size_nd === nothing
@@ -45,6 +54,7 @@ function prepare_chebyshev_plan(x_mins::NTuple{N, T}, x_maxs::NTuple{N, T}, Ks::
4554
for i in 1:N
4655
@assert size_nd[dim[i]] == Ks[i] + 1 "Size along target dimension $(dim[i]) must be Ks[$i]+1"
4756
end
57+
T = promote_type(eltype(eltype(x_mins)), eltype(eltype(x_maxs)))
4858
fft_plan = FFTW.plan_r2r(zeros(T, size_nd...), FFTW.REDFT00, dim; flags=FFTW.PATIENT, timelimit=Inf)
4959

5060
return ChebyshevPlan(fft_plan, Ks, nodes, dim)

src/core.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
abstract type AbstractTrainedEmulators end
22

3-
@kwdef mutable struct SimpleChainsEmulator <: AbstractTrainedEmulators
4-
Architecture
5-
Weights
6-
Description::Dict = Dict()
3+
@kwdef mutable struct SimpleChainsEmulator{A, W, D<:Dict} <: AbstractTrainedEmulators
4+
Architecture::A
5+
Weights::W
6+
Description::D = Dict()
77
end
88

99
function run_emulator(input, emulator::SimpleChainsEmulator)
1010
return emulator.Architecture(input, emulator.Weights)
1111
end
1212

13-
@kwdef mutable struct LuxEmulator <: AbstractTrainedEmulators
14-
Model
15-
Parameters
16-
States
17-
Description::Dict = Dict()
13+
@kwdef mutable struct LuxEmulator{M, P, S, D<:Dict} <: AbstractTrainedEmulators
14+
Model::M
15+
Parameters::P
16+
States::S
17+
Description::D = Dict()
1818
end
1919

2020
Adapt.@adapt_structure LuxEmulator
@@ -26,11 +26,11 @@ function run_emulator(input, emulator::LuxEmulator)
2626
return y
2727
end
2828

29-
@kwdef mutable struct GenericEmulator <: AbstractTrainedEmulators
30-
TrainedEmulator::AbstractTrainedEmulators
31-
InMinMax::AbstractMatrix
32-
OutMinMax::AbstractMatrix
33-
Postprocessing::Function
29+
@kwdef mutable struct GenericEmulator{T<:AbstractTrainedEmulators, M1<:AbstractMatrix, M2<:AbstractMatrix, F<:Function} <: AbstractTrainedEmulators
30+
TrainedEmulator::T
31+
InMinMax::M1
32+
OutMinMax::M2
33+
Postprocessing::F
3434
end
3535

3636
Adapt.@adapt_structure GenericEmulator

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ using LinearAlgebra
1616
using FastGaussQuadrature
1717
using FiniteDifferences
1818
using SciMLSensitivity
19+
using JET
20+
using Aqua
1921
using AbstractCosmologicalEmulators
2022

2123
@testset "AbstractEmulators test" begin
24+
# Aqua.jl quality assurance tests
25+
include("test_aqua.jl")
26+
2227
# Extension tests
2328
include("test_extensions.jl")
2429

test/test_aqua.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using AbstractCosmologicalEmulators
2+
using Aqua
3+
using Test
4+
5+
@testset "Aqua.jl Quality Assurance" begin
6+
# 1. Test for ambiguities (checking only ACE.jl to avoid upstream noise)
7+
Aqua.test_ambiguities(AbstractCosmologicalEmulators; recursive=false)
8+
9+
# 2. Test for piracy
10+
Aqua.test_piracies(AbstractCosmologicalEmulators)
11+
12+
# 3. Test for unbound type parameters
13+
Aqua.test_unbound_args(AbstractCosmologicalEmulators)
14+
15+
# 4. Test for undefined exports
16+
Aqua.test_undefined_exports(AbstractCosmologicalEmulators)
17+
18+
# 5. Test Project.toml health
19+
Aqua.test_project_extras(AbstractCosmologicalEmulators)
20+
Aqua.test_stale_deps(AbstractCosmologicalEmulators)
21+
Aqua.test_deps_compat(AbstractCosmologicalEmulators)
22+
end

test/test_core_functionality.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ using AbstractCosmologicalEmulators
1515
static(6),
1616
TurboDense(tanh, 64),
1717
TurboDense(tanh, 64),
18-
TurboDense(relu, 64),
18+
TurboDense(SimpleChains.relu, 64),
1919
TurboDense(tanh, 64),
2020
TurboDense(tanh, 64),
2121
TurboDense(identity, 40)
2222
)
2323

24-
NN_dict = JSON.parsefile(pwd()*"/testNN.json")
24+
NN_dict = JSON.parsefile(joinpath(@__DIR__, "testNN.json"))
2525
weights = SimpleChains.init_params(mlpd)
2626
# Create description in the same format as init_emulator
2727
nn_descript = Dict{String,Any}("emulator_description" => get(NN_dict, "emulator_description", Dict()))

0 commit comments

Comments
 (0)