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

Use cupy.ndarray (without core) #8114

Merged
merged 1 commit into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def factorize(values, sort=False, na_sentinel=-1, size_hint=None):
if size_hint:
warn("size_hint is not applicable for cudf.factorize")

return_cupy_array = isinstance(values, cp.core.core.ndarray)
return_cupy_array = isinstance(values, cp.ndarray)

values = Series(values)

Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -6069,7 +6069,7 @@ def test_dataframe_init_1d_list(data, columns):
def test_dataframe_init_from_arrays_cols(data, cols, index):

gd_data = data
if isinstance(data, cupy.core.ndarray):
if isinstance(data, cupy.ndarray):
# pandas can't handle cupy arrays in general
pd_data = data.get()

Expand Down
12 changes: 6 additions & 6 deletions python/cudf/cudf/tests/test_factorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_factorize_series_obj(ncats, nelem):

uvals, labels = df["cats"].factorize()
np.testing.assert_array_equal(labels.to_array(), sorted(set(arr)))
assert isinstance(uvals, cp.core.core.ndarray)
assert isinstance(uvals, cp.ndarray)
assert isinstance(labels, Index)

encoder = dict((labels[idx], idx) for idx in range(len(labels)))
Expand All @@ -39,7 +39,7 @@ def test_factorize_index_obj(ncats, nelem):

uvals, labels = df.index.factorize()
np.testing.assert_array_equal(labels.values.get(), sorted(set(arr)))
assert isinstance(uvals, cp.core.core.ndarray)
assert isinstance(uvals, cp.ndarray)
assert isinstance(labels, Index)

encoder = dict((labels[idx], idx) for idx in range(len(labels)))
Expand Down Expand Up @@ -127,15 +127,15 @@ def test_factorize_result_classes():

labels, cats = cudf.factorize(cudf.Series(data))

assert isinstance(labels, cp.core.core.ndarray)
assert isinstance(labels, cp.ndarray)
assert isinstance(cats, cudf.Index)

labels, cats = cudf.factorize(cudf.Index(data))

assert isinstance(labels, cp.core.core.ndarray)
assert isinstance(labels, cp.ndarray)
assert isinstance(cats, cudf.Index)

labels, cats = cudf.factorize(cp.array(data))

assert isinstance(labels, cp.core.core.ndarray)
assert isinstance(cats, cp.core.core.ndarray)
assert isinstance(labels, cp.ndarray)
assert isinstance(cats, cp.ndarray)