Closed hakonanes closed 7 months ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
I'm sorry for the size of this PR. If necessary, I can split it into several smaller ones.
Nonetheless, everything is detailed in the top comment. And notebook changes can easily be reviewed at ReviewNB.
I am happy to review this over the weekend.
Thank you for having a look, Phillip, really appreciate it. Yes, I'll make coming PRs much more manageable.
Description of the change
This PR contains several improvements, most notably adding a consistent mathematical notation. I realize that capitalized variable names, especially just
O
(for orientations), are frowned upon. Just see the PEP 8 style guide which we follow closely... I'm open to changing the notation. The notation is listed in the contributing guide.Other additions:
Vector3d.random()
andMiller.random()
(acceptingphase
) returning unit vectors. Achieved by moving the currentrandom()
implementation fromQuaternion
toObject3d
.Orientation.random()
andMisorientation.random()
acceptsymmetry
arguments. The returned unit (mis)orientations are not reduced to the fundamental zone. This could be added with a boolean parameter.inv()
method forQuaternion
,Rotation
,Orientation
, andMisorientation
. Its behavior is identical to the inversion operator~
. For misorientations, it also swaps the symmetries, in line with inverting the direction of the basis transformation. Convenient for chaining operations instead of adding parentheses (~M) etc.orix.base
module and moved theObject3d
andDimensionError
classes toorix._base
. This module should never have been part of the public API in the first place. It will now be hidden from the API.reshape()
method of 3D objects. This has bugged me, that we have unpack a tuple of integers when reshaping an object. It is now unnecessary. We can pass (1) a single tuple, or (2) multiple integers as separate "arguments" (*args
).Changes:
random()
method no longer accepts a list as a valid shape (a tuple or integer is required). This is in line with NumPy'srandom()
function.plt.figure(layout="tight")
when creating figures internally.to_*()
methods, if anyAxes
orAxes3D
got cluttered with unnecessary attributes and methods. I've added a hook intoautodoc
calledautodoc-skip-member
that tries its best to include only attributes/properties and methods that are defined in orix.Progress of the PR
Vector3d.random()
orsample_S2_random_mesh()
should be used: Let's do this in a separate PRMinimal example of the bug fix or new feature
For reviewers
__init__.py
.CHANGELOG.rst
.__credits__
inorix/__init__.py
and in.zenodo.json
.