コード例 #1
0
def __process_compute_kind(source: Parameter, raw_data, pipeline_topic):
    # print("__process_compute_kind ",__is_date_func(source.type))
    if __is_date_func(source.type):
        value_list = get_source_value_list(
            pipeline_topic, raw_data,
            Parameter.parse_obj(source.parameters[0]))
        if type(value_list) == list:
            result = []
            for value in value_list:
                result.append(__process_date_func(source, value))
            return result
        else:
            return __process_date_func(source, value_list)
    elif __is_calculation_operation(source.type):
        operator = __get_operator(source.type)
        value_list = []
        for parameter in source.parameters:
            value = get_source_value_list(pipeline_topic, raw_data,
                                          Parameter.parse_obj(parameter))
            if type(value) is list:
                value_list.append(np.array(value))
            else:
                value_list.append(value)
        # print("value :", value_list)

        return __process_operator(operator, value_list).tolist()
コード例 #2
0
def __process_compute_kind(source: Parameter,
                           raw_data,
                           pipeline_topic,
                           target_factor=None,
                           context=None):
    if __is_date_func(source.type):
        value_list = get_source_value_list(
            pipeline_topic, raw_data,
            Parameter.parse_obj(source.parameters[0]), target_factor)
        if type(value_list) == list:
            result = []
            for value in value_list:
                result.append(__process_date_func(source, value))
            return result
        else:
            return __process_date_func(source, value_list)
    elif __is_calculation_operation(source.type):
        operator = __get_operator(source.type)
        value_list = []
        for parameter in source.parameters:
            value = get_source_value_list(pipeline_topic, raw_data,
                                          Parameter.parse_obj(parameter),
                                          target_factor, context)
            if type(value) is list:
                value_list.append(np.array(value))
            else:
                value_list.append(value)
        return __process_operator(operator, value_list)
コード例 #3
0
def __process_compute_date(parameter, pipeline_topic, raw_data):
    value_list = get_source_value_list(pipeline_topic, raw_data, Parameter.parse_obj(parameter.parameters[0]))
    if type(value_list) == list:
        result = []
        for value in value_list:
            result.append(__process_date_func(parameter, value))
        return result
    else:
        return __process_date_func(parameter, value_list)