예제 #1
0
        def generic(self, args, kws):
            from sdc.str_arr_ext import is_str_arr_typ
            assert not kws
            [va, vb] = args
            # if one of the inputs is string array
            if is_str_series_typ(va) or is_str_series_typ(vb):
                # inputs should be either string array or string
                assert is_str_arr_typ(va) or va == string_type
                assert is_str_arr_typ(vb) or vb == string_type
                return signature(SeriesType(types.boolean), va, vb)

            if ((is_dt64_series_typ(va) and vb == string_type)
                    or (is_dt64_series_typ(vb) and va == string_type)):
                return signature(SeriesType(types.boolean), va, vb)
예제 #2
0
파일: set_ext.py 프로젝트: ls-pepper/sdc
def populate_str_arr_from_set(typingctx, in_set_typ, in_str_arr_typ=None):
    assert in_set_typ == set_string_type
    assert is_str_arr_typ(in_str_arr_typ)

    def codegen(context, builder, sig, args):
        in_set, in_str_arr = args

        string_array = context.make_helper(builder, string_array_type, in_str_arr)

        fnty = lir.FunctionType(lir.VoidType(),
                                [lir.IntType(8).as_pointer(),
                                 lir.IntType(32).as_pointer(),
                                 lir.IntType(8).as_pointer(),
                                 ])
        fn_getitem = builder.module.get_or_insert_function(fnty,
                                                           name="populate_str_arr_from_set")
        builder.call(fn_getitem, [in_set, string_array.offsets,
                                  string_array.data])
        return context.get_dummy_value()

    return types.void(set_string_type, string_array_type), codegen
예제 #3
0
파일: set_ext.py 프로젝트: ls-pepper/sdc
def init_set_string_array(A):
    if is_str_arr_typ(A):
        return _build_str_set_impl
예제 #4
0
파일: set_ext.py 프로젝트: ls-pepper/sdc
def build_set(A):
    if is_str_arr_typ(A):
        return _build_str_set_impl
    else:
        return lambda A: set(A)