本文整理汇总了Python中algotrader.technical.pipeline.PipeLine.get_input_name方法的典型用法代码示例。如果您正苦于以下问题:Python PipeLine.get_input_name方法的具体用法?Python PipeLine.get_input_name怎么用?Python PipeLine.get_input_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类algotrader.technical.pipeline.PipeLine
的用法示例。
在下文中一共展示了PipeLine.get_input_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from algotrader.technical.pipeline import PipeLine [as 别名]
# 或者: from algotrader.technical.pipeline.PipeLine import get_input_name [as 别名]
def __init__(self, input_lhs, input_rhs, func, name, length=1, input_key='close', desc="Pairwise"):
super(Pairwise, self).__init__(name, [input_lhs, input_rhs], input_key, length=length, desc=desc)
self.lhs_name = PipeLine.get_input_name(input_lhs)
self.rhs_name = PipeLine.get_input_name(input_rhs)
self.func = func
self.is_input_pipeline = False
if isinstance(input_lhs, PipeLine) and not isinstance(input_rhs, PipeLine):
raise TypeError("input_lhs has to be the same type as input_rhs as Pipeline")
if isinstance(input_lhs, Indicator) and not isinstance(input_rhs, Indicator):
raise TypeError("input_lhs has to be the same type as input_rhs as Indicator")
if isinstance(input_lhs, DataSeries) and not isinstance(input_rhs, DataSeries):
raise TypeError("input_lhs has to be the same type as input_rhs as DataSeries")
if isinstance(input_lhs, PipeLine):
self.is_input_pipeline = True
try:
np.testing.assert_almost_equal(input_lhs.shape(), input_rhs.shape(), 10)
self.__shape = input_lhs.shape()
except AssertionError as e:
raise ValueError("input_lhs shape should be the same as input_rhs in Pairwise Pipeline operation!")
else:
self.__shape = np.array([1, 1])
super(Pairwise, self).update_all()