Skip to content

Commit

Permalink
Replace legacy cudf and dask_cudf imports as (d)gd (#14944)
Browse files Browse the repository at this point in the history
Discussed offline, replacing this legacy import style without aliasing

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

Approvers:
  - Richard (Rick) Zamora (https://github.com/rjzamora)
  - Bradley Dice (https://github.com/bdice)

URL: #14944
  • Loading branch information
mroeschke authored Feb 1, 2024
1 parent 767dde1 commit 6b3462b
Show file tree
Hide file tree
Showing 12 changed files with 357 additions and 347 deletions.
20 changes: 10 additions & 10 deletions python/cudf/cudf/api/extensions/accessor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2022, NVIDIA CORPORATION.
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

import warnings

Expand Down Expand Up @@ -37,8 +37,8 @@
_dataframe_example = """
In your library code:
>>> import cudf as gd
>>> @gd.api.extensions.register_dataframe_accessor("point")
>>> import cudf
>>> @cudf.api.extensions.register_dataframe_accessor("point")
... class PointsAccessor:
... def __init__(self, obj):
... self._validate(obj)
Expand All @@ -57,7 +57,7 @@
Then in user code:
>>> df = gd.DataFrame({'x': [1,2,3,4,5,6], 'y':[7,6,5,4,3,2]})
>>> df = cudf.DataFrame({'x': [1,2,3,4,5,6], 'y':[7,6,5,4,3,2]})
>>> df.point.bounding_box
(1, 2, 6, 7)
Expand All @@ -66,8 +66,8 @@
_index_example = """
In your library code:
>>> import cudf as gd
>>> @gd.api.extensions.register_index_accessor("odd")
>>> import cudf
>>> @cudf.api.extensions.register_index_accessor("odd")
... class OddRowAccessor:
... def __init__(self, obj):
... self._obj = obj
Expand All @@ -76,7 +76,7 @@
Then in user code:
>>> gs = gd.Index(list(range(0, 50)))
>>> gs = cudf.Index(list(range(0, 50)))
>>> gs.odd[1]
1
>>> gs.odd[2]
Expand All @@ -89,8 +89,8 @@
_series_example = """
In your library code:
>>> import cudf as gd
>>> @gd.api.extensions.register_series_accessor("odd")
>>> import cudf
>>> @cudf.api.extensions.register_series_accessor("odd")
... class OddRowAccessor:
... def __init__(self, obj):
... self._obj = obj
Expand All @@ -99,7 +99,7 @@
Then in user code:
>>> gs = gd.Series(list(range(0, 50)))
>>> gs = cudf.Series(list(range(0, 50)))
>>> gs.odd[1]
1
>>> gs.odd[2]
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/indexed_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4442,7 +4442,7 @@ def sample(
Examples
--------
>>> import cudf as cudf
>>> import cudf
>>> df = cudf.DataFrame({"a":{1, 2, 3, 4, 5}})
>>> df.sample(3)
a
Expand Down
10 changes: 5 additions & 5 deletions python/cudf/cudf/datasets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2022, NVIDIA CORPORATION.
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -42,8 +42,8 @@ def timeseries(
Examples
--------
>>> import cudf as gd
>>> gdf = gd.datasets.timeseries()
>>> import cudf
>>> gdf = cudf.datasets.timeseries()
>>> gdf.head() # doctest: +SKIP
timestamp id name x y
2000-01-01 00:00:00 967 Jerry -0.031348 -0.040633
Expand Down Expand Up @@ -97,8 +97,8 @@ def randomdata(nrows=10, dtypes=None, seed=None):
Examples
--------
>>> import cudf as gd
>>> gdf = gd.datasets.randomdata()
>>> import cudf
>>> gdf = cudf.datasets.randomdata()
>>> cdf.head() # doctest: +SKIP
id x y
0 1014 0.28361267466770146 -0.44274170661264334
Expand Down
Loading

0 comments on commit 6b3462b

Please sign in to comment.