pwollstadt / IDTxl

The Information Dynamics Toolkit xl (IDTxl) is a comprehensive software package for efficient inference of networks and their node dynamics from multivariate time series data using information theory.
http://pwollstadt.github.io/IDTxl/
GNU General Public License v3.0
243 stars 77 forks source link

Received invalid argument(s): hold #55

Closed Xirailuyo closed 3 years ago

Xirailuyo commented 3 years ago

I just installed IDTxl, and seem to be having trouble with the plot_network function. I may be missing a dependency, but I'm having trouble locating the problem. I have attached the error below. All the other functions in the demos seem to be working fine. I am using Ubuntu 20, cuda 11, and anaconda for environment and package management. Importing pylab and matplotlib do not resolve the issue. Thank you.


ValueError Traceback (most recent call last)

in () 1 # d) Plot inferred network to console and via matplotlib 2 results.print_edge_list(weights='max_te_lag', fdr=False) ----> 3 plot_network(results=results, weights='max_te_lag', fdr=False) 4 # plt.show() /home/xirailuyo/IDTxl/idtxl/visualise_graph.py in plot_network(results, weights, fdr) 65 fig = plt.figure(figsize=(10, 5)) 66 ax1 = plt.subplot(121) # plot graph ---> 67 _plot_graph(graph, ax1, weights) 68 plt.subplot(122) # plot adjacency matrix 69 _plot_adj_matrix( /home/xirailuyo/IDTxl/idtxl/visualise_graph.py in _plot_graph(graph, axis, weights, display_edge_labels) 153 nx.draw_circular(graph, with_labels=True, node_size=600, alpha=1.0, 154 ax=axis, node_color='Gainsboro', hold=True, font_size=14, --> 155 font_weight='bold') 156 if display_edge_labels: 157 edge_labels = nx.get_edge_attributes(graph, weights) /home/xirailuyo/.conda/envs/idtxl/lib/python3.6/site-packages/networkx/drawing/nx_pylab.py in draw_circular(G, **kwargs) 1095 function. 1096 """ -> 1097 draw(G, circular_layout(G), **kwargs) 1098 1099 /home/xirailuyo/.conda/envs/idtxl/lib/python3.6/site-packages/networkx/drawing/nx_pylab.py in draw(G, pos, ax, **kwds) 121 kwds["with_labels"] = "labels" in kwds 122 --> 123 draw_networkx(G, pos=pos, ax=ax, **kwds) 124 ax.set_axis_off() 125 plt.draw_if_interactive() /home/xirailuyo/.conda/envs/idtxl/lib/python3.6/site-packages/networkx/drawing/nx_pylab.py in draw_networkx(G, pos, arrows, with_labels, **kwds) 324 if any([k not in valid_kwds for k in kwds]): 325 invalid_args = ", ".join([k for k in kwds if k not in valid_kwds]) --> 326 raise ValueError(f"Received invalid argument(s): {invalid_args}") 327 328 node_kwds = {k: v for k, v in kwds.items() if k in valid_node_kwds} ValueError: Received invalid argument(s): hold
AlexMa123 commented 3 years ago

This bug is because of networkx and matplotlib. After the upgrade of these two libs, they remove the argument "hold." You can try to remove all "hold=True" from the file "visualise_graph.py"

pwollstadt commented 3 years ago

Thanks @AlexMa123 for the pointer. We have updated calls to networkx in the current development branch (see 26be4655f3049d4f8dcaa3149d2dc153e6aa5658). This will be released shortly. You can try the develop version if you want to use this feature immediately.