Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion barfi/compute_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from .block_builder import Block
from typing import List, Dict

class CyclicConnectionError(RecursionError, NotImplementedError):
pass

class ComputeEngine(object):
def __init__(self, blocks: List[Block] = [], **kwargs) -> None:
Expand Down Expand Up @@ -90,7 +92,7 @@ def _map_block_link(self):
edge_id=_connection['id'])

if not nx.is_directed_acyclic_graph(self._graph):
raise('Cycle(s) detected. Not supported by `barfi` at the moment.')
raise CyclicConnectionError('Cycle(s) detected. Not supported by Barfi at the moment.')
else:
_compu_order = [self._map_block_id_name[node]
for node in nx.topological_sort(self._graph)]
Expand Down