示例#1
0
    def map_wires(self, wires):
        # temporarily overwrite this method to bypass
        # wire map that produces Wires objects
        try:
            mapped_wires = [self.wire_map[w] for w in wires]
        except KeyError as e:
            raise WireError(
                "Did not find some of the wires {} on device with wires {}.".
                format(wires.labels, self.wires.labels)) from e

        return mapped_wires
示例#2
0
    def map_wires(self, wires):
        """Map the wire labels of wires using this device's wire map.

        Args:
            wires (Wires): wires whose labels we want to map to the device's internal labelling scheme

        Returns:
            Wires: wires with new labels
        """
        try:
            mapped_wires = wires.map(self.wire_map)
        except WireError as e:
            raise WireError(
                "Did not find some of the wires {} on device with wires {}.".
                format(wires, self.wires)) from e

        return mapped_wires