Skip to content
Open
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions graphistry/umap_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,10 @@ def umap(
index = res._nodes.index
if res._node is None:
logger.debug("-Writing new node name")
res._nodes[config.IMPLICIT_NODE_ID] = range(len(res._nodes))

Copy link
Contributor

Choose a reason for hiding this comment

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

Clever

Will this work if cudf?

Will this break somehow downstream if .edges is bound and user was using string name IDs for src dst?

Copy link
Contributor

Choose a reason for hiding this comment

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

Strange, I thought this was already done this way...

res = res.nodes( # type: ignore
res._nodes.reset_index(drop=True)
.reset_index()
.rename(columns={"index": config.IMPLICIT_NODE_ID}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just call it __index_umap__ or something that has low prob of collision? then we can keep it safe for cudf?

res._nodes,
config.IMPLICIT_NODE_ID,
)
res._nodes.index = index
Expand Down