pass kwargs down into tool's path() calls

This commit is contained in:
Jan Petykiewicz 2023-11-12 02:30:11 -08:00
parent 41d670eef3
commit 1f6d78386c

View File

@ -508,10 +508,13 @@ class Pather(Builder):
if 'bound_type' in kwargs: if 'bound_type' in kwargs:
bound_types.add(kwargs['bound_type']) bound_types.add(kwargs['bound_type'])
bound = kwargs['bound'] bound = kwargs['bound']
del kwargs['bound_type']
del kwargs['bound']
for bt in ('emin', 'emax', 'pmin', 'pmax', 'xmin', 'xmax', 'ymin', 'ymax', 'min_past_furthest'): for bt in ('emin', 'emax', 'pmin', 'pmax', 'xmin', 'xmax', 'ymin', 'ymax', 'min_past_furthest'):
if bt in kwargs: if bt in kwargs:
bound_types.add(bt) bound_types.add(bt)
bound = kwargs[bt] bound = kwargs[bt]
del kwargs[bt]
if not bound_types: if not bound_types:
raise BuildError('No bound type specified for mpath') raise BuildError('No bound type specified for mpath')
@ -528,11 +531,11 @@ class Pather(Builder):
if len(ports) == 1 and not force_container: if len(ports) == 1 and not force_container:
# Not a bus, so having a container just adds noise to the layout # Not a bus, so having a container just adds noise to the layout
port_name = tuple(portspec)[0] port_name = tuple(portspec)[0]
return self.path(port_name, ccw, extensions[port_name], tool_port_names=tool_port_names) return self.path(port_name, ccw, extensions[port_name], tool_port_names=tool_port_names, **kwargs)
else: else:
bld = Pather.interface(source=ports, library=self.library, tools=self.tools) bld = Pather.interface(source=ports, library=self.library, tools=self.tools)
for port_name, length in extensions.items(): for port_name, length in extensions.items():
bld.path(port_name, ccw, length, tool_port_names=tool_port_names) bld.path(port_name, ccw, length, tool_port_names=tool_port_names, **kwargs)
name = self.library.get_name(base_name) name = self.library.get_name(base_name)
self.library[name] = bld.pattern self.library[name] = bld.pattern
return self.plug(Abstract(name, bld.pattern.ports), {sp: 'in_' + sp for sp in ports.keys()}) # TODO safe to use 'in_'? return self.plug(Abstract(name, bld.pattern.ports), {sp: 'in_' + sp for sp in ports.keys()}) # TODO safe to use 'in_'?