@@ -22,7 +22,7 @@ def euclidean_distance(point1: list[float], point2: list[float]) -> float:
2222 0.0
2323 >>> euclidean_distance([1, 1], ['a', 1])
2424 Traceback (most recent call last):
25- ...
25+ ...
2626 ValueError: Invalid input: Points must be numerical coordinates
2727 """
2828 try :
@@ -42,17 +42,17 @@ def validate_graph(graph_points: dict[str, list[float]]) -> None:
4242 >>> validate_graph({"A": [10, 20], "B": [30, 21], "C": [15, 35]}) # Valid graph
4343 >>> validate_graph({"A": [10, 20], "B": [30, "invalid"], "C": [15, 35]})
4444 Traceback (most recent call last):
45- ...
45+ ...
4646 InvalidGraphError: Each node must have a valid 2D coordinate [x, y]
4747
4848 >>> validate_graph([10, 20]) # Invalid input type
4949 Traceback (most recent call last):
50- ...
50+ ...
5151 InvalidGraphError: Graph must be a dictionary with node names and coordinates
5252
5353 >>> validate_graph({"A": [10, 20], "B": [30, 21], "C": [15]}) # Missing coordinate
5454 Traceback (most recent call last):
55- ...
55+ ...
5656 InvalidGraphError: Each node must have a valid 2D coordinate [x, y]
5757 """
5858 if not isinstance (graph_points , dict ):
0 commit comments