|
425 | 425 | variablenames = (:x, :y)
|
426 | 426 | indextable = [
|
427 | 427 | [(:x, 1)], # site 1: x_1
|
428 |
| - [(:x, 2)], # site 2: x_2 |
| 428 | + [(:x, 2)], # site 2: x_2 |
429 | 429 | [(:y, 1)], # site 3: y_1
|
430 | 430 | [(:x, 3), (:y, 2)] # site 4: x_3, y_2
|
431 | 431 | ]
|
|
578 | 578 | variablenames = (:a, :b)
|
579 | 579 | indextable = [
|
580 | 580 | [(:a, 1)], # site 1: a_1
|
581 |
| - [(:a, 2)], # site 2: a_2 |
| 581 | + [(:a, 2)], # site 2: a_2 |
582 | 582 | [(:a, 3)], # site 3: a_3
|
583 | 583 | [(:b, 1)], # site 4: b_1
|
584 | 584 | [(:b, 2)] # site 5: b_2
|
|
653 | 653 | quantics = QuanticsGrids.grididx_to_quantics(grid, test_grididx)
|
654 | 654 | @test length(quantics) == 4
|
655 | 655 | @test all(1 .<= quantics[1] .<= 25) # site 1
|
656 |
| - @test all(1 .<= quantics[2] .<= 25) # site 2 |
| 656 | + @test all(1 .<= quantics[2] .<= 25) # site 2 |
657 | 657 | @test all(1 .<= quantics[3] .<= 5) # site 3
|
658 | 658 | @test all(1 .<= quantics[4] .<= 125) # site 4
|
659 | 659 | @test QuanticsGrids.quantics_to_grididx(grid, quantics) == test_grididx
|
|
728 | 728 | [(:z, 1)] # z is not in variablenames
|
729 | 729 | ]
|
730 | 730 |
|
731 |
| - @test_throws AssertionError InherentDiscreteGrid(variablenames, invalid_indextable_unknown; |
| 731 | + @test_throws AssertionError InherentDiscreteGrid( |
| 732 | + variablenames, invalid_indextable_unknown; |
732 | 733 | origin=(1, 1), step=(1, 1))
|
| 734 | + |
| 735 | + invalid_indextable_missing_index = [ |
| 736 | + [(:x, 1), (:y, 1)], |
| 737 | + [(:x, 3), (:y, 2)] |
| 738 | + ] |
| 739 | + |
| 740 | + @test_throws AssertionError InherentDiscreteGrid( |
| 741 | + variablenames, invalid_indextable_missing_index) |
| 742 | + |
| 743 | + invalid_indextable_repeated_index = [ |
| 744 | + [(:x, 1), (:y, 1)], |
| 745 | + [(:x, 1), (:y, 2)] |
| 746 | + ] |
| 747 | + |
| 748 | + @test_throws AssertionError InherentDiscreteGrid( |
| 749 | + variablenames, invalid_indextable_repeated_index) |
733 | 750 | end
|
734 | 751 |
|
735 | 752 | @testitem "InherentDiscreteGrid constructor with variablenames and Rs" begin
|
|
880 | 897 | grid_step_tuple = InherentDiscreteGrid(Rs; step=(2, 5))
|
881 | 898 | @test grid_step_tuple.step == (2, 5)
|
882 | 899 |
|
883 |
| - # Test origin can be specified as single value or tuple |
| 900 | + # Test origin can be specified as single value or tuple |
884 | 901 | grid_origin_single = InherentDiscreteGrid(Rs; origin=7)
|
885 | 902 | @test grid_origin_single.origin == (7, 7) # should broadcast
|
886 | 903 |
|
|
974 | 991 | @test grid_mixed.origin == origin_multi
|
975 | 992 | @test grid_mixed.step == step_multi
|
976 | 993 |
|
977 |
| - # Multi-R with single origin/step values |
| 994 | + # Multi-R with single origin/step values |
978 | 995 | Rs_multi = (2, 4, 3)
|
979 | 996 | origin_single = 7
|
980 | 997 | step_single = 2
|
|
0 commit comments