本文整理汇总了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
示例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
示例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)