|
4 | 4 | from collections import defaultdict
|
5 | 5 | import logging
|
6 | 6 | from multiprocessing import Process, Queue, cpu_count
|
7 |
| -from tempfile import NamedTemporaryFile |
8 | 7 | import warnings
|
9 | 8 |
|
10 | 9 | import tqdm
|
@@ -61,18 +60,6 @@ def __init__(self, players, match_generator=RoundRobinMatches,
|
61 | 60 | self.writer = None
|
62 | 61 | self.filename = None
|
63 | 62 |
|
64 |
| - def setup_output_file(self, filename=None): |
65 |
| - """Open a CSV writer for tournament output.""" |
66 |
| - if filename: |
67 |
| - self.outputfile = open(filename, 'a') |
68 |
| - else: |
69 |
| - # Setup a temporary file |
70 |
| - self.outputfile = NamedTemporaryFile(mode='w') |
71 |
| - filename = self.outputfile.name |
72 |
| - self.writer = csv.writer(self.outputfile, lineterminator='\n') |
73 |
| - # Save filename for loading ResultSet later |
74 |
| - self.filename = filename |
75 |
| - |
76 | 63 | def play(self, build_results=True, filename=None,
|
77 | 64 | processes=None, progress_bar=True):
|
78 | 65 | """
|
@@ -104,7 +91,7 @@ def play(self, build_results=True, filename=None,
|
104 | 91 | else:
|
105 | 92 | self.interactions_dict = {}
|
106 | 93 |
|
107 |
| - if not build_results and not filename: |
| 94 | + if (not build_results) and (filename is not None): |
108 | 95 | warnings.warn("Tournament results will not be accessible since build_results=False and no filename was supplied.")
|
109 | 96 |
|
110 | 97 | if processes is None:
|
|
0 commit comments