27
27
get_hkl ,
28
28
ReciprocalLatticeVector ,
29
29
)
30
+ from diffsims .constants import VisibleDeprecationWarning
30
31
31
32
32
33
class TestGetHKL :
33
34
@pytest .mark .parametrize ("highest_hkl, n" , [([1 , 2 , 3 ], 105 ), ([1 , 1 , 1 ], 27 )])
34
35
def test_get_hkl (self , highest_hkl , n ):
35
36
highest_hkl = np .array (highest_hkl )
36
- with pytest .warns (np . VisibleDeprecationWarning ):
37
+ with pytest .warns (VisibleDeprecationWarning ):
37
38
hkl = get_hkl (highest_hkl )
38
39
assert np .allclose (hkl .max (axis = 0 ), highest_hkl )
39
40
assert np .allclose (hkl .min (axis = 0 ), - highest_hkl )
@@ -52,7 +53,7 @@ def test_get_hkl(self, highest_hkl, n):
52
53
"d, hkl" , [(0.5 , [6 , 6 , 21 ]), (1 , [3 , 3 , 11 ]), (1.5 , [2 , 2 , 7 ])]
53
54
)
54
55
def test_get_highest_hkl (self , silicon_carbide_phase , d , hkl ):
55
- with pytest .warns (np . VisibleDeprecationWarning ):
56
+ with pytest .warns (VisibleDeprecationWarning ):
56
57
hkl_out = get_highest_hkl (
57
58
silicon_carbide_phase .structure .lattice , min_dspacing = d
58
59
)
@@ -64,7 +65,7 @@ def test_get_highest_hkl(self, silicon_carbide_phase, d, hkl):
64
65
65
66
def test_get_equivalent_hkl (self ):
66
67
phase_225 = Phase (space_group = 225 )
67
- with pytest .warns (np . VisibleDeprecationWarning ):
68
+ with pytest .warns (VisibleDeprecationWarning ):
68
69
hkl1 = get_equivalent_hkl (
69
70
[1 , 1 , 1 ], operations = phase_225 .point_group , unique = True
70
71
)
@@ -86,12 +87,12 @@ def test_get_equivalent_hkl(self):
86
87
g1 = ReciprocalLatticeVector (phase_225 , hkl = [1 , 1 , 1 ])
87
88
assert np .allclose (g1 .symmetrise ().hkl , hkl1 .data )
88
89
89
- with pytest .warns (np . VisibleDeprecationWarning ):
90
+ with pytest .warns (VisibleDeprecationWarning ):
90
91
hkl2 = get_equivalent_hkl ([1 , 1 , 1 ], operations = phase_225 .point_group )
91
92
assert hkl2 .shape [0 ] == g1 .symmetrise ().size * 6 == 48
92
93
93
94
phase_186 = Phase (space_group = 186 )
94
- with pytest .warns (np . VisibleDeprecationWarning ):
95
+ with pytest .warns (VisibleDeprecationWarning ):
95
96
hkl3 , mult3 = get_equivalent_hkl (
96
97
[2 , 2 , 0 ],
97
98
operations = phase_186 .point_group ,
@@ -102,7 +103,7 @@ def test_get_equivalent_hkl(self):
102
103
assert mult3 == g3 .symmetrise ().size == 12
103
104
assert np .allclose (hkl3 .data [:2 ], [[2 , 2 , 0 ], [- 2.7321 , 0.7321 , 0 ]], atol = 1e-4 )
104
105
105
- with pytest .warns (np . VisibleDeprecationWarning ):
106
+ with pytest .warns (VisibleDeprecationWarning ):
106
107
hkl4 , mult4 = get_equivalent_hkl (
107
108
Vector3d ([[2 , 2 , 0 ], [4 , 0 , 0 ]]),
108
109
phase_186 .point_group ,
0 commit comments