Skip to content

Commit 38989f5

Browse files
committed
Correct imports for type checking.
1 parent 6f0ee3a commit 38989f5

Some content is hidden

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

46 files changed

+99
-49
lines changed

axelrod/_strategy_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import itertools
33
from functools import lru_cache
44

5-
from axelrod import update_history
6-
from axelrod import Actions
5+
from axelrod.player import update_history
6+
from axelrod.actions import Actions
77

88
from axelrod.strategies.cycler import Cycler
99

axelrod/interaction_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from collections import Counter
1111
import csv
1212

13-
from axelrod import Actions
13+
from axelrod.actions import Actions
1414
from .game import Game
1515

1616
import tqdm

axelrod/match.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Game
1+
from axelrod.actions import Actions
2+
from axelrod.game import Game
23
import axelrod.interaction_utils as iu
34
from .deterministic_cache import DeterministicCache
45

axelrod/mock_player.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import warnings
2-
from axelrod import Actions, Player, update_history, update_state_distribution
3-
from axelrod.actions import Action
2+
from axelrod.actions import Actions, Action
3+
from axelrod.player import Player, update_history, update_state_distribution
44
from collections import defaultdict
55

66
from typing import List, Tuple

axelrod/player.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import random
44
import copy
55

6-
from axelrod import Actions, flip_action
6+
from axelrod.actions import Actions, flip_action
77
from .game import DefaultGame
88

99

axelrod/random_.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import random
22
import numpy
3-
from axelrod import Actions
4-
from axelrod.actions import Action
3+
from axelrod.actions import Action, Actions
54

65

76
def random_choice(p: float = 0.5) -> Action:

axelrod/strategies/ann.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from axelrod.actions import Actions
1010
from axelrod.player import Player
11-
from axelrod import load_weights
11+
from axelrod.load_data_ import load_weights
1212

1313
C, D = Actions.C, Actions.D
1414
nn_weights = load_weights()

axelrod/strategies/backstabber.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23
from axelrod.strategy_transformers import FinalTransformer
34

45
C, D = Actions.C, Actions.D

axelrod/strategies/better_and_better.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from axelrod import Actions, Player, random_choice
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
3+
from axelrod.random_ import random_choice
24
from axelrod.actions import Action
35

46
C, D = Actions.C, Actions.D

axelrod/strategies/calculator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23
from .axelrod_first import Joss
34
from axelrod._strategy_utils import detect_cycle
45

axelrod/strategies/cooperator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23

34
C, D = Actions.C, Actions.D
45

axelrod/strategies/cycler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player, init_args
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player, init_args
23

34
import copy
45

axelrod/strategies/darwin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import inspect
2-
from axelrod import Actions, Player
2+
from axelrod.actions import Actions
3+
from axelrod.player import Player
34

45
C, D = Actions.C, Actions.D
56

axelrod/strategies/defector.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23

34
C, D = Actions.C, Actions.D
45

axelrod/strategies/doubler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23

34
C, D = Actions.C, Actions.D
45

axelrod/strategies/finite_state_machines.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23

34
C, D = Actions.C, Actions.D
45

axelrod/strategies/forgiver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23
from axelrod.actions import Action
34

45
C, D = Actions.C, Actions.D

axelrod/strategies/gambler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
https://gist.github.com/GDKO/60c3d0fd423598f3c4e4
66
"""
77

8-
from axelrod import Actions, load_pso_tables, random_choice
8+
from axelrod.actions import Actions
9+
from axelrod.load_data_ import load_pso_tables
10+
from axelrod.random_ import random_choice
911
from .lookerup import LookerUp, create_lookup_table_from_pattern
1012

1113

axelrod/strategies/geller.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import inspect
22

3-
from axelrod import Actions, Player, random_choice
3+
from axelrod.actions import Actions
4+
from axelrod.player import Player
5+
from axelrod.random_ import random_choice
46

57
C, D = Actions.C, Actions.D
68

axelrod/strategies/gobymajority.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23

34
import copy
45

axelrod/strategies/gradualkiller.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23
from axelrod.strategy_transformers import InitialTransformer
34

45
C, D = Actions.C, Actions.D

axelrod/strategies/grudger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23

34
C, D = Actions.C, Actions.D
45

axelrod/strategies/grumpy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23

34
C, D = Actions.C, Actions.D
45

axelrod/strategies/handshake.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23

34
C, D = Actions.C, Actions.D
45

axelrod/strategies/hmm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from numpy.random import choice
22

3-
from axelrod import Actions, Player, random_choice
3+
from axelrod.actions import Actions
4+
from axelrod.player import Player
5+
from axelrod.random_ import random_choice
46

57
C, D = Actions.C, Actions.D
68

axelrod/strategies/human.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from os import linesep
2-
from axelrod import Actions, Player
2+
from axelrod.actions import Actions
3+
from axelrod.player import Player
34
from prompt_toolkit import prompt
45
from prompt_toolkit.token import Token
56
from prompt_toolkit.styles import style_from_dict

axelrod/strategies/hunter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23
from axelrod._strategy_utils import detect_cycle
34

45
C, D = Actions.C, Actions.D

axelrod/strategies/inverse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from axelrod import Actions, Player, random_choice
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
3+
from axelrod.random_ import random_choice
24

35
C, D = Actions.C, Actions.D
46

axelrod/strategies/lookerup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from itertools import product
33
import sys
44

5-
from axelrod import Actions, Player, init_args, load_lookerup_tables
5+
from axelrod.actions import Actions
6+
from axelrod.player import Player, init_args
7+
from axelrod.load_data_ import load_lookerup_tables
68

79
module = sys.modules[__name__]
810
C, D = Actions.C, Actions.D

axelrod/strategies/mathematicalconstants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import math
2-
from axelrod import Actions, Player
2+
from axelrod.actions import Actions
3+
from axelrod.player import Player
34

45

56
class CotoDeRatio(Player):

axelrod/strategies/memoryone.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from axelrod import Actions, Player, random_choice
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
3+
from axelrod.random_ import random_choice
24

35

46
C, D = Actions.C, Actions.D

axelrod/strategies/memorytwo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23
from .titfortat import TitForTat, TitFor2Tats
34
from .defector import Defector
45

axelrod/strategies/meta.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player, obey_axelrod
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player, obey_axelrod
23
from axelrod.strategy_transformers import NiceTransformer
34
from ._strategies import all_strategies
45
from .hunter import (

axelrod/strategies/mindcontrol.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23

34
C, D = Actions.C, Actions.D
45

axelrod/strategies/mindreader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import inspect
22

3-
from axelrod import Actions, Player
3+
from axelrod.actions import Actions
4+
from axelrod.player import Player
45
from axelrod._strategy_utils import look_ahead
56

67

axelrod/strategies/mutual.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23
from axelrod.random_ import random_choice
34

45
C, D = Actions.C, Actions.D

axelrod/strategies/negation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from axelrod import Actions, Player, random_choice, flip_action
1+
from axelrod.actions import Actions, flip_action
2+
from axelrod.player import Player
3+
from axelrod.random_ import random_choice
24

35
C, D = Actions.C, Actions.D
46

axelrod/strategies/oncebitten.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import random
2-
from axelrod import Actions, Player
2+
from axelrod.actions import Actions
3+
from axelrod.player import Player
34

45
C, D = Actions.C, Actions.D
56

axelrod/strategies/prober.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from axelrod import Actions, Player, random_choice
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
3+
from axelrod.random_ import random_choice
24

35
import random
46

axelrod/strategies/punisher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23

34
C, D = Actions.C, Actions.D
45

axelrod/strategies/qlearner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from collections import OrderedDict
22
import random
33

4-
from axelrod import Actions, Player, random_choice
4+
from axelrod.actions import Actions
5+
from axelrod.player import Player
6+
from axelrod.random_ import random_choice
57

68
C, D = Actions.C, Actions.D
79

axelrod/strategies/rand.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Player, random_choice
1+
from axelrod.player import Player
2+
from axelrod.random_ import random_choice
23

34

45
class Random(Player):

axelrod/strategies/retaliate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from collections import defaultdict
22

3-
from axelrod import Actions, Player
3+
from axelrod.actions import Actions
4+
from axelrod.player import Player
45

56
C, D = Actions.C, Actions.D
67

axelrod/strategies/sequence_player.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23
from axelrod._strategy_utils import thue_morse_generator
34

45
C, D = Actions.C, Actions.D

axelrod/strategies/titfortat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from axelrod import Actions, Player
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
23
from axelrod.strategy_transformers import TrackHistoryTransformer
34

45
C, D = Actions.C, Actions.D

axelrod/strategies/worse_and_worse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from axelrod import Actions, Player, random_choice
1+
from axelrod.actions import Actions
2+
from axelrod.player import Player
3+
from axelrod.random_ import random_choice
24

35
C, D = Actions.C, Actions.D
46

0 commit comments

Comments
 (0)