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

Add labeling APIs to pylibcudf #16761

Merged
merged 6 commits into from
Sep 9, 2024

Conversation

mroeschke
Copy link
Contributor

Description

Contributes to #15162

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@mroeschke mroeschke added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package labels Sep 6, 2024
@mroeschke mroeschke requested a review from a team as a code owner September 6, 2024 00:39
@github-actions github-actions bot added Python Affects Python cuDF API. CMake CMake build issue and removed pylibcudf Issues specific to the pylibcudf package labels Sep 6, 2024
ctypedef enum inclusive:
YES "cudf::inclusive::YES"
NO "cudf::inclusive::NO"
cpdef enum class inclusive(bool):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this enum be exposed in the public API according to https://docs.rapids.ai/api/cudf/stable/developer_guide/pylibcudf/#cython-scoped-enums?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. Note also that the cudf::inclusive enum has an underlying type of int, not bool.

Suggested change
cpdef enum class inclusive(bool):
cpdef enum class inclusive(int):

Arguably that should be changed on the C++ side, although if we do that, we should change the order of the definition. So that bool(cudf::inclusive::YES) is true.

ctypedef enum inclusive:
YES "cudf::inclusive::YES"
NO "cudf::inclusive::NO"
cpdef enum class inclusive(bool):
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. Note also that the cudf::inclusive enum has an underlying type of int, not bool.

Suggested change
cpdef enum class inclusive(bool):
cpdef enum class inclusive(int):

Arguably that should be changed on the C++ side, although if we do that, we should change the order of the definition. So that bool(cudf::inclusive::YES) is true.

Copy link
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

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

Thanks @mroeschke, lgtm!

python/pylibcudf/pylibcudf/tests/test_labeling.py Outdated Show resolved Hide resolved
Co-authored-by: Lawrence Mitchell <wence@gmx.li>
@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 150f1b1 into rapidsai:branch-24.10 Sep 9, 2024
97 checks passed
@mroeschke mroeschke deleted the pylibcudf/labeling branch September 9, 2024 20:16
@mroeschke mroeschke mentioned this pull request Sep 9, 2024
3 tasks
rapids-bot bot pushed a commit that referenced this pull request Sep 10, 2024
Follow up to #16761, I forgot to add the doc pages for the labeling pylibcudf APIs

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - Matthew Murray (https://github.com/Matt711)

URL: #16779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake CMake build issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants