diff --git a/.vscode/launch.json b/.vscode/launch.json index 80f4077..87ed9da 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,7 @@ "console": "integratedTerminal", "justMyCode": true, "args": [ - "--exp", "without_exp", + "--exp", "with_exp", "--reset_db", "True", "--job", "24" ] diff --git a/SQL_check_num_dis_firm_in_ts.sql b/SQL_check_num_dis_firm_in_ts.sql index a944a04..2d8ccc1 100644 --- a/SQL_check_num_dis_firm_in_ts.sql +++ b/SQL_check_num_dis_firm_in_ts.sql @@ -10,6 +10,7 @@ iiabmdb.with_exp_result where s_id = '54170'; SELECT * FROM iiabmdb.with_exp_sample where id='54170'; +SELECT * FROM iiabmdb.with_exp_experiment where id='1084'; SELECT max(id) FROM iiabmdb.with_exp_sample; select * from diff --git a/SQL_export_high_risk_setting.sql b/SQL_export_high_risk_setting.sql index 0fe1d06..7daf767 100644 --- a/SQL_export_high_risk_setting.sql +++ b/SQL_export_high_risk_setting.sql @@ -1,3 +1,5 @@ +select count(*) from iiabmdb.without_exp_sample; + select distinct s_id from iiabmdb.without_exp_result where ts > 0; select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id order by max_ts; select e_id, count(id) as count, max(max_ts) as max_max_ts from iiabmdb.without_exp_sample as a @@ -13,5 +15,5 @@ inner join (select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where on a.id = b.s_id group by e_id) as b on a.id = b.e_id -where count >= 9 -order by count desc; \ No newline at end of file +where count >= 12 +order by count desc; diff --git a/__pycache__/controller_db.cpython-38.pyc b/__pycache__/controller_db.cpython-38.pyc index 4125943..5bba38a 100644 Binary files a/__pycache__/controller_db.cpython-38.pyc and b/__pycache__/controller_db.cpython-38.pyc differ diff --git a/conf_db_prefix.yaml b/conf_db_prefix.yaml index 0e48fd8..42cedea 100644 --- a/conf_db_prefix.yaml +++ b/conf_db_prefix.yaml @@ -1 +1 @@ -db_name_prefix: without_exp +db_name_prefix: test diff --git a/controller_db.py b/controller_db.py index 93a7841..6acff43 100644 --- a/controller_db.py +++ b/controller_db.py @@ -74,7 +74,7 @@ class ControllerDB: result['dct_lst_init_remove_firm_prod'] = \ result['dct_lst_init_remove_firm_prod'].apply( lambda x: pickle.loads(x)) - list_dct = result.loc[result['count'] >= 9, + list_dct = result.loc[result['count'] >= 12, 'dct_lst_init_remove_firm_prod'].to_list() # list_dct = [{'140': ['1.4.5.1']}] # list_dct = [{'133': ['1.4.4.1']}] @@ -98,9 +98,9 @@ class ControllerDB: g_product_js = json.dumps(nx.adjacency_data(g_bom)) # insert exp - df_xv = pd.read_csv("xv_without_exp.csv", index_col=None) + df_xv = pd.read_csv("xv_with_exp.csv", index_col=None) # read the OA table - df_oa = pd.read_csv("oa_without_exp.csv", index_col=None) + df_oa = pd.read_csv("oa_with_exp.csv", index_col=None) df_oa = df_oa.iloc[:, 0:df_xv.shape[1]] for idx_scenario, row in df_oa.iterrows(): dct_exp_para = {} diff --git a/oa_L36.txt b/oa_L36.txt new file mode 100644 index 0000000..4be1253 --- /dev/null +++ b/oa_L36.txt @@ -0,0 +1,39 @@ +X X X X X X X X X X X X X X X X X X X X X X X +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 +------------------------------------------------------------------- +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 +1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 +1 1 1 1 1 2 2 2 2 2 2 1 1 1 1 2 2 2 2 3 3 3 3 +1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 1 1 1 1 +1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 1 1 1 1 2 2 2 2 +1 1 2 2 2 1 1 1 2 2 2 1 1 2 3 1 2 3 3 1 2 2 3 +1 1 2 2 2 1 1 1 2 2 2 2 2 3 1 2 3 1 1 2 3 3 1 +1 1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