Skip to content

Commit

Permalink
Force EBSD detector shape to be Python ints in repr
Browse files Browse the repository at this point in the history
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
  • Loading branch information
hakonanes committed Nov 9, 2024
1 parent ad07063 commit 52346c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/kikuchipy/detectors/ebsd_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,14 @@ def __init__(
def __repr__(self) -> str:
decimals = 3
pc_average = tuple(map(float, self.pc_average.round(decimals)))
shape = tuple(map(int, self.shape))
sample_tilt = np.round(self.sample_tilt, decimals)
tilt = np.round(self.tilt, decimals)
azimuthal = np.round(self.azimuthal, decimals)
px_size = np.round(self.px_size, decimals)
return (
f"{type(self).__name__}"
f"(shape={self.shape}, "
f"(shape={shape}, "
f"pc={pc_average}, "
f"sample_tilt={sample_tilt}, "
f"tilt={tilt}, "
Expand Down
4 changes: 2 additions & 2 deletions src/kikuchipy/signals/_kikuchipy_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ def normalize_intensity(
>>> import kikuchipy as kp
>>> s = kp.data.nickel_ebsd_small()
>>> np.mean(s.data)
146.0670987654321
np.float64(146.0670987654321)
>>> s.normalize_intensity(dtype_out=np.float32)
>>> np.mean(s.data)
0.0
np.float32(0.0)
"""
if lazy_output and inplace:
raise ValueError("'lazy_output=True' requires 'inplace=False'")
Expand Down

0 comments on commit 52346c1

Please sign in to comment.