Skip to content

Commit 2fa63a3

Browse files
committed
VertexLabeling->VertexLabels
Use helper function in CompleteGraph
1 parent 5db97c2 commit 2fa63a3

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

pymathics/graph/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"EdgeStyle": "{}",
2929
"EdgeWeight": "{}",
3030
"GraphLayout": "{}",
31-
"VertexLabeling": "False",
31+
"VertexLabels": "False",
3232
"PlotLabel": "Null",
3333
}
3434

@@ -656,7 +656,7 @@ def full_new_edge_properties(new_edge_style):
656656
n_undirected=len(undirected_edges),
657657
)
658658

659-
G.vertex_labeling = options["System`VertexLabeling"]
659+
G.vertex_labels = options["System`VertexLabels"]
660660
g = Graph(G)
661661
G.title = g.title = options["System`PlotLabel"]
662662
return g

pymathics/graph/graph_generators.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def graph_helper(
3434
G.graph_layout = options["System`GraphLayout"].get_string_value() or String(
3535
graph_layout
3636
)
37-
G.vertex_labeling = options["System`VertexLabeling"]
37+
G.vertex_labels = options["System`VertexLabels"]
3838
g = Graph(G)
3939

4040
if root is not None:
@@ -196,15 +196,12 @@ def apply(self, n, expression, evaluation, options):
196196
evaluation.message(self.get_name(), "ilsmp", expression)
197197
return
198198

199-
G = nx.complete_graph(py_n)
199+
args = (py_n,)
200+
g = graph_helper(nx.complete_graph, options, False, "circular", None, *args)
201+
if not g:
202+
return None
200203

201-
options["GraphLayout"] = options[
202-
"System`GraphLayout"
203-
].get_string_value() or String("circular")
204-
options["VertexLabeling"] = options["System`VertexLabeling"]
205-
g = Graph(G, options=options)
206-
g.n = n
207-
G.title = g.title = options["System`PlotLabel"]
204+
g.G.n = n
208205
return g
209206

210207
def apply_multipartite(self, n, evaluation, options):

0 commit comments

Comments
 (0)