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

Export PixelIDValueEnum members as members of Enum in Python binding #1992

Open
Czaki opened this issue Sep 22, 2023 · 0 comments
Open

Export PixelIDValueEnum members as members of Enum in Python binding #1992

Czaki opened this issue Sep 22, 2023 · 0 comments

Comments

@Czaki
Copy link

Czaki commented Sep 22, 2023

Is the feature request related to a problem? Please describe.

Currently, members of PixelIDValueEnum Enum are exported on the module level. Currently modern python packages export enum values as members of the class, not on the module level. So newcomers may be confused. It will be nice to also export PixelIDValueEnum members in SimpleITK.PixelIDValueEnum.member

Describe the proposed solution

Add something like

class PixelIDValueEnum(IntEnum):
    sitkUInt8 = 1
    ...

Or even provide also numpy like aliases:

class PixelIDValueEnum(IntEnum):
    sitkUInt8 = 1
    uint8 = 1
    sitkUInt16 = 3
    uint16 = 3
    ...

Additional context

#1991 (comment)

Maybe this change may be also nice in other languages, but I'm not enough familiar with their conventions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant