# Path: automlk/dataset.py
# def get_dataset_list(include_results=False):
#     """
#     get the list of all datasets
# 
#     :param include_results: flag to determine if the status are also retrieved (default = False)
#     :return: list of datasets objects or empty list if error (eg. redis or environment not set)
#     """
#     # try:
#     return [get_dataset(dataset_id, include_results) for dataset_id in get_dataset_ids()]
#     # except:
#     #    return []
# 
# Path: automlk/prepare.py
# def prepare_dataset_sets(dt):
#     """
#     creates the train & test set, and the evaluation set per folds
# 
#     :param dt: dataset
#     :return:
#     """
#     # create train & test set
#     X, y, X_train, X_test, y_train, y_test, X_submit, id_submit, i_train, i_test = __create_train_test(dt)
# 
#     # prepare y values
#     y, y_train, y_test = __prepare_y(dt, y, y_train, y_test)
# 
#     # create cv folds
#     cv_folds = __create_cv(dt, X_train, y_train)
# 
#     # prepare and store eval set
#     y_eval_list, y_eval, idx_eval, idx_eval0 = __store_eval_set(dt, y_train, y_test, cv_folds)
# 
#     # then store all these results in a pickle store
#     ds = XySet(X, y, X_train, y_train, X_test, y_test, X_submit, id_submit, cv_folds, y_eval_list, y_eval, idx_eval, idx_eval0)
#     pickle.dump(ds, open(get_dataset_folder(dt.dataset_id) + '/data/eval_set.pkl', 'wb'))
# 
#     # and keep index of split for future use (eg match predictions with initial file)
#     pickle.dump([i_train, i_test], open(get_dataset_folder(dt.dataset_id) + '/data/i_train_test.pkl', 'wb'))


from automlk.dataset import get_dataset_list
from automlk.prepare import prepare_dataset_sets

"""
module specifically designed to update train/test set preparation
"""

for dt in get_dataset_list():
    print(dt.name)

# Path: automlk/dataset.py
# def get_dataset_list(include_results=False):
#     """
#     get the list of all datasets
# 
#     :param include_results: flag to determine if the status are also retrieved (default = False)
#     :return: list of datasets objects or empty list if error (eg. redis or environment not set)
#     """
#     # try:
#     return [get_dataset(dataset_id, include_results) for dataset_id in get_dataset_ids()]
#     # except:
#     #    return []
# 
# Path: automlk/prepare.py
# def prepare_dataset_sets(dt):
#     """
#     creates the train & test set, and the evaluation set per folds
# 
#     :param dt: dataset
#     :return:
#     """
#     # create train & test set
#     X, y, X_train, X_test, y_train, y_test, X_submit, id_submit, i_train, i_test = __create_train_test(dt)
# 
#     # prepare y values
#     y, y_train, y_test = __prepare_y(dt, y, y_train, y_test)
# 
#     # create cv folds
#     cv_folds = __create_cv(dt, X_train, y_train)
# 
#     # prepare and store eval set
#     y_eval_list, y_eval, idx_eval, idx_eval0 = __store_eval_set(dt, y_train, y_test, cv_folds)
# 
#     # then store all these results in a pickle store
#     ds = XySet(X, y, X_train, y_train, X_test, y_test, X_submit, id_submit, cv_folds, y_eval_list, y_eval, idx_eval, idx_eval0)
#     pickle.dump(ds, open(get_dataset_folder(dt.dataset_id) + '/data/eval_set.pkl', 'wb'))
# 
#     # and keep index of split for future use (eg match predictions with initial file)
#     pickle.dump([i_train, i_test], open(get_dataset_folder(dt.dataset_id) + '/data/i_train_test.pkl', 'wb'))


# Path: scripts/update_prepare.py
from automlk.dataset import get_dataset_list
from automlk.prepare import prepare_dataset_sets


"""
module specifically designed to update train/test set preparation
"""

for dt in get_dataset_list():
    print(dt.name)

    prepare_dataset_sets(dt)