Skip to content

Commit 01a9225

Browse files
committed
fix tests
1 parent 61f0fd9 commit 01a9225

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

.github/workflows/runtests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
julia-version: ['1.6', '1.7', '~1.8.0-0']
10+
julia-version: ['1.6', '1.7', '1.8']
1111
os: [ubuntu-latest]
1212
provider: ['mkl', 'fftw']
1313
fail-fast: false

src/CMBLensing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ import Random: randn!
8484
export
8585
@⌛, @show⌛, @ismain, @namedtuple, @repeated, @unpack, @cpu!, @gpu!, @cu!, @fwdmodel,
8686
animate, argmaxf_lnP, argmaxf_logpdf, AzFourier, BandPassOp, BaseDataSet, batch, batch_index, batch_length,
87-
batch_map, batch_pmap, BlockDiagEquiRect, beamCℓs, CachedLenseFlow, camb, cov_to_Cℓ, cpu, Cℓ_2D,
87+
batch_map, batch_pmap, BlockDiagEquiRect, beamCℓs, cache, CachedLenseFlow, camb, cov_to_Cℓ, cpu, Cℓ_2D,
8888
Cℓ_to_Cov, DataSet, DerivBasis, diag, Diagonal, DiagOp, dot, EBFourier, EBMap, expnorm,
8989
Field, FieldArray, fieldinfo, FieldMatrix, FieldOrOpArray, FieldOrOpMatrix, FieldOrOpRowVector,
9090
FieldOrOpVector, FieldRowVector, FieldTuple, FieldVector, FieldVector,

src/dataset.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ function load_sim(;
329329

330330
if Nbatch != nothing
331331
d = ds.d *= batch(ones(Int,Nbatch))
332-
ds.L = alloc_cache(L*batch(ones(Int,Nbatch))), ds.d)
332+
ds.L = precompute!!(L*batch(ones(Int,Nbatch))), ds.d)
333333
end
334334

335335
return (;f, f̃, ϕ, d, ds, ds₀=ds(), Cℓ, proj)

src/deprecated.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
### argmaxf_lnP
33

4-
argmaxf_lnP::Field, ds::DataSet; kwargs...) = argmaxf_lnP(cache(ds.L(ϕ),ds.d), (;), ds; kwargs...)
5-
argmaxf_lnP::Field, θ, ds::DataSet; kwargs...) = argmaxf_lnP(cache(ds.L(ϕ),ds.d), θ, ds; kwargs...)
4+
argmaxf_lnP::Field, ds::DataSet; kwargs...) = argmaxf_lnP(precompute!!(ds.L(ϕ),ds.d), (;), ds; kwargs...)
5+
argmaxf_lnP::Field, θ, ds::DataSet; kwargs...) = argmaxf_lnP(precompute!!(ds.L(ϕ),ds.d), θ, ds; kwargs...)
66

77
function argmaxf_lnP(
88
Lϕ,
@@ -107,3 +107,9 @@ Base.@deprecate white_noise(f::Field, rng::AbstractRNG) randn!(rng, f)
107107
### Cℓs
108108

109109
Base.@deprecate InterpolatedCℓs(args...) Cℓs(args...)
110+
111+
112+
### cache
113+
114+
Base.@deprecate cache(L, f) precompute!!(L, f)
115+
Base.@deprecate cache!(L, f) precompute!!(L, f)

src/lenseflow.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
abstract type LenseFlowOp{S<:ODESolver,T} <: FlowOpWithAdjoint{T} end
33

44
# `L = LenseFlow(ϕ)` just creates a wrapper holding ϕ. Then when you do `L*f` or
5-
# `cache(L,f)` we create a CachedLenseFlow object which holds all the
5+
# `precompute!!(L,f)` we create a CachedLenseFlow object which holds all the
66
# precomputed quantities and preallocated memory needed to do the lense.
77

88
"""

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ end
540540
## S0
541541
Cf = maybegpu(Cℓ_to_Cov(:I, proj, Cℓ.TT))
542542
@test (f = @inferred simulate(rng,Cf)) isa FlatS0
543-
@test (Lϕ = cache(LenseFlow(ϕ),f)) isa CachedLenseFlow
543+
@test (Lϕ = precompute!!(LenseFlow(ϕ),f)) isa CachedLenseFlow
544544
@test (@inferred*f) isa FlatS0
545545
# adjoints
546546
f,g = simulate(rng,Cf),simulate(rng,Cf)
@@ -552,7 +552,7 @@ end
552552
# S2 lensing
553553
Cf = maybegpu(Cℓ_to_Cov(:P, proj, Cℓ.EE, Cℓ.BB))
554554
@test (f = @inferred simulate(rng,Cf)) isa FlatS2
555-
@test (Lϕ = cache(LenseFlow(ϕ),f)) isa CachedLenseFlow
555+
@test (Lϕ = precompute!!(LenseFlow(ϕ),f)) isa CachedLenseFlow
556556
@test (@inferred*f) isa FlatS2
557557
# adjoints
558558
f,g = simulate(rng,Cf),simulate(rng,Cf)
@@ -574,7 +574,7 @@ end
574574
@testset "Posterior" begin
575575

576576
Cℓ = camb()
577-
L = LenseFlow{RK4Solver{7}}
577+
L = LenseFlow(7)
578578
T = Float64
579579

580580
@testset "Nside = $Nside" for Nside in Nsides_big

0 commit comments

Comments
 (0)