Skip to content

Commit c2dba09

Browse files
authored
Merge pull request #852 from Axelrod-Python/845
Remove dynamic classes and tidy imports
2 parents ba23d34 + 8d6733f commit c2dba09

Some content is hidden

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

61 files changed

+207
-233
lines changed

axelrod/__init__.py

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

55
# The order of imports matters!
66
from .version import __version__
7-
from .load_data_ import load_lookerup_tables, load_pso_tables, load_weights
7+
from .load_data_ import load_pso_tables, load_weights
88
from . import graph
99
from .actions import Actions, flip_action
1010
from .random_ import random_choice, seed

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/data/lookup_tables.csv

Lines changed: 0 additions & 19 deletions
This file was deleted.

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/load_data_.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ def load_weights(filename="ann_weights.csv", directory="data"):
2929
return d
3030

3131

32-
def load_lookerup_tables(filename="lookup_tables.csv", directory="data"):
33-
"""Load lookup tables."""
34-
rows = load_file(filename, directory)
35-
d = dict()
36-
for row in rows:
37-
name, a, b, c, initial, pattern = row
38-
d[(name, int(a), int(b), int(c))] = (initial, pattern)
39-
return d
40-
41-
4232
def load_pso_tables(filename="pso_gambler.csv", directory="data"):
4333
"""Load lookup tables."""
4434
rows = load_file(filename, directory)

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/result_set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from numpy import mean, nanmedian, std
55
import tqdm
66

7-
from axelrod import Actions
7+
from axelrod.actions import Actions
88
import axelrod.interaction_utils as iu
99
from . import eigen
1010
from .game import Game

0 commit comments

Comments
 (0)