当前位置: 首页>>代码示例>>Python>>正文


Python NP.double方法代码示例

本文整理汇总了Python中augustus.core.NumpyInterface.NP.double方法的典型用法代码示例。如果您正苦于以下问题:Python NP.double方法的具体用法?Python NP.double怎么用?Python NP.double使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在augustus.core.NumpyInterface.NP的用法示例。


在下文中一共展示了NP.double方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __call__

# 需要导入模块: from augustus.core.NumpyInterface import NP [as 别名]
# 或者: from augustus.core.NumpyInterface.NP import double [as 别名]
    def __call__(self, x, y):
        """Transform the point x, y from this inner coordinate system
        all the way out to the outermost global coordinates, the
        coordinates of the SVG file.

        @type x: number
        @param x: The horizontal position in this coordinate system.
        @type y: number
        @param y: The vertical position in this coordinate system.
        @rtype: 2-tuple of numbers
        @return: The X, Y position in the outermost global coordinates.
        """

        if not isinstance(x, (NP.ndarray, NP.double)):
            x = NP.double(x)
        if not isinstance(y, (NP.ndarray, NP.double)):
            y = NP.double(y)

        x, y = self._fx(x), self._fy(y)

        if isinstance(x, NP.ndarray):
            infinite = NP("isinf", x)
            minusInfinity = NP("logical_and", infinite, NP(x < 0.0))
            x[infinite] = self.outerYPlusInfinity
            x[minusInfinity] = self.outerYMinusInfinity
        else:
            if x == float("inf"):
                x = self.outerYPlusInfinity
            elif x == float("-inf"):
                x = self.outerYMinusInfinity

        if isinstance(y, NP.ndarray):
            infinite = NP("isinf", y)
            minusInfinity = NP("logical_and", infinite, NP(y < 0.0))
            y[infinite] = self.outerYPlusInfinity
            y[minusInfinity] = self.outerYMinusInfinity
        else:
            if y == float("inf"):
                y = self.outerYPlusInfinity
            elif y == float("-inf"):
                y = self.outerYMinusInfinity

        x, y = super(PlotCoordinatesWindow, self).__call__(x, y)
        return x, y
开发者ID:Huskyeder,项目名称:augustus,代码行数:46,代码来源:PlotCoordinatesWindow.py

示例2: __call__

# 需要导入模块: from augustus.core.NumpyInterface import NP [as 别名]
# 或者: from augustus.core.NumpyInterface.NP import double [as 别名]
    def __call__(self, x, y):
        """Transform the point x, y from this inner coordinate system
        all the way out to the outermost global coordinates, the
        coordinates of the SVG file.

        @type x: number
        @param x: The horizontal position in this coordinate system.
        @type y: number
        @param y: The vertical position in this coordinate system.
        @rtype: 2-tuple of numbers
        @return: The X, Y position in the outermost global coordinates.
        """

        if not isinstance(x, (NP.ndarray, NP.double)):
            x = NP.double(x)
        if not isinstance(y, (NP.ndarray, NP.double)):
            y = NP.double(y)

        x, y = self.xoffset + x, self.yoffset + y
        x, y = super(PlotCoordinatesOffset, self).__call__(x, y)
        return x, y
开发者ID:Huskyeder,项目名称:augustus,代码行数:23,代码来源:PlotCoordinatesOffset.py

示例3: _stringToValue_double

# 需要导入模块: from augustus.core.NumpyInterface import NP [as 别名]
# 或者: from augustus.core.NumpyInterface.NP import double [as 别名]
 def _stringToValue_double(self, string):
     return NP.double(string)
开发者ID:Huskyeder,项目名称:augustus,代码行数:4,代码来源:FieldType.py


注:本文中的augustus.core.NumpyInterface.NP.double方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。