-
Notifications
You must be signed in to change notification settings - Fork 53
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
Moved to and from class methods from Rotation to Quaternion #406
Moved to and from class methods from Rotation to Quaternion #406
Conversation
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.
Thank you for setting this up @anderscmathisen!
I've made just a few suggestions for improvements, mostly to docstring wordings I or other people originally added...
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.
Looks good. As I can see it's just one check in Quaternion.identity()
missing, and we can merge this!
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
We haven't considered that quaternions in orix are not by default unit quaternions, however rotations are unit quaternions. We ensure this by normalizing rotations upon initialization, while quaternions are not normalized. The conversions we have implemented are based on the work by Rowenhorst et al. (2015) https://doi.org/10.1088/0965-0393/23/8/083501, where they in the abstract state that the transformations in that work including quaternions concern unit quaternions. Hence, I suggest that all new
I've already done this in my fork of your branch here, @anderscmathisen, among other changes like moving some rotation tests upstream to the quaternion test file. I suggest I make a PR to your branch, merge that, and then someone else has to review this PR since it includes my work... |
Yeah, I agree with your suggestions and nice that you have implemented them in a branch. |
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>
Move to from methods
I can fix the conflicts. |
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Don't know if you've fixed lots of git conflicts @anderscmathisen, but what I did was basically (on the > git pull anderscmathisen move_to_from_methods # Update my local fork of your branch
> git merge develop
Auto-merging CHANGELOG.rst
CONFLICT (content): Merge conflict in CHANGELOG.rst
Auto-merging orix/quaternion/quaternion.py
Auto-merging orix/quaternion/rotation.py
CONFLICT (content): Merge conflict in orix/quaternion/rotation.py
Auto-merging orix/tests/quaternion/test_rotation.py
CONFLICT (content): Merge conflict in orix/tests/quaternion/test_rotation.py
Automatic merge failed; fix conflicts and then commit the result. Open the conflicting files and do the necessary changes, in this case remove the changes on > git add .
> git commit -s
> git push anderscmathisen move_to_from_methods # Update your branch |
I can add a small test covering the single line missing (https://coveralls.io/builds/53787279/source?filename=orix%2Fquaternion%2Frotation.py#L581). |
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
To ease reviewer(s) minds...:
|
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Fixed another conflict. |
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.
Sorry for the delay all, I'm happy with this. Because it's been a little while since the request, I'm going to let @hakonanes merge just in case something else has happened since that I'm not aware of.
Description of the change
Because of discussions in #401, #345 and #373, it seemed like there is a need to move the
to_
andfrom_
methods ofRotation
to theQuaternion
class. And so I have copy pasted them over.I have changed little to nothing about the methods themselves, other than changing names of variables and updated docstrings.
I did not move the
random_vonmises()
method as that would also require theangle_with
method ofRotation
class to be moved as well, and I was unsure whether that should be done or not.I included an override of
from_euler
inRotation
to keep the proper vs improper rotation notion as it was originally.Progress of the PR
Minimal example of the bug fix or new feature
For reviewers
__init__.py
.section in
CHANGELOG.rst
.__credits__
inorix/__init__.py
and in.zenodo.json
.