-
Notifications
You must be signed in to change notification settings - Fork 206
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
base: master
Are you sure you want to change the base?
Conversation
@@ -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)) | |||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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...
There was a problem hiding this 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}), |
There was a problem hiding this comment.
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?
@tanmoyio saw this is dangling, any response on #489 (comment) ? |
(ping) |
…nto fix/umap-duplicate-index
@tanmoyio afaict there are no fixes in the current version, it got commented out? |
graphistry/embed_utils.py
Outdated
@@ -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: |
There was a problem hiding this comment.
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)
graphistry/nodexlistry.py
Outdated
@@ -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: |
There was a problem hiding this comment.
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)
CI failing |
No description provided.