fix: numpy 2.0 compatybility (array.max() dtype problem)#150
Merged
luispedro merged 1 commit intoluispedro:mainfrom Jul 16, 2024
Merged
fix: numpy 2.0 compatybility (array.max() dtype problem)#150luispedro merged 1 commit intoluispedro:mainfrom
array.max() dtype problem)#150luispedro merged 1 commit intoluispedro:mainfrom
Conversation
Owner
|
Thanks! And really I appreciate that you added a test too! |
Czaki
added a commit
to 4DNucleome/PartSeg
that referenced
this pull request
Jul 16, 2024
…lem (#1150) Workaround for luispedro/mahotas#150 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved image rescaling logic to enhance visual representation accuracy. - **Tests** - Reordered test items for better organization and efficiency based on file paths. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found in my tests that since numpy 2.0 the
data.max()returns the same dtype as array data.So for array of type np.uint8 and max value 255 it leads to create cmat of size 0, 0.
This PR converts size to int before increasing it by 1.