コード例 #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))
コード例 #2
0
ファイル: axes.py プロジェクト: awgolas/wellington
    def convertUnits(self, unitMap):

        unit, factor = PQUModule.convertUnits(self.unit, unitMap)
        self.unit = unit
        return (factor)
コード例 #3
0
ファイル: physicalQuantity.py プロジェクト: alhajri/FUDGE
    def convertUnits(self, unitMap):

        unit, factor = PQUModule.convertUnits(self.unit, unitMap)
        self.__PQ.convertToUnit(unit)
コード例 #4
0
    def convertUnits(self, unitMap):

        unit, factor = PQUModule.convertUnits(self.unit, unitMap)
        unit = stringToPhysicalUnit(unit)
        self.value = self.value * factor
        self.unit = unit
コード例 #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])