WIP: Remove inconsistencies in scipy.misc / scipy.ndimage#7259
WIP: Remove inconsistencies in scipy.misc / scipy.ndimage#7259MartinThoma wants to merge 1 commit intoscipy:masterfrom MartinThoma:image-misc
Conversation
|
There is still quite a bit to be done for this one. However, I wanted to make this pull request to run the tests (when I execute |
|
Could somebody please explain why importing |
| __all__ = ['fromimage', 'toimage', 'imsave', 'imread', 'bytescale', | ||
| 'imrotate', 'imresize', 'imshow', 'imfilter'] | ||
|
|
||
| from ndimage import imresize, imfilter, imrotate |
There was a problem hiding this comment.
This doesn't look right, should be from scipy.ndimage ....
|
|
||
| from ndimage import imresize, imfilter, imrotate | ||
| imresize = numpy.deprecate(imresize, | ||
| message='misc.imresize is deprecated in Scipy 1.0') |
There was a problem hiding this comment.
Can you add that the function was moved to ndimage in the message?
There was a problem hiding this comment.
gh-6242 had some discussion on whether these functions shouldn't just be deprecated unconditionally (#6242 (comment)). There's something to say for that. Good to get a decision on that first.
That'll be fixed if you correct the |
|
I suggest to work on the move of Need some opinions on the other ones - move to |
* Move scipy.misc.imfilter to scipy.ndimage.imfilter * Move scipy.misc.imresize to scipy.ndimage.imresize * Move scipy.misc.imrotate to scipy.ndimage.imrotate Fixes #6242
|
I like deprecate too. If we were to want similar functions in |
|
We're not going to get to the |
Changing my mind, it's an awful mess. We should just get all the deprecations in. |
The reasons for these deprecations are: 1. Many of the functions have bugs and unexpected behavior. 2. There are better alternatives for pretty much every function. Summary of issues: - ``imsave`` rescales images (scipygh-5305) - ``imresize`` rescales images (scipygh-4458) and casts to different dtype (scipygh-6417) - Many functions suffer from a shape handling bug for (3, 100, 3) RGB and (4, 100, 4) RGBA images (scipygh-2347) - ``toimage`` is the root cause of casting and scaling issues, one more separate bug report at scipygh-2300 - ``imfilter``, ``imrotate`` and ``imshow`` don't have a bug reported against them, but suffer from casting/rescaling as well. The functions that seem sort of OK: - ``imread``. Exposed also as ``ndimage.imread``. Want to move to ``scipy.io`` Also note the discussion in scipy#6242 (comment) about ``imsave``. Want to rename to ``imwrite`` and move to ``scipy.io`` (or write a new one without the rescaling issues and put that in ``io``). - ``fromimage``. Changes PIL image to ndarray. - ``bytescale``. Does some simple scaling of range of an array. Closes scipygh-2347 Closes scipygh-2300 Closes scipygh-2442 Closes scipygh-3154 Closes scipygh-4458 Closes scipygh-4893 Closes scipygh-5305 Closes scipygh-6242 Closes scipygh-6417 Closes scipygh-7259 Closes scipygh-7458 See discussion about introducing scipy.io.imread/imwrite in http://thread.gmane.org/gmane.comp.python.scientific.devel/20063 I didn't actually do that here, seems duplicate with matplotlib, scikit-image, etc. Can always be done separately if deemed a good idea. See also PR scipygh-5458 that make an attempt at this.
The reasons for these deprecations are: 1. Many of the functions have bugs and unexpected behavior. 2. There are better alternatives for pretty much every function. Summary of issues: - ``imsave`` rescales images (scipygh-5305) - ``imresize`` rescales images (scipygh-4458) and casts to different dtype (scipygh-6417) - Many functions suffer from a shape handling bug for (3, 100, 3) RGB and (4, 100, 4) RGBA images (scipygh-2347) - ``toimage`` is the root cause of casting and scaling issues, one more separate bug report at scipygh-2300 - ``imfilter``, ``imrotate`` and ``imshow`` don't have a bug reported against them, but suffer from casting/rescaling as well. The functions that seem sort of OK: - ``imread``. Exposed also as ``ndimage.imread``. Want to move to ``scipy.io`` Also note the discussion in scipy#6242 (comment) about ``imsave``. Want to rename to ``imwrite`` and move to ``scipy.io`` (or write a new one without the rescaling issues and put that in ``io``). - ``fromimage``. Changes PIL image to ndarray. - ``bytescale``. Does some simple scaling of range of an array. Closes scipygh-2347 Closes scipygh-2300 Closes scipygh-2442 Closes scipygh-3154 Closes scipygh-4458 Closes scipygh-4893 Closes scipygh-5305 Closes scipygh-6242 Closes scipygh-6417 Closes scipygh-7259 Closes scipygh-7458 See discussion about introducing scipy.io.imread/imwrite in http://thread.gmane.org/gmane.comp.python.scientific.devel/20063 I didn't actually do that here, seems duplicate with matplotlib, scikit-image, etc. Can always be done separately if deemed a good idea. See also PR scipygh-5458 that make an attempt at this.
|
Thanks for having a go at this @MartinThoma! We're deprecating the pilutil functions instead of moving them, so I'm closing this PR. |
Fixes #6242