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

New array conversion methods #9236

Merged
merged 24 commits into from
Oct 1, 2021

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Sep 15, 2021

This PR adds the to_numpy and to_cupy methods. to_numpy is the preferred method for generating numpy arrays as of pandas 1.0 when older methods like to_matrix were removed. This PR deprecates those old methods as well as their gpu counterparts (such as as_gpu_matrix) and instead adds to_cupy as the preferred method of getting a __cuda_array_interface__ compliant array view. The new methods are also preferred to the .values and .values_host accessors, which are not yet deprecated in pandas but are likely to be deprecated at some point due to the ambiguity of their copy semantics.

@vyasr vyasr added feature request New feature or request 2 - In Progress Currently a work in progress Python Affects Python cuDF API. tech debt non-breaking Non-breaking change labels Sep 15, 2021
@vyasr vyasr self-assigned this Sep 15, 2021
@vyasr vyasr changed the title Refactor/more frame methods New array conversion methods Sep 15, 2021
Copy link
Contributor

@thomcom thomcom left a comment

Choose a reason for hiding this comment

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

I enjoyed reading this PR, great consistency, clarity, and structure. PRs on this team are looking sharp! Just a typo, a couple of docs recommendations, and a question.

python/cudf/cudf/core/frame.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/frame.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/frame.py Show resolved Hide resolved
python/cudf/cudf/core/frame.py Show resolved Hide resolved
python/cudf/cudf/core/series.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/dataframe.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/dataframe.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/frame.py Outdated Show resolved Hide resolved
python/cudf/cudf/utils/dtypes.py Show resolved Hide resolved
@vyasr
Copy link
Contributor Author

vyasr commented Sep 21, 2021

rerun tests

@github-actions github-actions bot removed libcudf Affects libcudf (C++/CUDA) code. conda CMake CMake build issue Java Affects Java cuDF API. labels Sep 21, 2021
@vyasr vyasr requested review from thomcom and isVoid September 21, 2021 19:00
@vyasr vyasr added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Sep 21, 2021
@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

❗ No coverage uploaded for pull request base (branch-21.12@079af45). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 056c6fc differs from pull request most recent head 8a62620. Consider uploading reports for the commit 8a62620 to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##             branch-21.12    #9236   +/-   ##
===============================================
  Coverage                ?   10.75%           
===============================================
  Files                   ?      116           
  Lines                   ?    19429           
  Branches                ?        0           
===============================================
  Hits                    ?     2090           
  Misses                  ?    17339           
  Partials                ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 079af45...8a62620. Read the comment docs.

python/cudf/cudf/core/frame.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/frame.py Show resolved Hide resolved
python/cudf/cudf/core/frame.py Show resolved Hide resolved
python/cudf/cudf/core/column/datetime.py Show resolved Hide resolved
python/cudf/cudf/core/series.py Show resolved Hide resolved
Copy link
Contributor

@isVoid isVoid left a comment

Choose a reason for hiding this comment

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

Mostly looks good with 2 Qs.

python/cudf/cudf/core/dataframe.py Show resolved Hide resolved
python/cudf/cudf/utils/dtypes.py Show resolved Hide resolved
@vyasr
Copy link
Contributor Author

vyasr commented Sep 30, 2021

rerun tests

@vyasr
Copy link
Contributor Author

vyasr commented Oct 1, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit e597075 into rapidsai:branch-21.12 Oct 1, 2021
@vyasr vyasr deleted the refactor/more_frame_methods branch January 14, 2022 18:00
rapids-bot bot pushed a commit to rapidsai/cuxfilter that referenced this pull request Feb 2, 2022
This PR fixes breaking changes made in: rapidsai/cudf#9236

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Jordan Jacobelli (https://github.com/Ethyling)
  - Ajay Thorve (https://github.com/AjayThorve)

URL: #348
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team feature request New feature or request non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants