Skip to content

Commit 3bfa169

Browse files
Merge branch 'dev' into Pytest-Setup
2 parents e483f87 + cc66ada commit 3bfa169

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

py/visdom/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3035,7 +3035,7 @@ def dual_axis_lines(self, X=None, Y1=None, Y2=None, opts=None, win=None, env=Non
30353035

30363036
@pytorch_wrap
30373037
def graph(
3038-
self, edges, edgeLabels=None, nodeLabels=None, opts=dict(), env=None, win=None
3038+
self, edges, edgeLabels=None, nodeLabels=None, opts=None, env=None, win=None
30393039
):
30403040
"""
30413041
This function draws interactive network graphs. It takes list of edges as one of the arguments.
@@ -3057,9 +3057,10 @@ def graph(
30573057
* `height` : height of the Pane
30583058
* `width` : width of the Pane
30593059
"""
3060+
opts = {} if opts is None else opts
30603061
try:
30613062
import networkx as nx
3062-
except:
3063+
except ImportError:
30633064
raise RuntimeError("networkx must be installed to plot Graph figures")
30643065

30653066
G = nx.Graph()

0 commit comments

Comments
 (0)