-
-
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
Add a benchmark for img_as #4269
base: main
Are you sure you want to change the base?
Conversation
Hello @hmaarrfk! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2019-11-04 13:18:59 UTC |
@hmaarrfk You included notebook, i guess it is unattended. |
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.
I'm just worried that one function will fail (without testing). Besides that, I'm +1.
return self.image.astype(dtype_out) | ||
elif (np.issubdtype(dtype_in, np.floating) | ||
and np.issubdtype(dtype_out, np.integer)): | ||
imax = np.iinfo(dtype_out).max |
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.
I looked at this function np.iinfo and looks like it is working only with interger dtypes. In skimage.util.dtype, we also have the range specifications. Perhaps you can use that.
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.
dtype_out
is guaranteed to be an integer at this point.
I guess I'm trying to replicate the rint function. I've tested this internally, and it works quite well. I used linspace with about 1E6 points to see how the two compare for uint16 data types.
benchmark coverage was proposed in #3329 Probably needs a rebase and moving it to Azure? |
Description
I included naive implementations below. They probably aren't the best, but they would be what I would use if I were to roll my own.
xref: #4268
Checklist
./doc/examples
(new features only)./benchmarks
, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py
.doc/release/release_dev.rst
.@meeseeksdev backport to v0.14.x