Skip to content

Commit 96fc4c7

Browse files
meatballsmarcharper
authored andcommitted
Sort imports using isort
1 parent ede888c commit 96fc4c7

File tree

131 files changed

+334
-458
lines changed

Some content is hidden

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

131 files changed

+334
-458
lines changed

axelrod/_strategy_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
"""Utilities used by various strategies."""
22

33
import itertools
4-
54
from functools import lru_cache
65

7-
from axelrod.player import update_history
86
from axelrod.action import Action
7+
from axelrod.player import update_history
98
from axelrod.strategies.cooperator import Cooperator
109
from axelrod.strategies.defector import Defector
1110

12-
1311
C, D = Action.C, Action.D
1412

1513

axelrod/deterministic_cache.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
...
1313
"""
1414

15-
from collections import UserDict
1615
import pickle
16+
from collections import UserDict
17+
from typing import List, Tuple
1718

1819
from .action import Action
1920
from .player import Player
2021

21-
from typing import List, Tuple
22-
2322
CachePlayerKey = Tuple[Player, Player, int]
2423
CacheKey = Tuple[str, str, int]
2524

axelrod/ecosystem.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"""
1313

1414
import random
15-
16-
from typing import List, Callable
15+
from typing import Callable, List
1716

1817
from axelrod.result_set import ResultSet
1918

axelrod/eigen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
eigenvectors.
66
"""
77

8-
import numpy
98
from typing import Tuple
109

10+
import numpy
11+
1112

1213
def _normalise(nvec: numpy.ndarray) -> numpy.ndarray:
1314
"""Normalises the given numpy array."""

axelrod/fingerprint.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,20 @@
22
import os
33
from collections import namedtuple
44
from tempfile import mkstemp
5+
from typing import Any, List, Union
56

7+
import axelrod as axl
68
import matplotlib.pyplot as plt
79
import numpy as np
810
import tqdm
9-
import dask.dataframe as dd
10-
import dask as da
11-
from mpl_toolkits.axes_grid1 import make_axes_locatable
12-
13-
import axelrod as axl
1411
from axelrod import Player
15-
from axelrod.strategy_transformers import JossAnnTransformer, DualTransformer
16-
from axelrod.interaction_utils import (
17-
compute_final_score_per_turn,
18-
read_interactions_from_file,
19-
)
12+
from axelrod.interaction_utils import (compute_final_score_per_turn,
13+
read_interactions_from_file)
14+
from axelrod.strategy_transformers import DualTransformer, JossAnnTransformer
15+
from mpl_toolkits.axes_grid1 import make_axes_locatable
2016

21-
from typing import List, Any, Union
17+
import dask as da
18+
import dask.dataframe as dd
2219

2320
Point = namedtuple("Point", "x y")
2421

axelrod/game.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from .action import Action
21
from typing import Tuple, Union
32

3+
from .action import Action
4+
45
C, D = Action.C, Action.D
56

67
Score = Union[int, float]

axelrod/interaction_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
This is used by both the Match class and the ResultSet class which analyse
88
interactions.
99
"""
10-
from collections import Counter, defaultdict
1110
import csv
12-
import tqdm
13-
import pandas as pd
11+
from collections import Counter, defaultdict
1412

13+
import pandas as pd
14+
import tqdm
1515
from axelrod.action import Action, str_to_actions
16-
from .game import Game
1716

17+
from .game import Game
1818

1919
C, D = Action.C, Action.D
2020

axelrod/load_data_.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from typing import Dict, List, Tuple
2+
13
import pkg_resources
2-
from typing import List, Dict, Tuple
34

45

56
def load_file(filename: str, directory: str) -> List[List[str]]:

axelrod/match.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from math import ceil, log
21
import random
2+
from math import ceil, log
33

4+
import axelrod.interaction_utils as iu
5+
from axelrod import DEFAULT_TURNS
46
from axelrod.action import Action
57
from axelrod.game import Game
6-
from axelrod import DEFAULT_TURNS
7-
import axelrod.interaction_utils as iu
8-
from .deterministic_cache import DeterministicCache
98

9+
from .deterministic_cache import DeterministicCache
1010

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

axelrod/mock_player.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from itertools import cycle
2+
from typing import List
23

34
from axelrod.action import Action
45
from axelrod.player import Player
56

6-
from typing import List
7-
87
C, D = Action.C, Action.D
98

109

0 commit comments

Comments
 (0)