當前位置: 首頁>>代碼示例>>Python>>正文


Python OutputPort.put_data方法代碼示例

本文整理匯總了Python中sicpythontask.OutputPort.OutputPort.put_data方法的典型用法代碼示例。如果您正苦於以下問題:Python OutputPort.put_data方法的具體用法?Python OutputPort.put_data怎麽用?Python OutputPort.put_data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sicpythontask.OutputPort.OutputPort的用法示例。


在下文中一共展示了OutputPort.put_data方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Constant2

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class Constant2(PythonTask):

    def __init_ports__(self):
        self.out = OutputPort(name="Out", data_type=Int32)

    def execute(self, grp):
        self.out.put_data(Int32(5))
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:9,代碼來源:Constant2.py

示例2: Constant1

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class Constant1(PythonTask):

    def __init_ports__(self):
        self.out = OutputPort(name="Out", data_type=Bool)

    def execute(self, grp):
        self.out.put_data(Bool([False, True], [1, 2]))
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:9,代碼來源:Constant1.py

示例3: Generator

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class Generator(PythonTask):

    def __init_ports__(self):
        self.out = OutputPort(name="out", data_type=Text)

    def generate(self):
        self.out.put_data(Text("Hello World"))
        self.sleep(3000)
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:10,代碼來源:Generator.py

示例4: DataControl

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class DataControl(PythonTask):

    def __init_ports__(self):
        self.in_ = InputPort(name="in", data_type=Control)
        self.out = OutputPort(name="out", data_type=Control)

    def execute(self, grp):
        self.in_.get_data(Control);
        self.out.put_data(Control());
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:11,代碼來源:DataControl.py

示例5: DataTextCastedBool

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class DataTextCastedBool(PythonTask):

    def __init_ports__(self):
        self.in_ = InputPort(name="in", data_type=Bool)
        self.out = OutputPort(name="out", data_type=Text)

    def execute(self, grp):
        inData = self.in_.get_data(Text)
        self.out.put_data(Text(inData.value.upper()))
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:11,代碼來源:DataTextCastedBool.py

示例6: Default

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class Default(PythonTask):

    def __init_ports__(self):
        self.in1 = InputPort(name="in1", data_type=Text)
        self.in2 = InputPort(name="in2", data_type=Text, hold=True)
        self.out = OutputPort(name="out", data_type=Text)

    def execute(self, grp):
        self.out.put_data(Text(self.in1.get_data(Text).values[0] + self.in2.get_data(Text).values[0]));
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:11,代碼來源:Default.py

示例7: GeneratorLong

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class GeneratorLong(PythonTask):

    def __init_ports__(self):
        self.out = OutputPort(name="out")

    def generate(self):
        self.sleep(3000)
        time.sleep(2)
        self.out.put_data(Control());
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:11,代碼來源:GeneratorLong.py

示例8: DataRawDims

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class DataRawDims(PythonTask):

    def __init_ports__(self):
        self.in_ = InputPort(name="in", data_type=Raw)
        self.out = OutputPort(name="out", data_type=Raw)

    def execute(self, grp):
        inData = self.in_.get_data(Raw)
        inRaw = inData.values
        self.out.put_data(Raw(inRaw, inData.dims))
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:12,代碼來源:DataRawDims.py

示例9: DataDecimal

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class DataDecimal(PythonTask):

    def __init_ports__(self):
        self.in_ = InputPort(name="in", data_type=Decimal)
        self.out = OutputPort(name="out", data_type=Decimal)

    def execute(self, grp):
        in1Data = self.in_.get_data(Decimal)
        dec = in1Data.values[0] * D(10)
        self.out.put_data(Decimal(dec))
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:12,代碼來源:DataDecimal.py

示例10: DataTextDims

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class DataTextDims(PythonTask):

    def __init_ports__(self):
        self.in_ = InputPort(name="in", data_type=Text)
        self.out = OutputPort(name="out", data_type=Text)

    def execute(self, grp):
        inData = self.in_.get_data(Text)
        inText = inData.values
        self.out.put_data(Text(inText, inData.dims))
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:12,代碼來源:DataTextDims.py

示例11: Constant2Add

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class Constant2Add(PythonTask):

    def __init_ports__(self):
        self.in_1 = InputPort(name="In 1", data_type=Int32)
        self.in_2 = InputPort(name="In 2", data_type=Int32)
        self.out = OutputPort(name="Out", data_type=Int32)

    def execute(self, grp):
        suma = Int32(self.in_1.get_data(Int32).value + self.in_2.get_data(Int32).value)
        self.out.put_data(suma)
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:12,代碼來源:Constant2Add.py

示例12: DataBool

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class DataBool(PythonTask):

    def __init_ports__(self):
        self.in1 = InputPort(name="in1", data_type=Bool)
        self.in2 = InputPort(name="in2", data_type=Bool)
        self.out = OutputPort(name="out", data_type=Bool)

    def execute(self, grp):
        in1Bool = self.in1.get_data(Bool)
        in2Bool = self.in2.get_data(Bool)
        self.out.put_data(Bool(in1Bool.values[0] and in2Bool.values[0]))
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:13,代碼來源:DataBool.py

示例13: RandomGenerator

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class RandomGenerator(PythonTask):

    def __init_ports__(self):
        self.out = OutputPort(name="out", data_type=Float32)
        
    def generate(self):
        self.sleep(100)
        mu    = int(self.get_parameter("mu"))
        sigma = int(self.get_parameter("sigma"))
        v = np.random.normal(mu, sigma, 10000)
        self.out.put_data(Float32(v.tolist(),[1, len(v)]))
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:13,代碼來源:RandomGenerator.py

示例14: DataFloat32

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class DataFloat32(PythonTask):

    def __init_ports__(self):
        self.in1 = InputPort(name="in1", data_type=Float32)
        self.in2 = InputPort(name="in2", data_type=Float32)
        self.out = OutputPort(name="out", data_type=Float32)

    def execute(self, grp):
        in1Data = self.in1.get_data(Float32)
        in2Data = self.in2.get_data(Float32)
        self.out.put_data(Float32(in1Data.value + in2Data.value))
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:13,代碼來源:DataFloat32.py

示例15: DataInt64Dims

# 需要導入模塊: from sicpythontask.OutputPort import OutputPort [as 別名]
# 或者: from sicpythontask.OutputPort.OutputPort import put_data [as 別名]
class DataInt64Dims(PythonTask):

    def __init_ports__(self):
        self.in1 = InputPort(name="in1", data_type=Int64)
        self.in2 = InputPort(name="in2", data_type=Int64)
        self.out = OutputPort(name="out", data_type=Int64)

    def execute(self, grp):
        in1Data = self.in1.get_data(Int64)
        in2Data = self.in2.get_data(Int64)
        ret = list(map(add, in1Data.values, in2Data.values))
        self.out.put_data(Int64(ret, in1Data.dims))
開發者ID:systemincloud,項目名稱:sic-examples,代碼行數:14,代碼來源:DataInt64Dims.py


注:本文中的sicpythontask.OutputPort.OutputPort.put_data方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。