pyxem / kikuchipy

Toolbox for analysis of electron backscatter diffraction (EBSD) patterns
https://kikuchipy.org
GNU General Public License v3.0
79 stars 30 forks source link

Add option to refine EBSD orientations/PC with NLopt #582

Closed hakonanes closed 1 year ago

hakonanes commented 1 year ago

Description of the change

This PR adds the option to refine EBSD orientations/PC with the NLopt package. It's Nelder-Mead implementation gives comparable results to SciPy's implementation but faster, often giving a > 2x speed-up.

Because of this speed-up and (in my opinion) better control of refinement parameters like control variable bounds and initial steps, I'd like to make NLopt's Nelder-Mead the default. However, the latest release was in March, and there are open issues about installation problems on M1 Macs (conda seems to be fine) and whether it supports Python 3.11 (it doesn't as of now). I've instead added NLopt as an optional dependency via pip install kikuchipy[opt].

Other changes:

Progress of the PR

Minimal example of the bug fix or new feature

I'll link to the pattern matching tutorial notebook in the docs built from this PR once I've updated it to show use of NLopt.

For reviewers