|
49 | 49 | # Seed for pseudo-random number generator |
50 | 50 | rng = Random.MersenneTwister(4154) |
51 | 51 |
|
| 52 | + # Tests for get_structure_vec and get_structure_mat |
| 53 | + structure_vecs = Dict("a" => [1, 2, 3], "b" => [4, 5, 6]) |
| 54 | + structure_mats = Dict("c" => [1 2; 3 4], "d" => [5 6; 7 8]) |
| 55 | + @test Utilities.get_structure_vec(structure_vecs, "a") == [1, 2, 3] |
| 56 | + @test Utilities.get_structure_vec(structure_vecs, "b") == [4, 5, 6] |
| 57 | + @test Utilities.get_structure_mat(structure_mats, "c") == [1 2; 3 4] |
| 58 | + @test Utilities.get_structure_mat(structure_mats, "d") == [5 6; 7 8] |
| 59 | + @test_throws ArgumentError Utilities.get_structure_vec(structure_vecs, "c") |
| 60 | + @test_throws ArgumentError Utilities.get_structure_mat(structure_mats, "a") |
| 61 | + @test_throws ArgumentError Utilities.get_structure_vec(structure_vecs) |
| 62 | + @test_throws ArgumentError Utilities.get_structure_mat(structure_mats) |
| 63 | + |
| 64 | + structure_vecs = Dict("a" => [1, 2, 3]) |
| 65 | + @test Utilities.get_structure_vec(structure_vecs) == [1, 2, 3] |
| 66 | + @test Utilities.get_structure_vec(structure_vecs, "a") == [1, 2, 3] |
| 67 | + structure_mats = Dict("c" => [1 2; 3 4]) |
| 68 | + @test Utilities.get_structure_mat(structure_mats) == [1 2; 3 4] |
| 69 | + @test Utilities.get_structure_mat(structure_mats, "c") == [1 2; 3 4] |
| 70 | + |
52 | 71 | # quick build tests and test getters |
53 | 72 | zs = zscore_scale() |
54 | 73 | mm = minmax_scale() |
|
0 commit comments