Skip to content

Prefer imageio over PIL for file manipulations. - #3126

Merged
sciunto merged 1 commit into
scikit-image:masterfrom
hmaarrfk:bugfix_prefer_imageio_over_PIL
Jul 27, 2018
Merged

sciunto merged 1 commit into
scikit-image:masterfrom
hmaarrfk:bugfix_prefer_imageio_over_PIL

Conversation

@hmaarrfk

@hmaarrfk hmaarrfk commented May 30, 2018 •

Copy link
Copy Markdown
Member

Fixes #2889

Without imageio installed

> ipython                                                                      (sk) 
Python 3.6.5 | packaged by conda-forge | (default, Apr  6 2018, 13:39:56) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import skimage.io

In [2]: skimage.io.reset_plugins()

In [3]: skimage.io.find_available_plugins(True)
Out[3]: 
{'pil': ['imread', 'imsave', 'imread_collection'],
 'matplotlib': ['imshow', 'imread', 'imshow_collection', 'imread_collection']}

After I installed imageio:

> ipython                                                                      (sk) 
Python 3.6.5 | packaged by conda-forge | (default, Apr  6 2018, 13:39:56) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import skimage.io

In [2]: skimage.io.reset_plugins()

In [3]: skimage.io.find_available_plugins(True)
Out[3]: 
{'imageio': ['imread', 'imsave', 'imread_collection'],
 'matplotlib': ['imshow', 'imread', 'imshow_collection', 'imread_collection']}

We need to choose a minimum version. Here is the release history

Checklist

[It's fine to submit PRs which are a work in progress! But before they are merged, all PRs should provide:]

References

[If this is a bug-fix or enhancement, it closes issue # ]
[If this is a new feature, it implements the following paper: ]

For reviewers

(Don't remove the checklist below.)

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.
  • Check that new features, API changes, and deprecations are mentioned in
    doc/release/release_dev.rst.

@hmaarrfk

Copy link
Copy Markdown
Member Author

@stefanv should I add imageio to the default requirements instead of Pillow?

@codecov-io

codecov-io commented May 30, 2018 •

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@29e22f7). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3126   +/-   ##
=========================================
  Coverage          ?   86.75%           
=========================================
  Files             ?      339           
  Lines             ?    27311           
  Branches          ?        0           
=========================================
  Hits              ?    23695           
  Misses            ?     3616           
  Partials          ?        0
Impacted Files Coverage Δ
skimage/io/manage_plugins.py 87.4% <ø> (ø)
skimage/io/_io.py 87.23% <ø> (ø)
skimage/io/tests/test_collection.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29e22f7...a5818a6. Read the comment docs.

@hmaarrfk hmaarrfk changed the title Prefers imageio over PIL for file manipulations. Prefer imageio over PIL for file manipulations. May 31, 2018
Comment thread requirements/default.txt Outdated
matplotlib>=2.0.0
networkx>=2.0
pillow>=4.3.0
imageio>=2.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be mentioned in doc/release/release_dev.something.

@soupault soupault added this to the 0.15 milestone May 31, 2018
@soupault soupault added 🔧 type: Maintenance Refactoring and maintenance of internals 🧐 Needs review labels May 31, 2018
@hmaarrfk
hmaarrfk force-pushed the bugfix_prefer_imageio_over_PIL branch 2 times, most recently from 5e7f6b7 to fbee800 Compare May 31, 2018 20:44
@hmaarrfk

Copy link
Copy Markdown
Member Author

@jni can you restart this travis build please. I force removed a later commit and travis won't start on this.

@hmaarrfk
hmaarrfk force-pushed the bugfix_prefer_imageio_over_PIL branch 2 times, most recently from a2ec45f to 1691638 Compare June 6, 2018 05:41
@hmaarrfk hmaarrfk mentioned this pull request Jun 9, 2018
11 of 15 tasks
@sciunto

sciunto commented Jun 30, 2018

Copy link
Copy Markdown
Member

I'm +1 with the move. @hmaarrfk It needs a rebase please.

@hmaarrfk
hmaarrfk force-pushed the bugfix_prefer_imageio_over_PIL branch from a660b9a to b406aea Compare June 30, 2018 15:27
@hmaarrfk

Copy link
Copy Markdown
Member Author

@sciunto I think the failures now are due to the pre build. I simplified the changes as many of the other ones were folded into #3231 that only makes modifications to the build scripts.

Feel free to squash merge if you wish.

@sciunto
sciunto requested a review from stefanv July 2, 2018 04:55
@sciunto

sciunto commented Jul 26, 2018

Copy link
Copy Markdown
Member

@scikit-image/core Opinion on this?

@jni jni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm 👍 on this. Thanks @hmaarrfk!

@blink1073

Copy link
Copy Markdown
Contributor

👍 from me as well.

@soupault

soupault commented Jul 26, 2018 •

Copy link
Copy Markdown
Member

@blink1073 well, well, well 🕵️‍♂️ . Nice emeritus we have over there 😄 .

On topic: I'm +1 on the change (one more related issue is #1605, btw).
@hmaarrfk have you checked that the gallery examples aren't affected?

@sciunto

sciunto commented Jul 26, 2018

Copy link
Copy Markdown
Member

@soupault I checked and nothing seems frankly different.

@hmaarrfk
hmaarrfk force-pushed the bugfix_prefer_imageio_over_PIL branch from b406aea to a5818a6 Compare July 26, 2018 16:19
@hmaarrfk

Copy link
Copy Markdown
Member Author

I just rebased and squashed to trigger a rebase.

Fixes scikit-image#2889

- Make imageio a core requirement
- imageio subclasses ndimage. Must take that into account in tests
- Include a mention of imageio in the release doc
@sciunto

sciunto commented Jul 27, 2018

Copy link
Copy Markdown
Member

We have several positive comments, so I merge :) Thanks @hmaarrfk !

@hmaarrfk
hmaarrfk deleted the bugfix_prefer_imageio_over_PIL branch November 4, 2018 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧐 Needs review 🔧 type: Maintenance Refactoring and maintenance of internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: skimage.io.imdecode

6 participants