fixup! [AutoTool] Use more dataclasses to clarify internal code
This commit is contained in:
parent
c7a8fac890
commit
41bbfee80b
@ -473,8 +473,8 @@ class AutoTool(Tool, metaclass=ABCMeta):
|
||||
class Transition:
|
||||
""" Description of a pre-rendered transition """
|
||||
abstract: Abstract
|
||||
our_port_name: str
|
||||
their_port_name: str
|
||||
our_port_name: str
|
||||
|
||||
@property
|
||||
def our_port(self) -> Port:
|
||||
@ -511,7 +511,7 @@ class AutoTool(Tool, metaclass=ABCMeta):
|
||||
""" Default value for out_ptype """
|
||||
|
||||
def add_complementary_transitions(self) -> Self:
|
||||
for iioo in self.transitions:
|
||||
for iioo in list(self.transitions.keys()):
|
||||
ooii = (iioo[1], iioo[0])
|
||||
self.transitions.setdefault(ooii, self.transitions[iioo].reversed())
|
||||
return self
|
||||
@ -535,6 +535,8 @@ class AutoTool(Tool, metaclass=ABCMeta):
|
||||
|
||||
tree, pat = Library.mktree(SINGLE_USE_PREFIX + 'path')
|
||||
pat.add_port_pair(names=port_names, ptype='unk' if in_ptype is None else in_ptype)
|
||||
if data.in_transition:
|
||||
pat.plug(data.in_transition.abstract, {port_names[1]: data.in_transition.their_port_name})
|
||||
if not numpy.isclose(data.straight_length, 0):
|
||||
straight_pat_or_tree = data.straight.fn(data.straight_length, **kwargs)
|
||||
if isinstance(straight_pat_or_tree, Pattern):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user