Skip to content

SKIP: gray vs grey #2604

Closed

Description

@sciunto

Description

Recently, I saw a student stuck after typing

io.imread('image.jpg', as_gray=True)

Silently, it loads as a RGB image.

Indeed, the API is as_grey. The problem is that our API is not homogeneous. It seems that US spelling is in majority in our library. I would suggest to either:

  • make sure that both gray and grey are working
  • raise a warning

Any suggestion @scikit-image/core ?

Activity

  1. jni commented on Apr 9, 2017

    @jni
    Member

    What does RFC mean for those of us that are uninitiated? =)

    My preference is for both to work. (I think this is what we do with rgb2grey/rgb2gray?)

  2. changed the title [-]RFC: gray vs grey[/-] [+]SKIEP: gray vs grey[/+] on Apr 9, 2017
  3. soupault commented on Apr 9, 2017

    @soupault
    Member

    Is seems that skimage.io is the only place where as_gray keyword is used.
    It won't be a bad idea to support both as_gray and as_grey there. 👍

  4. sciunto commented on Apr 9, 2017

    @sciunto
    MemberAuthor

    Request For Comments, but I have no idea what SKIEP means :D

  5. soupault commented on Apr 9, 2017

    @soupault
    Member

    @sciunto It is our new brand for labelling strategic discussions: SciKit-Image Enhancement Proposal (copy from PEP) 😄 .

  6. sciunto commented on Apr 9, 2017

    @sciunto
    MemberAuthor

    needs a little TM them :)

  7. sciunto commented on Apr 15, 2017

    @sciunto
    MemberAuthor

    Is it trivial to support as_gray along with as_grey? The **kwarg is used for the plugins... it doesn't seem nice to me to go that way. I would prefer to follow a deprecation cycle. Do you agree?

  8. sciunto commented on Apr 15, 2017

    @sciunto
    MemberAuthor

    I notice that in mrphology, we have grey.py and greyreconstruct.py. Ndimage uses grey as well...

  9. soupault commented on Apr 15, 2017

    @soupault
    Member

    matplotlib and Pillow use gray, grayscale.

    @sciunto Sorry, I didn't catch your second proposal.

  10. sciunto commented on Apr 15, 2017

    @sciunto
    MemberAuthor

    What I meant is:

    • solution 1: we use **kwargs to catch as_gray if as_grey is not set, but **kwargs is used for plugins, so it's not very clean.
    • solution 2: we add a new option as_gray with as_grey=None. If as_grey is not None, raise a warning for deprecation.

    I prefer solution 2. However, if we go this way (ie in favour of gray), we have to change a lot of stuffs.

  11. alexdesiqueira commented on Apr 18, 2017

    @alexdesiqueira
    Member

    I'd go with as_gray, since this is the "most used" nomenclature in books, papers, et al. It could confuse some users (I was one of them). For me, @sciunto's solution 2 is the way to go.

  12. self-assigned this
    on May 5, 2017
  13. 3 remaining items

  14. added this to the 0.15 milestone on May 22, 2018
  15. sciunto commented on May 23, 2018

    @sciunto
    MemberAuthor

    I just opened a small PR #3098 but ideally, it would be good to replace other places but deprecations are needed... :(

  16. PinkFloyded commented on Nov 24, 2018

    @PinkFloyded
    Contributor

    As a new user of skimage it seems very strange to keep two versions of the API whenever there is a gray. This pollutes the API surface and for no good reason. I think it makes sense to choose one, deprecate the other and remove it in a major version release.

  17. jni commented on Nov 24, 2018

    @jni
    Member

    @PinkFloyded I actually agree with you and disagree with past me. 😂 🤷‍♂️ The intention going forward is to follow US convention everywhere. However, this will take time as it requires breaking changes and deprecations. (Not least in graycoprops, which looks weird to me spelled that way. Anyone else?)

  18. modified the milestones: 0.15, 0.16 on Apr 20, 2019
  19. modified the milestones: 0.16, 1.0 on Jul 25, 2019
  20. changed the title [-]SKIEP: gray vs grey[/-] [+]SKIP: gray vs grey[/+] on Apr 8, 2020
  21. added
    🔽 Deprecation
    on Apr 8, 2020
  22. added
    📜 type: API
    on Jan 25, 2021
  23. added a commit that references this issue on Apr 11, 2021
  24. moved this to Done in skimage2on Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🔽 Deprecation📜 type: API💬 Discussion

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions