Skip to content

MAINT: Deprecation warnings to transition to v3 - #769

Merged
FirefoxMetzger merged 35 commits into
imageio:masterfrom
FirefoxMetzger:deprecation-warnings
Apr 8, 2022
Merged

FirefoxMetzger merged 35 commits into
imageio:masterfrom
FirefoxMetzger:deprecation-warnings

Conversation

@FirefoxMetzger

@FirefoxMetzger FirefoxMetzger commented Mar 25, 2022 •

Copy link
Copy Markdown
Contributor

This PR adds deprecation warnings to inform users about API changes that will happen once take the step to v3 and how to deal with them.

It also reformats our testsuite to deal with the warnings by

  • switching from import imageio to import imageio.v2 as iio where applicable
  • adding a deprecated_test fixture that suppresses warnings for tests that will be removed when deprecated functions disappear (mainly related to the old format manager)
  • consistently using iio throughout the test-suite

Comment thread imageio/plugins/pillow_legacy.py Resolved
Comment on lines +178 to +183
warnings.warn(
"ImageIO's vendored tifffile backend is deprecated and will be"
" removed in ImageIO v3. Install the tifffile directly:"
" `pip install imageio[tifffile]`",
DeprecationWarning
)

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.

Dito, under what circumstances does this warning occur?

@FirefoxMetzger FirefoxMetzger Mar 28, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will occur if a user loads a TIFF file and doesn't have tifffile installed.

I'm not 100% sure if we are making tifffile a primary dependency once we remove this. You will probably say we should, and the bioinformatics community will use it a lot, but for other scenarios it is rather optional. In most cases, it won't hurt to have it anyway but considering that there are use-cases with space concerns (e.g. the recently discussed freezing of apps) it might be better to keep things that can be optional optional.

@FirefoxMetzger

Copy link
Copy Markdown
Contributor Author

@almarklein Do you remember what we decided for the plugin resolution logic of v2 plugins? I remember that we wanted to serve v3 plugins through the v2 API, but I don't remember if we want to keep v2-unique resolution logic.

Should we deprecate it and resolve plugins using the same rules as v3? (Sounds more maintainable to me)

@almarklein

Copy link
Copy Markdown
Member

@almarklein Do you remember what we decided for the plugin resolution logic of v2 plugins? I remember that we wanted to serve v3 plugins through the v2 API, but I don't remember if we want to keep v2-unique resolution logic.

I think we wanted to keep the selection logic for backwards compatibility, right? There should not be much maintenance, since the v2 module is on a deprecation path anyway.

@FirefoxMetzger
FirefoxMetzger marked this pull request as ready for review April 5, 2022 12:37
@FirefoxMetzger

Copy link
Copy Markdown
Contributor Author

@almarklein This one is also RTR.

I'm trying to find the parts we are missing to get the patch coverage to 100%, but since it touches files that aren't fully covered this is proving more laborsome than expected. I will update the ones I find, but am happy otherwise since overall coverage improves.

@FirefoxMetzger
FirefoxMetzger merged commit fba08a7 into imageio:master Apr 8, 2022
@FirefoxMetzger
FirefoxMetzger deleted the deprecation-warnings branch April 8, 2022 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants