@@ -817,13 +817,13 @@ class _PatternList(_NetworkXBuiltin):
817817 def eval (
818818 self , graph , expression : Expression , evaluation : Evaluation , options : dict
819819 ):
820- "%(name)s[graph_, OptionsPattern[%(name)s]]"
820+ "expression: %(name)s[graph_, OptionsPattern[%(name)s]]"
821821 graph = self ._build_graph (graph , evaluation , options , expression )
822822 if graph :
823823 return ListExpression (* (from_python (q ) for q in self ._items (graph )))
824824
825825 def eval_patt (self , graph , patt , expression , evaluation , options ):
826- "%(name)s[graph_, patt_, OptionsPattern[%(name)s]]"
826+ "expression: %(name)s[graph_, patt_, OptionsPattern[%(name)s]]"
827827 graph = self ._build_graph (graph , evaluation , options , expression )
828828 if graph :
829829 return Expression (SymbolCases , ListExpression (* self ._items (graph )), patt )
@@ -875,7 +875,7 @@ def _retrieve(self, graph, what, neighbors, expression, evaluation):
875875 self ._not_a_vertex (expression , 2 , evaluation )
876876
877877 def eval (self , graph , what , expression , evaluation , options ):
878- "%(name)s[graph_, what_, OptionsPattern[%(name)s]]"
878+ "expression: %(name)s[graph_, what_, OptionsPattern[%(name)s]]"
879879 graph = self ._build_graph (graph , evaluation , options , expression )
880880 if graph :
881881 G = graph .G .to_undirected () # FIXME inefficient
@@ -884,7 +884,7 @@ def eval(self, graph, what, expression, evaluation, options):
884884 )
885885
886886 def eval_d (self , graph , what , d , expression , evaluation , options ):
887- "%(name)s[graph_, what_, d_, OptionsPattern[%(name)s]]"
887+ "expression: %(name)s[graph_, what_, d_, OptionsPattern[%(name)s]]"
888888 py_d = d .to_mpmath ()
889889 if py_d is None :
890890 return
@@ -967,13 +967,13 @@ class EdgeConnectivity(_NetworkXBuiltin):
967967 summary_text = "edge connectivity of a graph"
968968
969969 def eval (self , graph , expression , evaluation , options ):
970- "%(name)s[graph_, OptionsPattern[%(name)s]]"
970+ "expression: %(name)s[graph_, OptionsPattern[%(name)s]]"
971971 graph = self ._build_graph (graph , evaluation , options , expression )
972972 if graph and not graph .empty ():
973973 return Integer (nx .edge_connectivity (graph .G ))
974974
975975 def eval_st (self , graph , s , t , expression , evaluation , options ):
976- "%(name)s[graph_, s_, t_, OptionsPattern[%(name)s]]"
976+ "expression: %(name)s[graph_, s_, t_, OptionsPattern[%(name)s]]"
977977 graph = self ._build_graph (graph , evaluation , options , expression )
978978 if graph and not graph .empty ():
979979 return Integer (nx .edge_connectivity (graph .G , s , t ))
@@ -995,7 +995,7 @@ class EdgeIndex(_NetworkXBuiltin):
995995 summary_text = "find the position of an edge"
996996
997997 def eval (self , graph , v , expression , evaluation , options ):
998- "%(name)s[graph_, v_, OptionsPattern[%(name)s]]"
998+ "expression: %(name)s[graph_, v_, OptionsPattern[%(name)s]]"
999999 graph = self ._build_graph (graph , evaluation , options , expression )
10001000 if graph :
10011001 # FIXME: check if directionality must be considered or not.
@@ -1040,7 +1040,7 @@ class EdgeRules(_NetworkXBuiltin):
10401040 summary_text = "list the edge as rules"
10411041
10421042 def eval (self , graph , expression , evaluation , options ):
1043- "%(name)s[graph_, OptionsPattern[%(name)s]]"
1043+ "expression: %(name)s[graph_, OptionsPattern[%(name)s]]"
10441044 graph = self ._build_graph (graph , evaluation , options , expression )
10451045 if graph :
10461046
@@ -1096,7 +1096,7 @@ class FindShortestPath(_NetworkXBuiltin):
10961096 def eval_s_t (
10971097 self , graph , s , t , expression : Expression , evaluation : Evaluation , options : dict
10981098 ):
1099- "FindShortestPath[graph_, s_, t_, OptionsPattern[FindShortestPath]]"
1099+ "expression: FindShortestPath[graph_, s_, t_, OptionsPattern[FindShortestPath]]"
11001100 graph = self ._build_graph (graph , evaluation , options , expression )
11011101 if not graph :
11021102 return
@@ -1153,7 +1153,7 @@ class FindVertexCut(_NetworkXBuiltin):
11531153 summary_text = "find the vertex cuts"
11541154
11551155 def eval (self , graph , expression , evaluation , options ):
1156- "FindVertexCut[graph_, OptionsPattern[%(name)s]]"
1156+ "expression: FindVertexCut[graph_, OptionsPattern[%(name)s]]"
11571157 graph = self ._build_graph (graph , evaluation , options , expression )
11581158 if graph :
11591159 if graph .empty () or not is_connected (graph .G ):
@@ -1164,7 +1164,7 @@ def eval(self, graph, expression, evaluation, options):
11641164 )
11651165
11661166 def eval_st (self , graph , s , t , expression , evaluation , options ):
1167- "FindVertexCut[graph_, s_, t_, OptionsPattern[%(name)s]]"
1167+ "expression: FindVertexCut[graph_, s_, t_, OptionsPattern[%(name)s]]"
11681168 graph = self ._build_graph (graph , evaluation , options , expression )
11691169 if not graph :
11701170 return
@@ -1248,7 +1248,7 @@ class HighlightGraph(_NetworkXBuiltin):
12481248 summary_text = "highlight elements in a graph"
12491249
12501250 def eval (self , graph , what , expression , evaluation , options ):
1251- "HighlightGraph[graph_, what_List, OptionsPattern[%(name)s]]"
1251+ "expression: HighlightGraph[graph_, what_List, OptionsPattern[%(name)s]]"
12521252 default_highlight = [Expression (SymbolRGBColor , Integer1 , Integer0 , Integer0 )]
12531253
12541254 def parse (item ):
@@ -1355,7 +1355,7 @@ class VertexAdd(_NetworkXBuiltin):
13551355 summary_text = "add a vertex"
13561356
13571357 def eval (self , graph : Expression , what , expression , evaluation , options ):
1358- "VertexAdd[graph_, what_, OptionsPattern[VertexAdd]]"
1358+ "expression: VertexAdd[graph_, what_, OptionsPattern[VertexAdd]]"
13591359 mathics_graph = self ._build_graph (graph , evaluation , options , expression )
13601360 if mathics_graph :
13611361 if what .get_head_name () == "System`List" :
@@ -1399,7 +1399,7 @@ class VertexConnectivity(_NetworkXBuiltin):
13991399 summary_text = "vertex connectivity"
14001400
14011401 def eval (self , graph , expression , evaluation , options ):
1402- "%(name)s[graph_, OptionsPattern[%(name)s]]"
1402+ "expression: %(name)s[graph_, OptionsPattern[%(name)s]]"
14031403 graph = self ._build_graph (graph , evaluation , options , expression )
14041404 if graph and not graph .empty ():
14051405 if not is_connected (graph .G ):
@@ -1408,7 +1408,7 @@ def eval(self, graph, expression, evaluation, options):
14081408 return Integer (nx .node_connectivity (graph .G ))
14091409
14101410 def eval_st (self , graph , s , t , expression , evaluation , options ):
1411- "%(name)s[graph_, s_, t_, OptionsPattern[%(name)s]]"
1411+ "expression: %(name)s[graph_, s_, t_, OptionsPattern[%(name)s]]"
14121412 graph = self ._build_graph (graph , evaluation , options , expression )
14131413 if graph and not graph .empty ():
14141414 if not is_connected (graph .G ):
@@ -1440,7 +1440,7 @@ class VertexDelete(_NetworkXBuiltin):
14401440 summary_text = "remove a vertex"
14411441
14421442 def eval (self , graph , what , expression , evaluation , options ) -> Optional [Graph ]:
1443- "VertexDelete[graph_, what_, OptionsPattern[VertexDelete]]"
1443+ "expression: VertexDelete[graph_, what_, OptionsPattern[VertexDelete]]"
14441444 graph = self ._build_graph (graph , evaluation , options , expression )
14451445 if graph :
14461446 head_name = what .get_head_name ()
@@ -1475,7 +1475,7 @@ class VertexIndex(_NetworkXBuiltin):
14751475 summary_text = "find the position of a vertex"
14761476
14771477 def eval (self , graph , v , expression , evaluation , options ):
1478- "%(name)s[graph_, v_, OptionsPattern[%(name)s]]"
1478+ "expression: %(name)s[graph_, v_, OptionsPattern[%(name)s]]"
14791479 graph = self ._build_graph (graph , evaluation , options , expression )
14801480 if graph :
14811481 try :
@@ -1579,7 +1579,7 @@ class EdgeDelete(_NetworkXBuiltin):
15791579 summary_text = "remove an edge"
15801580
15811581 def eval (self , graph , what , expression , evaluation , options ) -> Optional [Graph ]:
1582- "EdgeDelete[graph_, what_, OptionsPattern[EdgeDelete]]"
1582+ "expression: EdgeDelete[graph_, what_, OptionsPattern[EdgeDelete]]"
15831583 graph = self ._build_graph (graph , evaluation , options , expression )
15841584 if graph :
15851585 head_name = what .get_head_name ()
0 commit comments