ndexbio / ndex2-client

NDEx2 Client
BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

Verify consistent conversion of cx for networkx 1.11 and 2.0+ #30

Closed coleslaw481 closed 5 years ago

coleslaw481 commented 5 years ago

In NiceCXNetwork.to_networkx() under the module ndex2/nice_cx_network.py verify conversion of networkx object is consistent with documentation and is consistent between two versions of networkx (1.11 & 2.0+)

Current documentation is a bit vague and CartesianCoordinates is incorrect aspect name it should be cartesianLayout:

Returns a NetworkX graph based on the network. Elements in the CartesianCoordinates aspect of the network are transformed to the NetworkX pos attribute. Node name is stored in the networkx node id. Node 'represents' is stored in the networkx node attribute 'represents'
coleslaw481 commented 5 years ago

Major refactoring done to NiceCXNetwork.to_networkx() due to numerous issues.

To fix this issue a new parameter mode was added to NiceCXNetwork.to_networkx() with a default value of legacy which kept behavior like before for backwards compatibility.

To get the fixed version set mode to 'default' or None

As part of this fix the following changes were made:

Code in NiceCXNetwork.to_networkx() was pulled out of this method and put into two separate classes: