@@ -143,11 +143,11 @@ features = {
143
143
"csvs" : {"ext" :"csv" , "argstring" :"" , "filename" :"adjmat" }
144
144
}
145
145
146
- # Since we have a lot of different data setups and algs, we need to create a rule for
146
+ # Since we have a lot of different data setups and algs, we need to create a rule for
147
147
# each combination of them.
148
148
149
149
for bmark_setup in config ["benchmark_setup" ]:
150
-
150
+
151
151
graph_estimation = bmark_setup ["evaluation" ]["graph_estimation" ]
152
152
graph_types = graph_estimation ["convert_to" ] is not None and graph_estimation ["convert_to" ] or []
153
153
graph_types += ["original" ]
@@ -158,14 +158,14 @@ for bmark_setup in config["benchmark_setup"]:
158
158
for alg in active_algorithms (bmark_setup , eval_method = "graph_estimation" ):
159
159
data_index = 0
160
160
# We want one folder per data setup, so we create one rule for each of them.
161
-
161
+
162
162
for sim_setup in bmark_setup ["data" ]:
163
- for seed in get_seed_range (sim_setup ["seed_range" ]):
164
-
165
- adjmat_strings = gen_adjmat_string_from_conf (sim_setup ["graph_id" ], seed )
163
+ for seed in get_seed_range (sim_setup ["seed_range" ]):
164
+
165
+ adjmat_strings = gen_adjmat_string_from_conf (sim_setup ["graph_id" ], seed )
166
166
parameters_strings = gen_parameter_string_from_conf (sim_setup ["parameters_id" ], seed )
167
167
data_strings = gen_data_string_from_conf (sim_setup ["data_id" ], seed , seed_in_path = False )
168
-
168
+
169
169
170
170
if adjmat_strings is None :
171
171
adjmat_strings = [None ]
@@ -188,10 +188,9 @@ for bmark_setup in config["benchmark_setup"]:
188
188
for adjmat_string in adjmat_strings :
189
189
for parameters_string in parameters_strings :
190
190
for data_string in data_strings :
191
- #print(bmark_setup)
192
- rule :
193
- name :
194
- "results/output/" + bmark_setup_title + "/graph_estimation/dataset_" + str (data_index + 1 )+ "/" + alg + "/graph_type=" + graph_type + "/" + feature
191
+ rule :
192
+ name :
193
+ "results/output/" + bmark_setup_title + "/graph_estimation/dataset_" + str (sim_setup ["graph_id" ]) + "_" + str (sim_setup ["parameters_id" ]) + "_" + str (sim_setup ["data_id" ]) + "_" + str (seed )+ "/" + alg + "/graph_type=" + graph_type + "/" + feature
195
194
input :
196
195
conf = configfilename ,
197
196
graphs = eval_module_conf_to_feature_files_data (filename = feature_dict ["filename" ],
@@ -206,28 +205,31 @@ for bmark_setup in config["benchmark_setup"]:
206
205
data_string = data_string ,
207
206
alg = alg ,
208
207
bmark_setup = bmark_setup )
209
-
208
+
210
209
output :
211
- touch ("results/output/" + bmark_setup_title + "/graph_estimation/dataset_" + str (data_index + 1 ) + "/graph_type=" + graph_type + "/" + feature + "/" + alg + ".done" )
210
+ touch ("results/output/" + bmark_setup_title + "/graph_estimation/graph_id=" + str (sim_setup [ "graph_id" ]) + "_parameters_id=" + str ( sim_setup [ "parameters_id" ]) + "_data_id=" + str ( sim_setup [ "data_id" ]) + "_seed=" + str ( seed ) + "/graph_type=" + graph_type + "/" + feature + "/" + alg + ".done" )
212
211
213
212
params :
214
213
graph_type = graph_type ,
215
214
data_index = str (data_index + 1 ),
216
215
feature = feature ,
217
216
ext = feature_dict ["ext" ],
218
217
alg = alg ,
219
- bmark_setup = bmark_setup_title
218
+ bmark_setup = bmark_setup_title ,
219
+ output_dir = "results/output/" + bmark_setup_title + "/graph_estimation/graph_id=" + str (sim_setup ["graph_id" ]) + "_parameters_id=" + str (sim_setup ["parameters_id" ]) + "_data_id=" + str (sim_setup ["data_id" ]) + "_seed=" + str (seed ) + "/graph_type=" + graph_type + "/" + feature + "/" + alg
220
+
221
+ run :
220
222
221
- run :
222
- output_dir = "results/output/{params.bmark_setup}/graph_estimation/dataset_" + params ["data_index" ]+ "/graph_type=" + params ["graph_type" ]+ "/" + params ["feature" ]+ "/" + params ["alg" ]
223
223
# clean old file while keeping the directory
224
224
# check if the directory exists
225
- if Path (output_dir ).exists ():
225
+ if Path (params [ " output_dir" ] ).exists ():
226
226
# remove all files in the directory
227
- [f .unlink () for f in Path (output_dir ).glob ("*.png" ) ]
228
- for i , f in enumerate (input .graphs ):
229
- shell ("mkdir -p " + output_dir )
230
- shell ("cp " + f + " " + output_dir + "/" + params ["alg" ]+ "_" + params ["graph_type" ]+ "_" + str (i + 1 ) + "." + params ["ext" ])
227
+ [f .unlink () for f in Path (params ["output_dir" ]).glob ("*.png" ) ]
228
+
229
+ # This is to iterate over all the parameter settings.
230
+ for j , f in enumerate (input .graphs ):
231
+ shell ("mkdir -p " + params ["output_dir" ])
232
+ shell ("cp " + f + " " + params ["output_dir" ] + "/" + params ["alg" ]+ "_" + params ["graph_type" ]+ "_" + str (j + 1 ) + "." + params ["ext" ])
231
233
232
234
data_index += 1
233
235
0 commit comments