def test_vector_get_indexed_diffraction_vectors_warn(): match_results = VectorMatchingResults(np.array([[1], [2]])) match_results.hkls = [0, 0, 1] vectors = DiffractionVectors(np.array([[1], [2]])) vectors.hkls = [0, 0, 0] with pytest.warns(Warning): match_results.get_indexed_diffraction_vectors(vectors) np.testing.assert_allclose(vectors.hkls, [0, 0, 0])
def test_vector_get_indexed_diffraction_vectors(overwrite, result_hkl, current_hkl, expected_hkl): match_results = VectorMatchingResults(np.array([[1], [2]])) match_results.hkls = result_hkl vectors = DiffractionVectors(np.array([[1], [2]])) vectors.hkls = current_hkl match_results.get_indexed_diffraction_vectors(vectors, overwrite) np.testing.assert_allclose(vectors.hkls, expected_hkl)