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

Deprecate cudf.isclose #17351

Open
wants to merge 1 commit into
base: branch-25.02
Choose a base branch
from

Conversation

the-gates-of-Zion
Copy link

@the-gates-of-Zion the-gates-of-Zion commented Nov 17, 2024

Description

add warnings.warn("cudf.close is deprecated and will be removed in a future version of cudf. ", ''' ... ''')
(from 25.02)

Checklist

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

Copy link

copy-pr-bot bot commented Nov 17, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions bot added libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API. CMake CMake build issue Java Affects Java cuDF API. cudf.pandas Issues specific to cudf.pandas cudf.polars Issues specific to cudf.polars pylibcudf Issues specific to the pylibcudf package labels Nov 17, 2024
@@ -5,17 +5,17 @@
"args": {
"CUDA": "11.8",
"PYTHON_PACKAGE_MANAGER": "conda",
"BASE": "rapidsai/devcontainers:24.12-cpp-cuda11.8-mambaforge-ubuntu22.04"
"BASE": "rapidsai/devcontainers:25.02-cpp-cuda11.8-mambaforge-ubuntu22.04"
Copy link
Contributor

Choose a reason for hiding this comment

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

This PR targets 24.12. Why have all the dependencies been changed to 25.02?

Copy link
Contributor

Choose a reason for hiding this comment

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

The PR's title, name, description, and actual changes do not make sense to me.
Recommend closing this.

Copy link
Contributor

Choose a reason for hiding this comment

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

This appears to be an attempt at #13593, an issue I filed a while back. @the-gates-of-Zion I can help work with you on this, if you are interested. This should target branch-25.02, so I will retarget the PR.

@bdice bdice changed the base branch from branch-24.12 to branch-25.02 November 18, 2024 15:43
@bdice bdice removed request for a team, Matt711 and AyodeAwe November 18, 2024 15:43
@@ -5322,6 +5322,29 @@ def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False):
5 False
dtype: bool
"""
warnings.warn(
"`cudf.close` is deprecated and will be removed in a future version of cudf. "
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"`cudf.close` is deprecated and will be removed in a future version of cudf. "
"`cudf.isclose` is deprecated and will be removed in a future version of cudf. "

Comment on lines +5327 to +5345
'''
import cupy as cp
import pandas as pd
from cudf.core.column import (
as_column,
)

a = pd.array([1.0, 2.0, None])
b = pd.array([1.0, 2.1, None])

a_col = as_column(a)
a_array = cupy.asarray(a_col.data_array_view(mode="read"))

b_col = as_column(b)
b_array = cupy.asarray(b_col.data_array_view(mode="read"))

result = cp.isclose(a, b, equal_nan=True)
print(result) # Output: [ True False True]
''',
Copy link
Contributor

@bdice bdice Nov 18, 2024

Choose a reason for hiding this comment

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

We noted in #13593: "As part of the deprecation, we decided to add a warning message indicating how to support nulls while using cupy.isclose." However, I am not sure if this is the right code snippet.

The code we want to give to the user as a replacement for this deprecated code path is essentially the current implementation in this method. Basically it has two steps:

  • Call cupy.isclose to see if the values are "close" to each other. This does not account for null values in the input.
  • Compare the null masks of each input. If equal_nan is False, we mark all null values as False ("not close") in the result. If equal_nan is True, we set the values where one column's input is null as False and the values where both columns' input are null as True.

I would suggest we add this snippet to the page "Working with missing data": https://docs.rapids.ai/api/cudf/stable/user_guide/missing-data/

Then we can link to this snippet in the docs from the deprecated method's docstring and in the deprecation warning.

Does that make sense? Let me know if you have questions.

@bdice bdice changed the title Pull request/#13593 Deprecate cudf.isclose Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake CMake build issue cudf.pandas Issues specific to cudf.pandas cudf.polars Issues specific to cudf.polars Java Affects Java cuDF API. libcudf Affects libcudf (C++/CUDA) code. pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.
Projects
Status: In Progress
Status: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants