Transparent API towards a common graph format#373
Transparent API towards a common graph format#373iosonofabio wants to merge 3 commits intoigraph:mainfrom
Conversation
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
|
This has been stale for a while, but a few things are happening in the background that are perhaps worth logging here:
Those are relevant because once the functions that provide implementation are decoupled from the def transparentAPI(function):
def wrapper(graph, *args, **kwargs):
# Universal input adapter
graph_type = 'igraph'
if isinstance(graph, nx.Graph):
graph = ig.from_networkx(graph)
graph_type = 'networkx'
# Call function
res = function(graph, *args, **kwargs)
# Universal output adapter
if isinstance(res, ig.Graph) and graph_type == 'networkx':
res = res.to_networkx()
return resand one would then wrap any function that we want to be part of this API as: @transparentAPI
def betweenness(graph, ...):
...In practice, for now the actual functions are often hidden from the user because we do not want to confuse the user with two ways of performing each operation (method and function) without broadcasting about this shift in attitude beforehand. However, that is more of a decision making issue than a technical one by now, and we could start piloting this API anytime. |
|
@iosonofabio Before you proceed with this, it should be discussed at the next meeting. There was in fact discussion about this in your absence. |

Hi all,
I am trying to explore the possibility of adding an API layer that lets
networkx/graph-tool/<your choice of tool>folks useigraphfunctions transparently, e.g.:(The example above works on my laptop)
The vision is that this could be the first step towards a more consistent graph manipulation format as discussed with cytoscape and networkx folks online and as of Dexter's recent email.
This particular PR would not do much towards efficiency: the graph is converted into an
igraphobject, operated upon, and the result is converted back. However, it might lower the barrier towards an efficient shared protocol by exposing the rocky outcrops of various designs.What do you guys think? If we are on the same page we can hear what external people are thinking from their end.