Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows multiprocessing (and added tempfile bonus) #1117

Merged
merged 11 commits into from
Aug 17, 2017
12 changes: 7 additions & 5 deletions axelrod/result_set.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import namedtuple, Counter
import csv
import sys

from numpy import mean, nanmedian, std
import tqdm
Expand Down Expand Up @@ -38,8 +39,8 @@ def __init__(self, players, interactions, repetitions=False,
----------
players : list
a list of player objects.
interactions : list
a list of dictionaries mapping tuples of player indices to
interactions : dict
a dictionary mapping tuples of player indices to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct that this is just a doc change? You haven't modified this behaviour (it was essentially incorrect).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. that is correct. mypy was complaining.

interactions (1 for each repetition)
repetitions : int
The number of repetitions
Expand Down Expand Up @@ -76,7 +77,7 @@ def create_progress_bar(self, desc=None):
desc : string
A description.
"""
return tqdm.tqdm(total=self.num_matches, desc=desc)
return tqdm.tqdm(total=self.num_matches, desc=desc, file=sys.stderr)

def _update_players(self, index_pair, players):
"""
Expand Down Expand Up @@ -743,7 +744,7 @@ def _build_score_related_metrics(self, progress_bar=False,

if progress_bar:
self.progress_bar = tqdm.tqdm(total=13 + 2 * self.nplayers,
desc="Finishing")
file=sys.stderr, desc="Finishing")
self._summarise_normalised_scores()
self._summarise_normalised_cooperation()

Expand Down Expand Up @@ -1014,7 +1015,8 @@ def create_progress_bar(self, desc=None):
if not self.num_interactions:
with open(self.filename) as f:
self.num_interactions = sum(1 for line in f)
return tqdm.tqdm(total=self.num_interactions, desc=desc)
return tqdm.tqdm(total=self.num_interactions, desc=desc,
file=sys.stderr)

def _read_players_and_repetition_numbers(self, progress_bar=False):
"""
Expand Down
2 changes: 0 additions & 2 deletions axelrod/tests/unit/test_fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ def test_serial_fingerprint(self):
self.assertEqual(edge_keys, self.expected_edges)
self.assertEqual(coord_keys, self.expected_points)

@unittest.skipIf(axl.on_windows,
"Parallel processing not supported on Windows")
def test_parallel_fingerprint(self):
af = AshlockFingerprint(self.strategy, self.probe)
af.fingerprint(turns=10, repetitions=2, step=0.5, processes=2,
Expand Down
Loading