Skip to content
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

Rename WaveorderReader to ImageReader #46

Merged
merged 4 commits into from
Feb 15, 2023
Merged

Conversation

ziw-liu
Copy link
Collaborator

@ziw-liu ziw-liu commented Feb 15, 2023

This PR does a shallow renaming: the legacy WaveorderReader class is now ImageReader. Otherwise API remains the same.

@ziw-liu ziw-liu changed the title Renam WaveorderReader to ImageReader Rename WaveorderReader to ImageReader Feb 15, 2023
@ziw-liu
Copy link
Collaborator Author

ziw-liu commented Feb 15, 2023

This PR is related to (but not attempting to resolve) issues mentioned in #1 and #40.

Also I just briefly tested that HCS datasets written by the new NGFF API (#31) can still be opened by the legacy reader with the changes made in #16.

This was referenced Feb 15, 2023
@ziw-liu ziw-liu self-assigned this Feb 15, 2023
@ziw-liu ziw-liu added the enhancement New feature or request label Feb 15, 2023
@ziw-liu ziw-liu added this to the 0.1.0 milestone Feb 15, 2023
Copy link
Contributor

@talonchandler talonchandler left a comment

Choose a reason for hiding this comment

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

Great, thanks @ziw-liu.

I see that ImageReader still uses the (soon to be deprecated) ZarrReader. Can I suggest a deprecation warning on ZarrReader that points users towards the new open_ome_zarr?

Copy link
Contributor

@AhmetCanSolak AhmetCanSolak left a comment

Choose a reason for hiding this comment

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

happy to see this renaming @ziw-liu , I also second the deprecation suggestion from @talonchandler regarding ZarrReader

@talonchandler
Copy link
Contributor

Thanks for the deprecation warning, @ziw-liu.

What do you think about reducing the default log_level to logging.WARNING, too? At least for the ImageReader?

I think it's really important to alert users that are currently using WaveorderReader (@talonchandler, @edyoshikun , @Soorya19Pradeep) that merely changing WaveorderReader to ImageReader does not finish the migration to our long term iohub solutions. There's more work to do to change to the ngff readers.

@ziw-liu
Copy link
Collaborator Author

ziw-liu commented Feb 15, 2023

What do you think about reducing the default log_level to logging.WARNING, too? At least for the ImageReader?

I just realized that I'm not using that custom logger in other parts of the code. So despite being a sub-optimal state the deprecation warning does show up if you invoked it in __main__ (e.g. a script). We should figure out unified logging too though.

@talonchandler
Copy link
Contributor

talonchandler commented Feb 15, 2023

the deprecation warning does show up if you invoked it in __main__ (e.g. a script)

If I run this script:

import logging
from iohub.reader import ImageReader
reader = ImageReader('20200812-CardiomyocyteDifferentiation14-Cycle1.zarr')
print('done')

with python test.py from a terminal I only see done. But if I add log_level=logging.WARNING to ImageReader then I receive the expected

[WARNING: zarrfile:  33 2023-02-15 10:32:08,104] `iohub.zarrfile.ZarrReader` is deprecated and will be removed in the future. For OME-NGFF (OME-Zarr) v0.4 datasets please use `iohub.ngff.open_ome_zarr` instead.
done

@ziw-liu
Copy link
Collaborator Author

ziw-liu commented Feb 15, 2023

with python test.py from a terminal I only see done. But if I add log_level=logging.WARNING to ImageReader then I receive the expected

Thanks for testing this! I tested in ipython and assumed the same behavior for a script. Then we do need to change log level in this PR.

Copy link
Contributor

@talonchandler talonchandler left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes @ziw-liu!

@ziw-liu ziw-liu added this pull request to the merge queue Feb 15, 2023
Merged via the queue into main with commit d4236ca Feb 15, 2023
@ziw-liu ziw-liu deleted the rename-waveorder-reader branch February 15, 2023 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants