-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make kikuchipy compatible with PyEBSDIndex 0.2 #652
Conversation
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
…d PSO from PyEBSDIndex 0.2 Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
@hakonanes Have you considered adding https://github.com/apps/review-notebook-app to kikchipy. It is fairly good at showing diffs for jupyter notebooks? I can review this if you want someone to (superficially) look at the changes. |
Thanks for the suggestions, @CSSFrancis. I'll consider ReviewNB. I'll ask you for a review once the PR's ready! |
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
0f354b5
to
8c9b16a
Compare
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
… of phase lists compatibility Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
…e syntax Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
@CSSFrancis, this work is ready for merging. If you want to have a quick look, that would be very much appreciated! I plan to merge tomorrow Friday. I'll get to reviewing and answering your stuff in orix, diffsims, and pyxem shortly! The only outward API changes are the possibility to (listed in the changelog):
Other changes:
|
And thank you for suggesting ReviewNB. It sure beats me comparing the changes to rendered tutorial pages in current docs and the newly built docs from a PR by eye! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hakonanes The code looks good here! I'll try and go through the Jupyter notebooks as well. I added a couple of suggestions, but none of them are things that would stop this from merging. Seems like a good addition!
List of phases. The list must correspond to the phase list | ||
in the passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List of phases. The list must correspond to the phase list | |
in the passed. | |
List of phases. The list must correspond to the passed phase list argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our code style says:
Comment lines should preferably be limited to 72 characters.
I consider docstrings to be comment lines. I'll update this sentence in the docs to make this clearer.
# Check indexer (but not the reflectors) | ||
_ = _indexer_is_compatible_with_kikuchipy( | ||
indexer, sig_shape, nav_size, raise_if_not=True | ||
) | ||
if indexer.phaselist != phase_list_pei: | ||
raise ValueError( | ||
f"`indexer.phaselist` {indexer.phaselist} and the list determined from" | ||
f" `phase_list` {phase_list_pei} must be the same" | ||
) | ||
_ = _phase_lists_are_compatible(phase_list, indexer, raise_if_not=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these functions take any decent time you could consider caching the results but if they are quick I wouldn't worry about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An IPython %timeit returned:
_indexer_is_compatible_with_kikuchipy()
: 1.61 us +/- 264 ns_phase_lists_are_compatible()
: 54 us +/- 1.51 us
These Hough indexing methods of the EBSD class are not meant to be called hunderds of times in a loop, so I think this is OK.
@@ -53,6 +50,9 @@ jobs: | |||
name: ${{ matrix.os }}-py${{ matrix.python-version }}${{ matrix.LABEL }} | |||
runs-on: ${{ matrix.os }} | |||
timeout-minutes: 15 | |||
env: | |||
MPLBACKEND: agg | |||
PYTEST_ARGS: --pyargs kikuchipy --reruns 2 -n 2 --cov=kikuchipy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific test or reason to add in the reruns? It might be better to just add the @pytest.mark.flaky(reruns=2)
to the tests which are flaky and might fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the reason was a flaky test on a macOS run (here). The test check availability of datasets on Zenodo. I've experienced some flaky-ness in the past, so I figured this change was overdue.
Co-authored-by: Carter Francis <csfrancis@wisc.edu>
Now that you've both reviewed and contributed to the docs, is it OK if I add you to the package credits? This includes the
|
…2 characters Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
I plan to release 0.9.0 once this PR is merged and some other smaller things are done 🚀 |
Yea that works for me :) |
Description of the change
This PR aims at making kikuchipy compatible with just released PyEBSDIndex v0.2.0 and to exploit its many new features. New features of main interest are:
kikuchipy v0.8.* has PyEBSDIndex as an optional dependency with a compatible release specification (
~= 0.1.2
), so people installing this release from PyPI will only get PyEBSDIndex v0.1.2. However, our conda-forge feedstock only asks for>= 0.1.2
... People installing from conda-forge will most likely get PyEBSDIndex v0.2.0, which does not work with the current kikuchipy release. A big problem. So we should get this merged and released as 0.9.0 quickly. I plan to get this done within Tuesday next week.Progress of the PR
What we should do but perhaps don't have time:[ ] Add patterns from crystals having symmetries from all Laue classes to the data module[ ] Test HI of these new patterns[ ] Add examples showing how to index each of these patterns to the docsFor reviewers
__init__.py
.section in
CHANGELOG.rst
.release.py
,.zenodo.json
and.all-contributorsrc
with the table regenerated.