Add CTF file reader and interactive crystal map plot example
Description of the change
Following up #412, added a file reader for Oxford AZtec HKL .ctf file. Added an example jupyter notebook for interactive plotting - clicking on an IPF map to retrieve phase name and Euler angles.
Progress of the PR
- [x] Docstrings for all functions
- [x] Unit tests with pytest for all lines
- [x] Clean code style by running black via pre-commit
Minimal example of the bug fix or new feature
>>> from orix import io
>>> xmap = io.load("data.ctf")
>>> xmap
Phase Orientations Name Space group Point group Proper point group Color
-1 8358 (2.5%) not_indexed None None None w
1 322978 (97.5%) Iron fcc Fm-3m m-3m 432 tab:blue
Properties: bands, error, MAD, BC, BS
Scan unit: um
For reviewers
- [x] The PR title is short, concise, and will make sense 1 year later.
- [x] New functions are imported in corresponding
__init__.py. - [x] New features, API changes, and deprecations are mentioned in the unreleased
section in
CHANGELOG.rst. - [ ] Contributor(s) are listed correctly in
__credits__inorix/__init__.pyand in.zenodo.json.
Thank you so much for your time on reviewing my changes @hakonanes. A lot of very helpful suggestions!
I just realize some of the test did not pass. I'll work on the test code.
@IMBalENce, do you think we could finish this work? If you don't have time, no worries, I can look at finishing myself.
@hakonanes Sorry for taking so long. It was a bit hectic lately. I'll do my best to work this out in two weeks.
No problem! I've been off development myself lately.
@hakonanes I tried my best to address each of your comments. I think most should be ok now.
I also found some issue in running pytest and can get stuck in test_io.test_load_unsupported_format. To pass all test, I temporarily comment out this section. I was wondering what would be the best practice here?
Additionally, I'm still working on the test coverage on this ctf reader. I'm hoping to complete it in a day or two.
I also found some issue in running pytest and can get stuck in test_io.test_load_unsupported_format.
By stuck, do you mean that pytest hangs? Or that you get an error? It would be great if you could open an issue. We'd be much closer to a solution, then!
Any movement on this lately? I can take a shot at debugging the failing test if that is helpful. Is that that only thing that is blocking this from merging?
@IMBalENce The failing test is related to the fact that there used to be a warning for trying to read a .ctf file.
(And now you can!)
pre-commit.ci autofix
@CSSFrancis Sorry for the delay in moving this forward again. Thank you for the tips. I'm testing it now. Will get it back soon.
I'm ready to help and review, btw.
@IMBalENce, I'm looking over the PR now. I have a few suggestions for changes. I'll make a PR to your branch if that's OK.
@IMBalENce, I'm looking over the PR now. I have a few suggestions for changes. I'll make a PR to your branch if that's OK.
Thank you @hakonanes. Have just merged your changes.
This should now be done. Could you have a brief look at my latest changes, @IMBalENce? These are the changes since you merged my PR to your branch: https://github.com/pyxem/orix/compare/2b3b7f0337f5a9d6b4171c99074352666c28ccd4...a68d37e3e3c50063ba3fb918e560db6f11b20c17.
Thank you, @hakonanes. It looks great!
Fantastic, thanks for having a look, @IMBalENce!