Skip to content

Commit 1305de7

Browse files
committed
Fix tests
1 parent 0cef9d4 commit 1305de7

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

test/DAT/xmap.jl

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
a1 = YAXArray((x,y,z), rand(4,5,6))
77
a2 = YAXArray((x,z,y), rand(4,6,5))
88
a3 = YAXArray((x,y), rand(4,5))
9-
r = xmap(a1 X, a2 X, output = XOutput(dims(a1, X))) do xout, x1, x2
9+
r = xmap(a1 :X, a2 :X, output = XOutput(dims(a1, X))) do xout, x1, x2
1010
xout .= x1 .+ x2
1111
end
1212
@test r.data == a1.data .+ permutedims(a2.data,(1,3,2))
13-
r = xmap(a2 X, a3 X, output=XOutput(dims(a1, X))) do xout, x1, x2
13+
r = xmap(a2 :X, a3 :X, output=XOutput(dims(a1, X))) do xout, x1, x2
1414
xout .= x1 .+ x2
1515
end
1616
@test r.data == a2.data .+ reshape(a3.data,(4,1,5))
@@ -19,16 +19,16 @@
1919
#end
2020
@test r.data == a2.data .+ reshape(a3.data,(4,1,5))
2121
end
22-
23-
@testitem "set outtype" begin
24-
using YAXArrays
25-
using DimensionalData
26-
using Statistics
27-
x,y,z = X(1:4), Y(1:5), Z(1:6)
28-
a1 = YAXArray((x,y,z), rand(UInt8, 4,5,6))
29-
r = xmap((xout, xin) -> xout .= mean(xin), a1 :X, output=XOutput(outtype=Float16))
30-
@test r.data == Float16.(mean(a1, dims=1))
31-
end
22+
end
23+
@testitem "set outtype" begin
24+
using YAXArrays
25+
using DimensionalData
26+
using Statistics
27+
x,y,z = X(1:4), Y(1:5), Z(1:6)
28+
a1 = YAXArray((x,y,z), rand(UInt8, 4,5,6))
29+
r = xmap((xout, xin) -> xout .= mean(xin), a1 :X, output=XOutput(outtype=Float16))
30+
@test r.data == Float16.(mean(a1, dims=1))
31+
end
3232

3333
#=
3434
These should be reenabled once we decided what keyword arguments xmap gets.
@@ -74,4 +74,3 @@ These should be reenabled once we decided what keyword arguments xmap gets.
7474
@test_throws CapturedException mapCube((xout, xin) -> xout .= foo(xin), a1; indims, outdims, ispar=true)
7575
end
7676
=#
77-
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ include("DAT/PickAxisArray.jl")
1919
include("DAT/MovingWindow.jl")
2020
include("DAT/tablestats.jl")
2121
include("DAT/mapcube.jl")
22+
include("DAT/xmap.jl")
2223
include("DAT/DAT.jl")
2324
include("DAT/loopchunks.jl")

0 commit comments

Comments
 (0)