-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Remove np.bool8 support (deprecated) #6633
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -909,7 +909,7 @@ cdef class Cascade: | |
feature_number = int(internal_nodes[0]) | ||
# list() is for Python3 fix here | ||
lut_array = list(map(lambda x: int(x), internal_nodes[1:])) | ||
lut = np.asarray(lut_array, dtype='uint32') | ||
lut = np.array(lut_array).astype(np.uint32) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this change important? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
# Copy array to the main LUT array | ||
for i in range(8): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,7 +114,7 @@ def test_relabel_sequential_signed_overflow(): | |
|
||
|
||
def test_very_large_labels(): | ||
imax = np.iinfo(np.int64).max | ||
imax = np.iinfo(np.int32).max | ||
labels = np.array([0, 1, imax, 42, 42], dtype=np.int64) | ||
output, fw, inv = relabel_sequential(labels, offset=imax) | ||
assert np.max(output) == imax + 2 | ||
Comment on lines
116
to
120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I'm misunderstanding what was intended by this test, but if we specify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were these relative tolerances set empirically or some other way? The tests fail for only the first entry in
dE2
with numpy v1.24.0.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty sure it is empirical (I think I added the 1e-2 for float32 at some point, but not sure about the original choice of 1e-4). I don't know why this particular function seems to have relatively low precision.