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


Python OutputPort.OutputPort类代码示例

本文整理汇总了Python中sicpythontask.OutputPort.OutputPort的典型用法代码示例。如果您正苦于以下问题:Python OutputPort类的具体用法?Python OutputPort怎么用?Python OutputPort使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Constant2

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,代码行数:7,代码来源:Constant2.py

示例2: Constant1

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,代码行数:7,代码来源:Constant1.py

示例3: Generator

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,代码行数:8,代码来源:Generator.py

示例4: DataControl

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,代码行数:9,代码来源:DataControl.py

示例5: DataTextCastedBool

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,代码行数:9,代码来源:DataTextCastedBool.py

示例6: Default

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,代码行数:9,代码来源:Default.py

示例7: GeneratorLong

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,代码行数:9,代码来源:GeneratorLong.py

示例8: DataRawDims

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,代码行数:10,代码来源:DataRawDims.py

示例9: DataDecimal

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,代码行数:10,代码来源:DataDecimal.py

示例10: DataTextDims

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,代码行数:10,代码来源:DataTextDims.py

示例11: Constant2Add

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,代码行数:10,代码来源:Constant2Add.py

示例12: DataBool

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,代码行数:11,代码来源:DataBool.py

示例13: RandomGenerator

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,代码行数:11,代码来源:RandomGenerator.py

示例14: DataFloat32

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,代码行数:11,代码来源:DataFloat32.py

示例15: DataInt64Dims

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,代码行数:12,代码来源:DataInt64Dims.py


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