Open dhimmel opened 5 years ago
No need to assume this is name right?
name_to_id = {name: i for i, name in enumerate(sorted_node_set)}
Should be node_to_id
?
For "bipartite" argument docs, can we have the first sentence be:
Use bipartite=True when the edges' source and target nodes are different types. Use bipartite=False when there is no distinction in the type of source and target nodes.
Is that accurate?
Regarding:
edges = [('a','b'), ('b','a')]
xswap.preprocessing.map_str_edges(edges, bipartite=True)
([(0, 1), (1, 0)], {'a': 0, 'b': 1}, {'a': 0, 'b': 1})
Is it easy for users to go back to pre-condensed node ids? It seems like the users need the inverted dictionary for {'a': 0, 'b': 1}, {'a': 0, 'b': 1}
?
Also we make hetnetpy wrap this package.
For
map_str_edges
, I think it will work with edges containing nodes as objects other than strings. Should we make this more clear in its name and docstring. Something likecompress_edges_with_int_ids
?https://github.com/hetio/xswap/blob/06cf520b5c54a280bb0446cd104b0d4e052c4544/xswap/preprocessing.py#L41-L110