vflow/vset.py
def _apply_func_cached(out_dict: dict, is_async: bool, *args):
    '''
    Params
    ------
    *args: List[Dict]: takes multiple dicts and combines them into one.
            Then runs modules on each item in combined dict.
    out_dict: the dictionary to pass to the matching function. If None, defaults to self.modules.

    Returns
    -------
    results: dict
        with items being determined by functions in module set.
        Functions and input dictionaries are currently matched using  matching = 'cartesian' format.
            e.g. inputs:    module = {LR : logistic}, data = {train_1 : [X1,y1], train2 : [X2,y2]}
                 out:    out_dict = {(train_1, LR)  : fitted logistic, (train_2, LR) :  fitted logistic}.
        Currently matching = 'subset' is not used...
    '''
    # deepcopy args to avoid mutating them
    args = deepcopy(args)

    for ele in args:
        if not isinstance(ele, dict):
            raise Exception('Need to run init_args before calling module_set!')
        if is_async:
            # send data to the remote object store
            for k, v in ele.items():
                if k != PREV_KEY:
                    ele[k] = ray.put(v)

    data_dict = combine_dicts(*args)
    out_dict = apply_modules(out_dict, data_dict)

    if is_async:
        out_keys = list(out_dict.keys())
        out_vals = ray.get(list(out_dict.values()))
        out_dict = dict(zip(out_keys, out_vals))

    return data_dict, out_dict

    Params
    ------
    *args: List[Dict]: takes multiple dicts and combines them into one.
            Then runs modules on each item in combined dict.
    out_dict: the dictionary to pass to the matching function. If None, defaults to self.modules.

    Returns
    -------
    results: dict
        with items being determined by functions in module set.
        Functions and input dictionaries are currently matched using  matching = 'cartesian' format.
            e.g. inputs:    module = {LR : logistic}, data = {train_1 : [X1,y1], train2 : [X2,y2]}
                 out:    out_dict = {(train_1, LR)  : fitted logistic, (train_2, LR) :  fitted logistic}.
        Currently matching = 'subset' is not used...
    
Params
args: List[Dict]: takes multiple dicts and combines them into one.
Then runs modules on each item in combined dict.
out_dict: the dictionary to pass to the matching function. If None, defaults to self.modules.

Returns

dict
with items being determined by functions in module set.
Functions and input dictionaries are currently matched using  matching = 'cartesian' format.
Params args : List [ Dict ] : takes multiple dicts and combines them into one . Then runs modules on each item in combined dict . out_dict : the dictionary to pass to the matching function . If None defaults to self . modules . Returns dict with items being determined by functions in module set . Functions and input dictionaries are currently matched using matching = ' cartesian ' format .
def _apply_func_cached(out_dict: dict, is_async: bool, *args):
    args = deepcopy(args)
    for ele in args:
        if not isinstance(ele, dict):
            raise Exception('Need to run init_args before calling module_set!')
        if is_async:
            for k, v in ele.items():
                if k != PREV_KEY:
                    ele[k] = ray.put(v)
    data_dict = combine_dicts(*args)
    out_dict = apply_modules(out_dict, data_dict)
    if is_async:
        out_keys = list(out_dict.keys())
        out_vals = ray.get(list(out_dict.values()))
        out_dict = dict(zip(out_keys, out_vals))
    return data_dict, out_dict
def _apply_func_cached ( out_dict : dict , is_async : bool , * args ) : args = deepcopy ( args ) for ele in args : if not isinstance ( ele , dict ) : raise Exception ( 'Need to run init_args before calling module_set!' ) if is_async : for k , v in ele . items ( ) : if k != PREV_KEY : ele [ k ] = ray . put ( v ) data_dict = combine_dicts ( * args ) out_dict = apply_modules ( out_dict , data_dict ) if is_async : out_keys = list ( out_dict . keys ( ) ) out_vals = ray . get ( list ( out_dict . values ( ) ) ) out_dict = dict ( zip ( out_keys , out_vals ) ) return data_dict , out_dict
Params
args: List[Dict]: takes multiple dicts and combines them into one.
Params args : List [ Dict ] : takes multiple dicts and combines them into one .
'''
    Params
    ------
    *args: List[Dict]: takes multiple dicts and combines them into one.
            Then runs modules on each item in combined dict.
    out_dict: the dictionary to pass to the matching function. If None, defaults to self.modules.

    Returns
    -------
    results: dict
        with items being determined by functions in module set.
        Functions and input dictionaries are currently matched using  matching = 'cartesian' format.
            e.g. inputs:    module = {LR : logistic}, data = {train_1 : [X1,y1], train2 : [X2,y2]}
                 out:    out_dict = {(train_1, LR)  : fitted logistic, (train_2, LR) :  fitted logistic}.
        Currently matching = 'subset' is not used...
    ''' # deepcopy args to avoid mutating them # send data to the remote object store
out_dict
dict
is_async
bool