Exemplo n.º 1
0
    def convertUnits(self, unitMap):

        unit, factor = PQUModule.convertUnits(self.unit, unitMap)
        if (abs(factor - 1) > (4 * sys.float_info.epsilon)):
            NotImplementedError(
                'Conversion of units for quantity of "%s" not implemented: from unit "" to unit "%s"'
                % (self.moniker, self.unit, unit))
Exemplo n.º 2
0
    def convertUnits(self, unitMap):

        unit, factor = PQUModule.convertUnits(self.unit, unitMap)
        self.unit = unit
        return (factor)
Exemplo n.º 3
0
    def convertUnits(self, unitMap):

        unit, factor = PQUModule.convertUnits(self.unit, unitMap)
        self.__PQ.convertToUnit(unit)
Exemplo n.º 4
0
    def convertUnits(self, unitMap):

        unit, factor = PQUModule.convertUnits(self.unit, unitMap)
        unit = stringToPhysicalUnit(unit)
        self.value = self.value * factor
        self.unit = unit
Exemplo n.º 5
0
    def convertUnits(self, unitMap):

        unit, factor = PQUModule.convertUnits(self.unit, unitMap)
        self.__PQ.convertToUnit(unit)
        if (self.__uncertainty is not None):
            self.__uncertainty.parentConvertingUnits([factor])