You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~.conda\envs\nilmtk-env\lib\site-packages\networkx\drawing\nx_pylab.py in draw_networkx_edges(G, pos, edgelist, width, edge_color, style, alpha, arrowstyle, arrowsize, edge_cmap, edge_vmin, edge_vmax, ax, arrows, label, node_size, nodelist, node_shape, **kwds)
609 # value globally, since the user can instead provide per-edge alphas
610 # now. Only set it globally if provided as a scalar.
--> 611 if cb.is_numlike(alpha):
612 edge_collection.set_alpha(alpha)
613
AttributeError: module 'matplotlib.cbook' has no attribute 'is_numlike'
The text was updated successfully, but these errors were encountered:
That's an issue with matplotlib 3.2 and networkx. It seems the conda recipe for networkx is outdated/wrong. I prepared yet another package to restrict it on our side. You can try conda update -c nilmtk nilmtk in your NILMTK environment. All the basic example notebooks should run fine with this one.
There are also a couple more options. You could also manually downgrade matplotlib to 3.1.x, or just add the following code to provide the missing method that networkx expects and hope everything else works:
fromnumbersimportNumberimportmatplotlibifnothasattr(matplotlib.cbook, 'is_numlike'):
# Monkey-patch matplotlib's cbook to make networkx workmatplotlib.cbook.is_numlike=lambdax: isinstance(x, Number)
AttributeError Traceback (most recent call last)
in
----> 1 elec.draw_wiring_graph()
~.conda\envs\nilmtk-env\lib\site-packages\nilmtk\metergroup.py in draw_wiring_graph(self, show_meter_labels)
634 nx.draw(graph, pos, arrows=False)
635 else:
--> 636 nx.draw(graph, pos, labels=meter_labels, arrows=False)
637
638 ax = plt.gca()
~.conda\envs\nilmtk-env\lib\site-packages\networkx\drawing\nx_pylab.py in draw(G, pos, ax, **kwds)
124
125 try:
--> 126 draw_networkx(G, pos=pos, ax=ax, **kwds)
127 ax.set_axis_off()
128 plt.draw_if_interactive()
~.conda\envs\nilmtk-env\lib\site-packages\networkx\drawing\nx_pylab.py in draw_networkx(G, pos, arrows, with_labels, **kwds)
276
277 node_collection = draw_networkx_nodes(G, pos, **kwds)
--> 278 edge_collection = draw_networkx_edges(G, pos, arrows=arrows, **kwds)
279 if with_labels:
280 draw_networkx_labels(G, pos, **kwds)
~.conda\envs\nilmtk-env\lib\site-packages\networkx\drawing\nx_pylab.py in draw_networkx_edges(G, pos, edgelist, width, edge_color, style, alpha, arrowstyle, arrowsize, edge_cmap, edge_vmin, edge_vmax, ax, arrows, label, node_size, nodelist, node_shape, **kwds)
609 # value globally, since the user can instead provide per-edge alphas
610 # now. Only set it globally if provided as a scalar.
--> 611 if cb.is_numlike(alpha):
612 edge_collection.set_alpha(alpha)
613
AttributeError: module 'matplotlib.cbook' has no attribute 'is_numlike'
The text was updated successfully, but these errors were encountered: