Closed viljarjf closed 6 months ago
@viljarjf would you be comfortable writing a test case for this? If so, I'll wait for that and then get my crystallography hat on to check this works as it needs to.
@viljarjf I would just add the example in as a test. It at least makes sure that we explicitly know what basis we are working in and if for some reason diffpy changes then we would know.
I added a test now, a cubic lattice passes with the old code but the two non-cubic lattices failed. All three pass with the fix
@viljarjf Just a note that you need to run both black and isort, let me know if you need help doing that. @pc494 do you want to allow pre-commit similar to pyxem
so we can just auto-fix files. I think that is much easier.
As far as the failing tests go. They seem unrelated. @pc494 You can rerun the tests if you would like and it might allow them to pass otherwise there is a different bug.
Both,
I'm going to check this out today to refactor the testing a little bit and I'll get isort + black etc run then as well.
@pc494 This needs to be added to the Changelog as well
pre-commit.ci autofix
@hakonanes I tested this vs Kikchipy and the tests appear to be passing.
@pc494 any idea why the documentation is failing?
I'm going to tidy this up with a view to merge later today. Hopefully, the docs will figure themselves out,..
pre-commit.ci autofix
Given the current state of play, I am going to merge this, with new issues raised about both the RTD build and the contributors list.
Fixes (part of) https://github.com/pyxem/diffsims/issues/203
Description of the change
When initializing a
Phase
with adiffpy.structure.Structure
, the lattice is transformed to orix's standard coordinate system. However, the atoms are still expressed as if they were in the old lattice. By taking the cartesian positions of the atoms before changing the lattice, and using those to set the new positions, the change of basis is accounted for.All tests pass, but I don't think this was tested for previously. It probably should.
Progress of the PR
Minimal example of the bug fix or new feature
Output before:
Output with this PR:
For reviewers
__init__.py
.CHANGELOG.rst
.__credits__
inorix/__init__.py
and in.zenodo.json
.