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

fix: Umap duplicate index #489

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

tanmoyio
Copy link
Member

No description provided.

@@ -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...

Copy link
Contributor

@lmeyerov lmeyerov left a comment

Choose a reason for hiding this comment

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

See comments..

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?

@lmeyerov
Copy link
Contributor

@tanmoyio saw this is dangling, any response on #489 (comment) ?

@lmeyerov
Copy link
Contributor

(ping)

@lmeyerov
Copy link
Contributor

lmeyerov commented Aug 2, 2023

@tanmoyio afaict there are no fixes in the current version, it got commented out?

@@ -542,7 +542,7 @@ def fetch_triplets_for_inference(x_r):
def _score(self, triplets: Union[np.ndarray, TT]) -> TT: # type: ignore
_, torch, _, _, _, _, _, _ = lazy_embed_import_dep()
emb = self._kg_embeddings.clone().detach()
if type(triplets) != torch.Tensor:
if type(triplets) is not torch.Tensor:
Copy link
Contributor

Choose a reason for hiding this comment

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

normally these are isinstance(x, Y)

@@ -132,13 +132,13 @@ def xls(self, xls_or_url, source='default', verbose=None):
p = print if verbose else (lambda x: 1)

# source is either undefined, a string, or a (partial) bindings object
if type(source) == str and source not in self.source_to_mappings:
if type(source) is str and source not in self.source_to_mappings:
Copy link
Contributor

Choose a reason for hiding this comment

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

normally these are isinstance(x, Y)

@lmeyerov
Copy link
Contributor

lmeyerov commented Nov 4, 2023

CI failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants