Emit error in structural_similarity when data_range is not specified in case of floating point data.#6612
Emit error in structural_similarity when data_range is not specified in case of floating point data.#6612grlee77 merged 4 commits intoscikit-image:mainfrom mcourteaux:main
Conversation
…. Emit warnings when integers other than uint8.
|
I'm facing a broken test, due to the SSIM being used to validate the equality of total variation denoising, but due to not specifying scikit-image/skimage/restoration/tests/test_denoise.py Lines 165 to 180 in e68ff34 Now I don't know if the test should pass, and the threshold should be lowered to 0.98, or this test was broken and now we discover a bug in this test/code. @ahojnnes @mkcor @grlee77: you are all authors of the lines of this test, according to git blame. Can you have a look? |
… Fix a broken test that was using structural_similarity incorrectly;
|
For now I lowered the threshold to 0.98 to just be able to run all tests with GH actions. |
|
Seems reasonable to me. I hope one of those authors can take a look soon, just to confirm, then we can get this in. Thank you very much for spotting and fixing this issue, @mcourteaux! |
|
Hi @mcourteaux, thank you so much for this follow-up PR! Test The bug was in the Reviewing now! |
mkcor
left a comment
There was a problem hiding this comment.
Thank you, @mcourteaux! Your contribution is bringing such a great improvement. I've left suggestions which are essentially stylistic. Happy to approve after you've addressed them!
| dmin, dmax = dtype_range[im1.dtype.type] | ||
| data_range = dmax - dmin | ||
| if np.issubdtype(im1.dtype, np.integer) and (im1.dtype != np.uint8): | ||
| warn("Setting data_range based on im1.dtype. " + |
There was a problem hiding this comment.
Unrelated to this PR, but I'm just frustrated we still have im1, im2 around... cf. https://github.com/scikit-image/scikit-image/pull/4187/files#r329088276
|
Applied your suggestions, @mkcor. I guess the only thing left to do is the checklist for reviewers, regarding change notes etc. |
|
What's the plan? Is it normal it's not merged yet? |
|
Hi @mcourteaux, I think that's because we are in between funding programs (and, hence, contracts), so we are currently short on manpower! cf. https://blog.scientific-python.org/scientific-python/2022-czi-grant/ @stefanv if you could have a look 🙏 |
grlee77
left a comment
There was a problem hiding this comment.
Thanks @mcourteaux, this looks great. I will commit the suggested small whitespace fixes then should be able to merge.
|
Cool! Thanks everyone! Happy to have contributed something of this type to the scientific community. 😄 |
Additionally, emit warnings when integers other than uint8 are used.
Description
Closes #6602.
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.example, to backport to v0.19.x after merging, add the following in a PR
comment:
@meeseeksdev backport to v0.19.xrun-benchmarklabel. To rerun, the labelcan be removed and then added again. The benchmark output can be checked in
the "Actions" tab.