From 3aa3fac5c348ec7d7c5bfa06081c99ad5cd206a2 Mon Sep 17 00:00:00 2001 From: Bancie <144613141+Bancie@users.noreply.github.com> Date: Mon, 9 Sep 2024 21:30:12 +0700 Subject: [PATCH] chore --- app/tests/backup.py | 47 +------------------------- app/tests/list.py | 70 --------------------------------------- app/tests/test.py | 15 +-------- app/tilearn/_list/_run.py | 11 ++---- 4 files changed, 5 insertions(+), 138 deletions(-) delete mode 100644 app/tests/list.py diff --git a/app/tests/backup.py b/app/tests/backup.py index 24ce16692..2c52e8114 100644 --- a/app/tests/backup.py +++ b/app/tests/backup.py @@ -6,56 +6,11 @@ import shutil import glob -# data.backup('/Users/chibangnguyen/Documents/TiLearn/app/tests', '/Users/chibangnguyen/Documents/TiLearn/app/tests/backup') - lists = [ pl.List(file_path='/Users/chibangnguyen/Documents/TiLearn/app/tests/data.csv', prec=0), pl.List(file_path='/Users/chibangnguyen/Documents/TiLearn/app/tests/data2.csv', prec=1), pl.List(file_path='/Users/chibangnguyen/Documents/TiLearn/app/tests/data3.csv', prec=1) ] -# print(pl.location(lists, type='row')) -# for row in lists[pl.location(lists, type='sub')].run(): -# print(row) - -# print(tl.file_seek(lists, '/Users/chibangnguyen/Documents/TiLearn/app/tests/backup')) - -# opt_list = lists[pl.location(lists, type='sub')].path -# print(opt_list) -# print(pl.location(lists, type='sub')) - -# tl.optimal_list(lists, '/Users/chibangnguyen/Documents/TiLearn/app/tests', '/Users/chibangnguyen/Documents/TiLearn/app/tests/backup') -# print(tl.optimal_list(lists, '/Users/chibangnguyen/Documents/TiLearn/app/tests', '/Users/chibangnguyen/Documents/TiLearn/app/tests/backup')) for row in tl.optimal_list(lists, '/Users/chibangnguyen/Documents/TiLearn/app/tests', '/Users/chibangnguyen/Documents/TiLearn/app/tests/backup'): - print(row) - -# row_list = pl.location(lists, type='row') -# opt_file = lists[pl.location(lists, type='sub')].path - -# print(row_list, opt_file) -# print(data.prec(opt_file, row_list)) -# rows = data.none(opt_file, row_list) -# print(rows) - -# data.updated(opt_file, prec=1, opt_row=row_list) -# data.clear('/Users/chibangnguyen/Documents/TiLearn/app/tests/backup') - -# print(tl.set_const(lists, prec=1)) - - -# data.clear('/Users/chibangnguyen/Documents/TiLearn/app/tests/backup') - -# for row in tl.optimal_list(lists,'/Users/chibangnguyen/Documents/TiLearn/app/tests', '/Users/chibangnguyen/Documents/TiLearn/app/tests/backup'): -# print(row) - -# data.updated('/Users/chibangnguyen/Documents/TiLearn/app/tests/backup/data.csv', prec=1, opt_row=1) - -# print(pl.ja_all('/Users/chibangnguyen/Documents/TiLearn/app/tests', lists)) -# print(tl.set_const(lists, prec=1)) - -# for sublist in lists: -# print(sublist.path()) -# print(lists[1].path) - -# for sublist in lists: -# print(sublist.path) + print(row) \ No newline at end of file diff --git a/app/tests/list.py b/app/tests/list.py deleted file mode 100644 index 4c5e377d7..000000000 --- a/app/tests/list.py +++ /dev/null @@ -1,70 +0,0 @@ -import tilearn as tl -from tilearn import _data as data -from tilearn import _plat as pl - -lists = [ - pl.List(data=data.read_file('/Users/chibangnguyen/Documents/TiLearn/app/tests/data.csv'), prec=1), - pl.List(data=data.read_file('/Users/chibangnguyen/Documents/TiLearn/app/tests/data2.csv'), prec=1), - pl.List(data=data.read_file('/Users/chibangnguyen/Documents/TiLearn/app/tests/data3.csv'), prec=1) -] - -# 2D list example -# matrix = [[1, 2, 3], -# [4, 5, 6], -# [7, 8, 9]] - -# del matrix[0:1] - -# print(matrix) - - -# print(pl.location(lists, type='row')) - -# print(tl.optimal_list('/Users/chibangnguyen/Documents/TiLearn/app/tests', lists)) - -# opt_list = lists[pl.location(lists, type='sub')].run() -# print(opt_list[2]) -# print(tl.set(lists)) - -# set_j = [] -# opt_list = lists[pl.location(lists, type='sub')].run() -# row_list = pl.location(lists, type='row') - -# print(tl.set_non(lists)) - -# print(tl.updated(lists, set_j, opt_list, row_list)) - -# for row in tl.updated(lists, set_j, opt_list, row_list): -# print(row) - -# print(tl.optimal_list('/Users/chibangnguyen/Documents/TiLearn/app/tests', lists)) - -for row in tl.optimal_list('/Users/chibangnguyen/Documents/TiLearn/app/tests', lists): - print(row) -# print(lists[0].info()) - - -# print(tl.set_const(lists, prec=0)) -# print(tl.set_non(lists)) -# print(tl.set_prec(lists)) -# print(tl.set_const(lists, prec=0)) - -# opt_list = lists[tl.opt_loca(lists, pick='sub')].run() -# row_list = tl.opt_loca(lists, pick='row') -# opt_list = np.delete(opt_list, row_list, axis=0) -# print(opt_list) - -# for sublist in lists: -# for row in sublist.run(): -# print(row) - -# print('\n') - -# for row in tl.set_construct(lists, 0): -# print(row) - -# print(tl.set_const(lists, 1)) -# print(tl.ja_all('/Users/chibangnguyen/Documents/TiLearn/app/tests', lists)) - -# print(tl.main_list('/Users/chibangnguyen/Documents/TiLearn/app/tests', lists)) - diff --git a/app/tests/test.py b/app/tests/test.py index 5d532de7e..859c83581 100644 --- a/app/tests/test.py +++ b/app/tests/test.py @@ -12,20 +12,7 @@ ['luyen de', 2, 0, 7, 1], ['final', 6, 0, 2, 2]] -# schedule = tl.wspt(data) - -# schedule = tl.c_time(data) -# full_schedule = tl.lateness(data) - -# schedule = tl.edd(data) - schedule = tl.wspt_prec(data) for row in schedule: - print(row) - -print('\n') - -max_value = max([row[5] for row in data]) - -print(max_value) \ No newline at end of file + print(row) \ No newline at end of file diff --git a/app/tilearn/_list/_run.py b/app/tilearn/_list/_run.py index b86bdfe10..3d7d33edc 100644 --- a/app/tilearn/_list/_run.py +++ b/app/tilearn/_list/_run.py @@ -5,7 +5,6 @@ def set_prec(lists, op, row): set = tl.list_gen(row, 6) - # opt_list = lists[pl.location(lists, type='sub')].run() for i in range(len(set)): for j in range(len(set[i])): if i == 0 and j == 0: @@ -15,8 +14,6 @@ def set_prec(lists, op, row): def set(lists, op, row): set = tl.list_gen(1, 6) - # opt_list = lists[pl.location(lists, type='sub')].run() - # opt_row = pl.location(lists, type='row')-1 fix_row = row for i in range(len(set)): for j in range(len(set[i])): @@ -48,9 +45,9 @@ def optimal_list(lists, path, backup_path): opt_file = lists[pl.location(lists, type='sub')].path check = lists[pl.location(lists, type='sub')].check() if check == 1: - # if file_seek(lists, path=backup_path) == 1: - # set_j.extend(opt_list) - # break + if file_seek(lists, path=backup_path) == 1: + set_j.extend(opt_list) + break set_j.extend(set_const(lists, prec=1, op=opt_list, row=row_list+1)) data.updated(opt_file, prec=1, opt_row=row_list) jc -= row_list+1 @@ -58,7 +55,5 @@ def optimal_list(lists, path, backup_path): set_j.extend(set_const(lists, prec=0, op=opt_list, row=row_list)) data.updated(opt_file, prec=0, opt_row=row_list) jc -= 1 - # print(file_seek(lists, path=backup_path)) - # print(set_j, '\n') data.clear(backup_path) return set_j \ No newline at end of file