diff --git a/masque/builder/pather.py b/masque/builder/pather.py index 8b4bb54..1c10625 100644 --- a/masque/builder/pather.py +++ b/masque/builder/pather.py @@ -508,10 +508,13 @@ class Pather(Builder): if 'bound_type' in kwargs: bound_types.add(kwargs['bound_type']) bound = kwargs['bound'] + del kwargs['bound_type'] + del kwargs['bound'] for bt in ('emin', 'emax', 'pmin', 'pmax', 'xmin', 'xmax', 'ymin', 'ymax', 'min_past_furthest'): if bt in kwargs: bound_types.add(bt) bound = kwargs[bt] + del kwargs[bt] if not bound_types: raise BuildError('No bound type specified for mpath') @@ -528,11 +531,11 @@ class Pather(Builder): if len(ports) == 1 and not force_container: # Not a bus, so having a container just adds noise to the layout 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: bld = Pather.interface(source=ports, library=self.library, tools=self.tools) 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) 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_'? diff --git a/masque/builder/utils.py b/masque/builder/utils.py index f23e8d2..51d5e8b 100644 --- a/masque/builder/utils.py +++ b/masque/builder/utils.py @@ -111,9 +111,9 @@ def ell( is_horizontal = numpy.isclose(rotations[0] % pi, 0) if bound_type in ('ymin', 'ymax') and is_horizontal: - raise BuildError('Asked for {bound_type} position but ports are pointing along the x-axis!') + raise BuildError(f'Asked for {bound_type} position but ports are pointing along the x-axis!') elif bound_type in ('xmin', 'xmax') and not is_horizontal: - raise BuildError('Asked for {bound_type} position but ports are pointing along the y-axis!') + raise BuildError(f'Asked for {bound_type} position but ports are pointing along the y-axis!') direction = rotations[0] + pi # direction we want to travel in (+pi relative to port) rot_matrix = rotation_matrix_2d(-direction)