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 ))
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#=
3434These 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
0 commit comments