Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit cd25d3e

Browse files
committed
Add two test for parameter value.
1 parent e6cae6d commit cd25d3e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/sage/graphs/generic_graph.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13016,7 +13016,7 @@ def random_subgraph(self, p, inplace=False):
1301613016
vertices.append(v)
1301713017
return self.subgraph(vertices=vertices, inplace=inplace)
1301813018

13019-
def is_chordal(self, certificate = False, algorithm = "B"):
13019+
def is_chordal(self, certificate=False, algorithm="B"):
1302013020
r"""
1302113021
Tests whether the given graph is chordal.
1302213022

@@ -13160,6 +13160,9 @@ def is_chordal(self, certificate = False, algorithm = "B"):
1316013160
Pacific J. Math 1965
1316113161
Vol. 15, number 3, pages 835--855
1316213162
"""
13163+
if algorithm not in ['A', 'B']:
13164+
raise ValueError('unknown algorithm "{}"'.format(algorithm))
13165+
1316313166
self._scream_if_not_simple()
1316413167

1316513168
# If the graph is not connected, we are computing the result on each component
@@ -22364,7 +22367,7 @@ class by some canonization function `c`. If `G` and `H` are graphs,
2236422367
deprecation(19517, "Verbosity-parameter is removed.")
2236522368

2236622369
# Check parameter combinations
22367-
if algorithm and algorithm not in ['sage', 'bliss']:
22370+
if algorithm not in [None, 'sage', 'bliss']:
2236822371
raise ValueError("'algorithm' must be equal to 'bliss', 'sage', or None")
2236922372
if algorithm != 'bliss' and not return_graph:
2237022373
raise ValueError("return_graph=False can only be used with algorithm='bliss'")

0 commit comments

Comments
 (0)