From 4f6cb120869670489891f582779aa4842d2b9ab3 Mon Sep 17 00:00:00 2001 From: tgwoodcock Date: Thu, 10 Oct 2024 10:52:08 +0200 Subject: [PATCH] Modified test_refine_orientation_pc_pseudo_symmetry_scipy() The above function in the suite TestEBSDRefineOrientationPC has been modified by adding a trust region as an argument in the call to s.refine_orientation_projection_centre() with the method "differential_evolution". This was necessary because the new version of _refine_orientation_pc_objective_function() in indexing\_refinement\_objective_functions.py requires the instatiation of an EBSDDetector and thus the subsequent calculation of its gnomonic_bounds. If pc is (0, 0, 0), this leads to strange results which cause errors in the function _get_direction_cosines_for_fixed_pc() in signals\util\_master_pattern.py. Adding the trust region (same parameters as in the earlier call to s.refine_orientation_projection_centre() within the same test function) solves this problem. The test test_refine_orientation_pc_pseudo_symmetry_scipy() now passes, as do ALL the tests in tests/test_indexing/test_ebsd_refinement.py. Signed-off-by: tgwoodcock --- tests/test_indexing/test_ebsd_refinement.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_indexing/test_ebsd_refinement.py b/tests/test_indexing/test_ebsd_refinement.py index 68a6f1b7..a1a31bb4 100644 --- a/tests/test_indexing/test_ebsd_refinement.py +++ b/tests/test_indexing/test_ebsd_refinement.py @@ -1220,6 +1220,7 @@ def test_refine_orientation_pc_pseudo_symmetry_scipy(self): # Global: Differential evolution _, _ = s.refine_orientation_projection_center( method="differential_evolution", + trust_region=[2, 2, 2, 0.05, 0.05, 0.05], navigation_mask=nav_mask, **ref_kw, )