Skip to content
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

Inverse pole density distribution 2 #362

Merged
merged 32 commits into from
Jun 21, 2022

Conversation

harripj
Copy link
Collaborator

@harripj harripj commented Jun 3, 2022

Description of the change

This is the new PR for #355 after that PR was pre-maturely merged.

Previous PR description below

Following on from #340, it is often useful to view the pole density function (PDF) in the fundamental sector of the crystal symmetry, ie. the inverse pole density function (IPDF).

To implement this, the StereographicPlot.pole_density_function() has been updated to work with the subclass InverseStereographicPlot. When calculating PDF, the axes are checked as to whether they have a _symmetry attribute, ie. IPF, and if so the calculated PDF is folded back into the fundamental sector.

At the moment there are some issues with the implementation, regarding aliasing (during folding procedure) and the axes limits (which I may be due to QuadMesh, see plot size below), see the examples below. Grateful for any suggestions, feedback, or help regarding this!

Progress of the PR

Minimal example of the bug fix or new feature

from matplotlib import pyplot as plt
from orix import plot
from orix.quaternion import symmetry
from orix.vector import Vector3d

fig = plt.figure(figsize=(15, 5))

ax0 = fig.add_subplot(131, projection='stereographic')
ax1 = fig.add_subplot(132, projection='ipf', symmetry=symmetry.Oh)
ax2 = fig.add_subplot(133, projection='ipf', symmetry=symmetry.C6)

v = Vector3d([(-2, 0, 1), [2, 2, 1], [1, 1, 2], [0.5, -0.3, 0.2]]).unit

ax0.pole_density_function(v)
ax1.pole_density_function(v, resolution=0.25)
ax2.pole_density_function(v, resolution=0.25)

image

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.

@harripj harripj added this to the v0.10.0 milestone Jun 7, 2022
@harripj harripj added the enhancement New feature or request label Jun 7, 2022
@harripj harripj linked an issue Jun 7, 2022 that may be closed by this pull request
Copy link
Member

@hakonanes hakonanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very nice PR with robust testing and neat reusing of one function to provide the inverse pole density function calculations to three classes Vector3d, StereographicPlot and InverseStereographicPlot.

Should the IPDF be used in a user guide tutorial (notebook)? That can be left for another PR, of course, but should perhaps be done before the next release.

I've made several suggestions for changes, mostly in the docstrings and slight changes to code. Otherwise, I think this is good to go.

harripj and others added 18 commits June 18, 2022 11:14
Co-authored-by: Håkon Wiik Ånes <[email protected]>
Co-authored-by: Håkon Wiik Ånes <[email protected]>
Co-authored-by: Håkon Wiik Ånes <[email protected]>
Co-authored-by: Håkon Wiik Ånes <[email protected]>
Co-authored-by: Håkon Wiik Ånes <[email protected]>
Co-authored-by: Håkon Wiik Ånes <[email protected]>
Co-authored-by: Håkon Wiik Ånes <[email protected]>
Co-authored-by: Håkon Wiik Ånes <[email protected]>
@hakonanes
Copy link
Member

I've resolved all but one insignificant comment on comments... Feel free to ping me when you wan't a second review!

@harripj harripj requested a review from hakonanes June 18, 2022 12:19
@harripj
Copy link
Collaborator Author

harripj commented Jun 18, 2022

I've resolved all but one insignificant comment on comments... Feel free to ping me when you wan't a second review!

Thanks, I had missed a couple abbreviations in the inline comments- this should be good for a second look!

Copy link
Member

@hakonanes hakonanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a couple of things that should be changed, sorry for missing these in the first review.

harripj and others added 3 commits June 18, 2022 14:50
Co-authored-by: Håkon Wiik Ånes <[email protected]>
Copy link
Member

@hakonanes hakonanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very good to me! Will let you merge once all checks pass and you're happy.

@harripj
Copy link
Collaborator Author

harripj commented Jun 21, 2022

Thanks for the review @hakonanes, I am happy with this. I will just wait to see if @pc494 has any comments on #351, as you commented, before merging.

@pc494
Copy link
Member

pc494 commented Jun 21, 2022

Apologies for the delay. I think measure is a fine name for this sort of functionality. Feel free to merge @hakonanes

@harripj harripj merged commit 8d78b56 into pyxem:develop Jun 21, 2022
@harripj harripj deleted the inverse-pole-density-distribution branch June 23, 2022 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access pole density function results outside of plot
3 participants