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

Add option to return new (possibly lazy) signal instead of operating inplace #605

Merged
merged 10 commits into from
Feb 9, 2023

Conversation

hakonanes
Copy link
Member

Description of the change

This PR adds the option to pass inplace=False to many methods, like EBSD.remove_static_background() or EBSDMasterPattern.rescale_intensity(). Most methods also support to return a lazy signal instead of one in memory via lazy_output=True.

A LazyVirtualBSEImage class is added for use with mostly VirtualBSEImage.rescale_intensity(inplace=False, lazy_output=True).

Progress of the PR

Minimal example of the bug fix or new feature

>>> import kikuchipy as kp
>>> s = kp.data.nickel_ebsd_small()

# Before

>>> s2 = s.deepcopy()
>>> s2.remove_static_background()

# Now

>>> s2 = s.remove_static_background(inplace=False)

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.
  • New contributors are added to release.py, .zenodo.json and
    .all-contributorsrc with the table regenerated.

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>
…hods

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>
@hakonanes hakonanes added the enhancement New feature or request label Feb 9, 2023
@hakonanes hakonanes added this to the v0.8.0 milestone Feb 9, 2023
@hakonanes hakonanes merged commit 5c603e5 into pyxem:develop Feb 9, 2023
@hakonanes hakonanes deleted the add-inplace-lazy-result branch February 9, 2023 10:46
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.

None yet

1 participant