ndexbio / ndex2-client

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

NiceCXNetwork.to_networkx() fails with ValueError on networkx version 2.5.1 #79

Closed coleslaw481 closed 3 years ago

coleslaw481 commented 3 years ago

With the release of networkx 2.5.1 the call NiceCXNetwork.to_networkx() is failing with a ValueError

To reproduce, install networkx 2.5.1 and ndex2 3.3.2 and run this code:


from ndex2.nice_cx_network import NiceCXNetwork

net = NiceCXNetwork()
n_one = net.create_node(node_name='node1')
n_two = net.create_node(node_name='node2')
net.create_edge(edge_source=n_one, edge_target=n_two)
net.to_networkx()

The output will be:

....anaconda3/envs/python39/lib/python3.9/site-packages/ndex2/nice_cx_network.py", line 1622, in to_networkx
    if float(nx.__version__) >= 2.0:
ValueError: could not convert string to float: '2.5.1'
coleslaw481 commented 3 years ago

Fixed with release of version 3.3.3