From a4fcfc4c67f4c4a21004f7898308b72376a61e52 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Thu, 12 Dec 2024 10:08:54 -0500 Subject: [PATCH] formatter --- test/test_NamedDimsArraysTensorAlgebraExt.jl | 8 ++++---- test/test_basic.jl | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/test_NamedDimsArraysTensorAlgebraExt.jl b/test/test_NamedDimsArraysTensorAlgebraExt.jl index 8f03660..5817077 100644 --- a/test/test_NamedDimsArraysTensorAlgebraExt.jl +++ b/test/test_NamedDimsArraysTensorAlgebraExt.jl @@ -20,11 +20,11 @@ elts = (Float32, Float64, Complex{Float32}, Complex{Float64}) na_fused = fusedims(na, (k, i) => "a", (j, l) => "b") # Fuse all dimensions. @test unname(na_fused, ("a", "b")) ≈ - reshape(unname(na, (k, i, j, l)), (unname(k) * unname(i), unname(j) * unname(l))) + reshape(unname(na, (k, i, j, l)), (unname(k) * unname(i), unname(j) * unname(l))) na_fused = fusedims(na, (k, i) => "a") # Fuse a subset of dimensions. @test unname(na_fused, ("a", "j", "l")) ≈ - reshape(unname(na, (k, i, j, l)), (unname(k) * unname(i), unname(j), unname(l))) + reshape(unname(na, (k, i, j, l)), (unname(k) * unname(i), unname(j), unname(l))) end @testset "splitdims" begin a, b = named.((6, 20), ("a", "b")) @@ -33,11 +33,11 @@ elts = (Float32, Float64, Complex{Float32}, Complex{Float64}) # Split all dimensions. na_split = splitdims(na, "a" => (k, i), "b" => (j, l)) @test unname(na_split, ("k", "i", "j", "l")) ≈ - reshape(unname(na, ("a", "b")), (unname(k), unname(i), unname(j), unname(l))) + reshape(unname(na, ("a", "b")), (unname(k), unname(i), unname(j), unname(l))) # Split a subset of dimensions. na_split = splitdims(na, "a" => (j, i)) @test unname(na_split, ("j", "i", "b")) ≈ - reshape(unname(na, ("a", "b")), (unname(j), unname(i), unname(b))) + reshape(unname(na, ("a", "b")), (unname(j), unname(i), unname(b))) end @testset "qr" begin dims = (2, 2, 2, 2) diff --git a/test/test_basic.jl b/test/test_basic.jl index 98bae69..f40e09a 100644 --- a/test/test_basic.jl +++ b/test/test_basic.jl @@ -32,15 +32,15 @@ using NamedDimsArrays: @test axes(na) == (1:3, 1:4) @test namedaxes(na) == (named(1:3, "i"), named(1:4, "j")) @test randn(named(3, "i"), named(4, "j")) isa NamedDimsArray - @test na["i"=>1, "j"=>2] == a[1, 2] - @test na["j"=>2, "i"=>1] == a[1, 2] - na["j"=>2, "i"=>1] = 12 + @test na["i" => 1, "j" => 2] == a[1, 2] + @test na["j" => 2, "i" => 1] == a[1, 2] + na["j" => 2, "i" => 1] = 12 @test na[1, 2] == 12 - @test na[j=>1, i=>2] == a[2, 1] - @test na[aj=>1, ai=>2] == a[2, 1] - na[j=>1, i=>2] = 21 + @test na[j => 1, i => 2] == a[2, 1] + @test na[aj => 1, ai => 2] == a[2, 1] + na[j => 1, i => 2] = 21 @test na[2, 1] == 21 - na[aj=>1, ai=>2] = 2211 + na[aj => 1, ai => 2] = 2211 @test na[2, 1] == 2211 na′ = align(na, ("j", "i")) @test a == permutedims(unname(na′), (2, 1))