Skip to content

Conversation

@CSSFrancis
Copy link
Member

Description of the change

This should fix (part) of the problems upstream with pyxem/diffsims#211 by allowing the function get_kwargs to be overwritten in subclasses and change the order/what is passed to the init fuction.

Minimal example of the bug fix or new feature (This now works)

from orix.crystal_map import Phase
from orix.quaternion import Rotation
from diffsims.crystallography import ReciprocalLatticeVector


phase = Phase(point_group="m-3m")
g = ReciprocalLatticeVector(phase, [1, 1, 1])

R = Rotation.random()
g1 = R * g

# CHanges to RLV
# ---------------- 

    def get_kwargs(self, new_data, *args, **kwargs):
        return dict(phase=self.phase, xyz=new_data)

For reviewers

  • The PR title is short, concise, and will make sense 1 year later.
  • New functions are imported in corresponding __init__.py.
  • New features, API changes, and deprecations are mentioned in the unreleased
    section in CHANGELOG.rst.
  • Contributor(s) are listed correctly in __credits__ in orix/__init__.py and in
    .zenodo.json.

@hakonanes
Copy link
Member

Thanks for suggesting a fix to the issue in diffsims. But, I've raised some doubts regarding our approach in the referenced issue pyxem/diffsims#211 (comment).

@CSSFrancis
Copy link
Member Author

@hakonanes I think this should be possible. It works quite nicely with everything and makes the logic much simpler. Otherwise we end up having to struggle to track the rotation alongside the RLV from diffsims --> pyxem and it gets complicated.

@CSSFrancis CSSFrancis added the status: waiting-for-author This pull request has comments the author must address label Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-author This pull request has comments the author must address

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants