Skip to content

Commit 4efe618

Browse files
committed
Revert "Replace dtype (uint8 or uint16) with dtype int"
I don't think I agree with the commit this reverts (922710f). Yes, you can technically pass dtype=np.int64 or similar as an `image`. But this will incur precision loss and a warning, urging you to convert to uint16 before. This seems unexpected in context of dtype int. The reason we are doing this is so that type checkers can be useful and can catch issue like this beforehand. They won't if we use int here. Instead, I think we should treat this as an undocumented backwards compatible fallback.
1 parent cd0f6fa commit 4efe618

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/skimage/filters/rank/_percentile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def gradient_percentile(
122122
123123
Parameters
124124
----------
125-
image : ndarray of shape (M, N) and dtype int
125+
image : ndarray of shape (M, N) and dtype (uint8 or uint16)
126126
Input image.
127127
footprint : ndarray
128128
The neighborhood expressed as a 2-D array of 1's and 0's.
@@ -167,7 +167,7 @@ def mean_percentile(
167167
168168
Parameters
169169
----------
170-
image : ndarray of shape (M, N) and dtype int
170+
image : ndarray of shape (M, N) and dtype (uint8 or uint16)
171171
Input image.
172172
footprint : ndarray
173173
The neighborhood expressed as a 2-D array of 1's and 0's.

0 commit comments

Comments
 (0)