Skip to content

Commit

Permalink
Use public cudf APIs where possible (#578)
Browse files Browse the repository at this point in the history
cudf's `core` namespace is considered "private", so changing some usages that have public alternative.

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

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

URL: #578
  • Loading branch information
mroeschke authored Mar 6, 2024
1 parent b60886f commit 4b29fb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ def bundle_edges(edges, src="src", dst="dst"):

# Determine each edge's index relative to its bundle
edges = edges.sort_values(by="bid").reset_index(drop=True)
edges["_index"] = (
cudf.core.index.RangeIndex(0, len(edges)) - edges["start"]
).astype("int32")

edges["_index"] = (cudf.RangeIndex(0, len(edges)) - edges["start"]).astype(
"int32"
)
# Re-sort the edgelist by edge id and cleanup
edges = edges.sort_values("eid").reset_index(drop=True)
edges = edges.rename(columns={"eid": "id"}, copy=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def __init__(self, **params):
def _compute_clims(self):
if not isinstance(
self.source_df[self.aggregate_col].dtype,
cudf.core.dtypes.CategoricalDtype,
cudf.CategoricalDtype,
):
self.clims = get_min_max(self.source_df, self.aggregate_col)

Expand All @@ -238,7 +238,7 @@ def _compute_datashader_assets(self):
self.cmap = {"cmap": self.color_palette}
if isinstance(
self.source_df[self.aggregate_col].dtype,
cudf.core.dtypes.CategoricalDtype,
cudf.CategoricalDtype,
):
self.cmap = {
"color_key": {
Expand Down

0 comments on commit 4b29fb8

Please sign in to comment.