Skip to content

Commit 96307d2

Browse files
committed
add more error detail, skip pytest failure due to problem in seekpath module
1 parent d3e53b9 commit 96307d2

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

GSASII/k_vector_search.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@
3939
import seekpath
4040
except ModuleNotFoundError:
4141
G2fil.NeededPackage({'magnetic k-vector search':['seekpath']})
42+
print('k_vector_search: seekpath could not be imported')
4243
gen_option_avail = False
4344
try:
4445
from GSASII.kvec_general import parallel_proc
4546
except ModuleNotFoundError:
47+
print('k_vector_search: kvec_general could not be imported')
4648
gen_option_avail = False
4749

4850
def unique_id_gen(string_list: list) -> list:

tests/test_kvec.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def test_CriticalRoutines():
195195

196196

197197
@pytest.mark.skipif(k_search is None, reason='No seekpath module')
198+
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
198199
def test_KVecCandidateUpdate():
199200
'''self-test #3: test the updating of the list of alternative k vectors'''
200201
_ReportTest()
@@ -231,23 +232,22 @@ def test_KVecCandidateUpdate():
231232
k_opt_list[0],
232233
[.5, 0., .5],
233234
atol=1e-5
234-
), msg
235+
), msg+f'\nk_opt_list[0] {k_opt_list[0]}, [.5, 0., .5]'
235236
assert np.allclose(
236237
k_opt_dist[0],
237238
0.14445,
238239
atol=1e-5
239-
), msg
240-
240+
), msg+f'\nk_opt_dist[0] {k_opt_dist[0]}, 0.14445'
241241
assert np.allclose(
242242
k_opt_list[1],
243243
[.5, .5, .5],
244244
atol=1e-5
245-
), msg
245+
), msg+f'\nk_opt_list[1] {k_opt_list[1]}, [.5, .5, .5]'
246246
assert np.allclose(
247247
k_opt_dist[1],
248-
.20353,
248+
0.20353,
249249
atol=1e-5
250-
), msg
250+
), msg+f'\nk_opt_dist[1] {k_opt_dist[1]}, 0.20353'
251251

252252
k_trial = [0, 0, 0] # Gamma point
253253
k_opt_out = k_search.updateCandidateList(
@@ -264,30 +264,30 @@ def test_KVecCandidateUpdate():
264264
k_opt_list[0],
265265
[0., 0., 0.],
266266
atol=1e-5
267-
), msg
267+
), msg+f'\nk_opt_list[0] {k_opt_list[0]}, [0, 0, 0]'
268268
assert np.allclose(
269269
k_opt_dist[0],
270270
0.,
271271
atol=1e-5
272-
), msg
272+
), msg+f'\nk_opt_dist[0] {k_opt_dist[0]}, 0.'
273273

274274
k_opt_final, kd_opt_final, _, _ = k_search.kOptFinder()
275275
assert np.allclose(
276276
k_opt_final[0],
277277
[0., 0., 0.],
278278
atol=1e-5
279-
), msg
279+
), msg+f'\nk_opt_final[0] {k_opt_final[0]}, [0, 0, 0]'
280280
assert np.allclose(
281281
kd_opt_final[0],
282282
0.,
283283
atol=1e-5
284-
), msg
285-
284+
), msg+f'\nkd_opt_final[0] {kd_opt_final[0]}, 0.0'
286285

287286
selftestlist.append(test_KVecCandidateUpdate)
288287

289288

290289
@pytest.mark.skipif(k_search is None, reason='No seekpath module')
290+
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
291291
def test_KVecSearch():
292292
'''self-test #4: test the k vector search routine'''
293293
_ReportTest()

0 commit comments

Comments
 (0)