Skip to content

Commit fc0bf55

Browse files
Copilottoby-coleman
andcommitted
Address code review: remove unused ValidationError class and redundant filter
Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
1 parent 26c0cb5 commit fc0bf55

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

plugboard-schemas/plugboard_schemas/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from ._common import PlugboardBaseModel
1212
from ._graph import simple_cycles
1313
from ._validation import (
14-
ValidationError,
1514
validate_all_inputs_connected,
1615
validate_input_events,
1716
validate_no_unresolved_cycles,
@@ -92,7 +91,6 @@
9291
"TuneArgsDict",
9392
"TuneArgsSpec",
9493
"TuneSpec",
95-
"ValidationError",
9694
"simple_cycles",
9795
"validate_all_inputs_connected",
9896
"validate_input_events",

plugboard-schemas/plugboard_schemas/_validation.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
from .connector import ConnectorSpec
2020

2121

22-
class ValidationError(Exception):
23-
"""Raised when a process specification fails validation."""
24-
25-
pass
26-
27-
2822
def _build_component_graph(
2923
connectors: list[ConnectorSpec],
3024
) -> dict[str, set[str]]:
@@ -62,13 +56,12 @@ def _get_edges_in_cycle(
6256
List of connector specs that are part of the cycle.
6357
"""
6458
cycle_edges: list[ConnectorSpec] = []
65-
cycle_set = set(cycle)
6659
for i, node in enumerate(cycle):
6760
next_node = cycle[(i + 1) % len(cycle)]
6861
for conn in connectors:
6962
if conn.source.entity == node and conn.target.entity == next_node:
7063
cycle_edges.append(conn)
71-
return [c for c in cycle_edges if c.source.entity in cycle_set and c.target.entity in cycle_set]
64+
return cycle_edges
7265

7366

7467
def validate_all_inputs_connected(

0 commit comments

Comments
 (0)