Skip to content

Commit 9b6ff87

Browse files
committed
Use spawn instead of fork for new process
1 parent dfb5cc0 commit 9b6ff87

File tree

8 files changed

+27
-16
lines changed

8 files changed

+27
-16
lines changed

axelrod/data/all_classifiers.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
$\phi$:
1+
$\\phi$:
22
inspects_source: false
33
long_run_time: false
44
makes_use_of: !!set {}
55
manipulates_source: false
66
manipulates_state: false
77
memory_depth: .inf
88
stochastic: false
9-
$\pi$:
9+
$\\pi$:
1010
inspects_source: false
1111
long_run_time: false
1212
makes_use_of: !!set {}
@@ -439,6 +439,14 @@ Evolved ANN 5 Noise 05:
439439
manipulates_state: false
440440
memory_depth: .inf
441441
stochastic: false
442+
EvolvedAttention:
443+
inspects_source: false
444+
long_run_time: false
445+
makes_use_of: !!set {}
446+
manipulates_source: false
447+
manipulates_state: false
448+
memory_depth: 200
449+
stochastic: false
442450
Evolved FSM 16:
443451
inspects_source: false
444452
long_run_time: false

axelrod/strategies/axelrod_second.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,16 +441,16 @@ class SecondByGrofman(Player):
441441
1. First it cooperates on the first two rounds
442442
2. For rounds 3-7 inclusive, it plays the same as the opponent's last move
443443
3. Thereafter, it applies the following logic, looking at its memory of the
444-
last 8\* rounds (ignoring the most recent round).
444+
last 8\\* rounds (ignoring the most recent round).
445445
446446
- If its own previous move was C and the opponent has defected less than
447-
3 times in the last 8\* rounds, cooperate
447+
3 times in the last 8\\* rounds, cooperate
448448
- If its own previous move was C and the opponent has defected 3 or
449-
more times in the last 8\* rounds, defect
449+
more times in the last 8\\* rounds, defect
450450
- If its own previous move was D and the opponent has defected only once
451-
or not at all in the last 8\* rounds, cooperate
451+
or not at all in the last 8\\* rounds, cooperate
452452
- If its own previous move was D and the opponent has defected more than
453-
once in the last 8\* rounds, defect
453+
once in the last 8\\* rounds, defect
454454
455455
The code looks at the first 7 of the last 8 rounds, ignoring the most
456456
recent round.

axelrod/strategies/mathematicalconstants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Golden(CotoDeRatio):
4949
- Golden: Original Name by Timothy Standen
5050
"""
5151

52-
name = "$\phi$"
52+
name = "$\\phi$"
5353
ratio = (1 + math.sqrt(5)) / 2
5454

5555

@@ -62,7 +62,7 @@ class Pi(CotoDeRatio):
6262
- Pi: Original Name by Timothy Standen
6363
"""
6464

65-
name = "$\pi$"
65+
name = "$\\pi$"
6666
ratio = math.pi
6767

6868

axelrod/strategies/zero_determinant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class LRPlayer(MemoryOnePlayer):
1212
1313
The parameter :math:`s` is called the slope and the parameter :math:`l` the
1414
baseline payoff. For extortionate strategies, the extortion factor
15-
:math:`\chi` is the inverse of the slope :math:`s`.
15+
:math:`\\chi` is the inverse of the slope :math:`s`.
1616
1717
For the standard prisoner's dilemma where :math:`T > R > P > S` and
1818
:math:`R > (T + S) / 2 > P`, a pair :math:`(l, s)` is enforceable iff

axelrod/tests/strategies/test_mathematicalconstants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class TestGolden(TestPlayer):
1111

12-
name = "$\phi$"
12+
name = "$\\phi$"
1313
player = axl.Golden
1414
expected_classifier = {
1515
"memory_depth": float("inf"), # Long memory
@@ -34,7 +34,7 @@ def test_strategy(self):
3434

3535
class TestPi(TestPlayer):
3636

37-
name = "$\pi$"
37+
name = "$\\pi$"
3838
player = axl.Pi
3939
expected_classifier = {
4040
"memory_depth": float("inf"), # Long memory

axelrod/tournament.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
import os
44
import warnings
55
from collections import defaultdict
6-
from multiprocessing import Process, Queue, cpu_count
6+
from multiprocessing import Process, Queue, cpu_count, set_start_method
7+
8+
set_start_method("spawn", force=True)
79
from tempfile import mkstemp
810
from typing import List, Optional, Tuple
911

docs/how-to/contributing/strategy/writing_the_new_strategy.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ strategy::
8383
name = 'Tit For Tat'
8484

8585
Note that this is mainly used in plots by :code:`matplotlib` so you can use
86-
LaTeX if you want to. For example there is strategy with :math:`\pi` as a
86+
LaTeX if you want to. For example there is strategy with :math:`\\pi` as a
8787
name::
8888

89-
name = '$\pi$'
89+
name = '$\\pi$'
9090

9191
Following that you can add in the :code:`classifier` dictionary::
9292

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ deps =
3333
mypy
3434
types-setuptools
3535
commands =
36-
python -m pytest -vvvvv --cov-report term-missing --cov=axelrod --cov-fail-under=100 . --doctest-glob="*.md" --doctest-glob="*.rst"
36+
python -m pytest --cov-report term-missing --cov=axelrod --cov-fail-under=100 . -n auto --doctest-glob="*.md" --doctest-glob="*.rst"
3737
python -m black -l 80 . --check
3838
python -m isort --check-only axelrod/.
3939
python run_mypy.py
4040
python run_strategy_indexer.py
41+

0 commit comments

Comments
 (0)