@@ -352,8 +352,8 @@ with temp_dir() as td: # create temporary directory `td`
352
352
make_random_sampling], # provide RS run creator
353
353
n_runs = 5 ) # we will execute 5 runs per setup
354
354
355
- from_logs( # parse all log files and print end results
356
- td, lambda er : print (f " { er.algorithm} on { er.instance} : { er.best_f} " ) )
355
+ for er in from_logs(td): # parse all log files and print end results
356
+ print (f " { er.algorithm} on { er.instance} : { er.best_f} " )
357
357
# The temp directory is deleted as soon as we leave the `with` block.
358
358
```
359
359
@@ -682,8 +682,8 @@ with temp_dir() as td: # create temporary directory `td`
682
682
instances = problems, # define the problem instances
683
683
setups = [make_execution], # creator for our algorithm
684
684
n_runs = 5 ) # we will execute 5 runs per setup
685
- from_logs( # parse all log files and print end results
686
- td, lambda er : print (f " { er.algorithm} on { er.instance} : { er.best_f} " ) )
685
+ for er in from_logs(td): # parse all log files and print end results
686
+ print (f " { er.algorithm} on { er.instance} : { er.best_f} " )
687
687
# The temp directory is deleted as soon as we leave the `with` block.
688
688
```
689
689
@@ -1564,12 +1564,9 @@ with temp_dir() as td:
1564
1564
max_fes = 10000 , # we grant 10000 FEs per run
1565
1565
n_runs = 4 ) # perform 4 runs per algorithm * instance combination
1566
1566
1567
- end_results = [] # this list will receive the end results records
1568
- from_logs(td, end_results.append) # get results from log files
1569
-
1567
+ data = list (from_logs(td)) # load end results
1570
1568
er_csv = to_csv( # store end results to csv file (returns path)
1571
- end_results, # the list of end results to store
1572
- td.resolve_inside(" end_results.txt" )) # path to the file to generate
1569
+ data, td.resolve_inside(" end_results.txt" )) # path to output file
1573
1570
print (er_csv.read_all_str()) # read generated file as string and print it
1574
1571
# When leaving "while", the temp directory will be deleted
1575
1572
```
@@ -1700,8 +1697,7 @@ with temp_dir() as td:
1700
1697
max_fes = 10000 , # we grant 10000 FEs per run
1701
1698
n_runs = 4 ) # perform 4 runs per algorithm * instance combination
1702
1699
1703
- end_results = [] # this list will receive the end results records
1704
- from_logs(td, end_results.append) # get results from log files
1700
+ end_results = list (from_logs(td)) # get results from log files
1705
1701
1706
1702
end_stats = [] # the list to receive the statistics records
1707
1703
# compute end result statistics for all algorithm+instance combinations
0 commit comments