Skip to content

Commit 1d1bca8

Browse files
committed
Merge branch 'master' of https://github.com/caddycarine/Axelrod
2 parents a36040e + 8b95280 commit 1d1bca8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+139
-147
lines changed

.github/workflows/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ jobs:
4949
run: |
5050
python -m pip install mypy
5151
python run_mypy.py
52+
- name: Check imports are sorted
53+
run: |
54+
python -m pip install isort
55+
python -m isort --check-only
5256
- name: Check that all strategies are indexed
5357
run: |
5458
python run_strategy_indexer.py

.isort.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[settings]
2+
default_section = THIRDPARTY
3+
multi_line_output = 3
4+
include_trailing_comma = True
5+
force_grid_wrap = 0
6+
combine_as_imports = True
7+
line_length = 88

.prepare-commit-msg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
# Any issue numbers created by this hook (or entered manually in the correct)
2222
# format will now be clickable links in the log view.
2323

24-
import sys
2524
import re
25+
import sys
2626
from subprocess import check_output
2727

2828
# By default, the hook will check to see if the branch name starts with

axelrod/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# isort:skip_file
12
DEFAULT_TURNS = 200
23

34
# The order of imports matters!

axelrod/classifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import warnings
23
from typing import (
34
Any,
45
Callable,
@@ -11,9 +12,8 @@
1112
TypeVar,
1213
Union,
1314
)
14-
import warnings
15-
import yaml
1615

16+
import yaml
1717
from axelrod.player import Player
1818

1919
ALL_CLASSIFIERS_PATH = "data/all_classifiers.yml"

axelrod/compute_finite_state_machine_memory.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from axelrod.action import Action
21
from collections import defaultdict, namedtuple
3-
from typing import DefaultDict, Iterator, Dict, Tuple, Set, List
2+
from typing import DefaultDict, Dict, Iterator, List, Set, Tuple
3+
4+
from axelrod.action import Action
45

56
C, D = Action.C, Action.D
67

@@ -263,4 +264,3 @@ def get_memory_from_transitions(
263264
if len(next_action_set) == 1:
264265
return 0
265266
return 1
266-

axelrod/deterministic_cache.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from typing import List, Tuple
1818

1919
from axelrod import Classifiers
20+
2021
from .action import Action
2122
from .player import Player
2223

axelrod/evolvable_player.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from pickle import dumps, loads
33
from random import randrange
44
from typing import Dict, List
5+
56
from .player import Player
67

78

axelrod/fingerprint.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
from tempfile import mkstemp
44
from typing import Any, List, Union
55

6+
import axelrod as axl
67
import dask.dataframe as dd
78
import matplotlib.pyplot as plt
89
import numpy as np
910
import tqdm
10-
from mpl_toolkits.axes_grid1 import make_axes_locatable
11-
12-
import axelrod as axl
1311
from axelrod import Player
1412
from axelrod.interaction_utils import (
1513
compute_final_score_per_turn,
1614
read_interactions_from_file,
1715
)
1816
from axelrod.strategy_transformers import DualTransformer, JossAnnTransformer
17+
from mpl_toolkits.axes_grid1 import make_axes_locatable
1918

2019
Point = namedtuple("Point", "x y")
2120

axelrod/match.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
from math import ceil, log
33

44
import axelrod.interaction_utils as iu
5-
from axelrod import DEFAULT_TURNS
5+
from axelrod import DEFAULT_TURNS, Classifiers
66
from axelrod.action import Action
7-
from axelrod import Classifiers
87
from axelrod.game import Game
8+
99
from .deterministic_cache import DeterministicCache
1010

1111
C, D = Action.C, Action.D

0 commit comments

Comments
 (0)