File size: 581 Bytes
effde1c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
"""
Lightweight shim for `graph` used by trace_back tests. This provides minimal
APIs used by tests so imports succeed during test collection.
"""
from typing import Any, List, Tuple
class Graph:
def __init__(self):
self.nodes = []
self.edges = []
@staticmethod
def build_problem(problem: Any, defs: Any) -> Tuple[Any, Any]:
# Return a trivial graph and mapping for tests
return Graph(), {}
def names2nodes(args: List[Any]) -> List[int]:
return list(range(len(args)))
__all__ = ["Graph", "names2nodes"]
|