Skip to content

Commit

Permalink
Rollback to one folder organization
Browse files Browse the repository at this point in the history
  • Loading branch information
MircoT committed Mar 10, 2016
1 parent 6ae945b commit 8ea6301
Show file tree
Hide file tree
Showing 46 changed files with 37 additions and 126 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
@@ -1,3 +1,3 @@
[submodule "aimaPy/aima-data"]
path = aimaPy/aima-data
url = https://github.com/aimacode/aima-data
[submodule "aima-data"]
path = aima-data
url = https://github.com/aimacode/aima-data.git
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -10,7 +10,6 @@ before_install:
install:
- pip install flake8
- pip install -r requirements.txt
- python setup.py install

script:
- py.test
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

File renamed without changes.
5 changes: 1 addition & 4 deletions aimaPy/agents.py → agents.py
Expand Up @@ -35,10 +35,7 @@
#
# Speed control in GUI does not have any effect -- fix it.

if __name__ == "aimaPy.agents":
from . utils import *
else:
from utils import *
from utils import *

import random
import copy
Expand Down
15 changes: 0 additions & 15 deletions aimaPy/__init__.py

This file was deleted.

17 changes: 0 additions & 17 deletions aimaPy/planning.py

This file was deleted.

File renamed without changes.
9 changes: 2 additions & 7 deletions aimaPy/csp.py → csp.py
@@ -1,12 +1,7 @@
"""CSP (Constraint Satisfaction Problems) problems and solvers. (Chapter 6)."""


if __name__ == "aimaPy.csp":
from . utils import *
from . import search
else:
from utils import *
import search
from utils import *
import search

from collections import defaultdict
from functools import reduce
Expand Down
File renamed without changes.
6 changes: 1 addition & 5 deletions aimaPy/games.py → games.py
@@ -1,11 +1,7 @@
"""Games, or Adversarial Search. (Chapter 5)
"""


if __name__ == "aimaPy.games":
from . utils import *
else:
from utils import *
from utils import *

import random

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
5 changes: 1 addition & 4 deletions aimaPy/learning.py → learning.py
@@ -1,9 +1,6 @@
"""Learn to estimate functions from examples. (Chapters 18-20)"""

if __name__ == "aimaPy.learning":
from . utils import *
else:
from utils import *
from utils import *

import copy
import heapq
Expand Down
File renamed without changes.
8 changes: 2 additions & 6 deletions aimaPy/logic.py → logic.py
Expand Up @@ -24,12 +24,8 @@
diff, simp Symbolic differentiation and simplification
"""

if __name__ == "aimaPy.logic":
from . utils import *
from . import agents
else:
from utils import *
import agents
from utils import *
import agents

import itertools
import re
Expand Down
File renamed without changes.
6 changes: 1 addition & 5 deletions aimaPy/mdp.py → mdp.py
Expand Up @@ -6,11 +6,7 @@
dictionary of {state:number} pairs. We then define the value_iteration
and policy_iteration algorithms."""


if __name__ == "aimaPy.mdp":
from . utils import *
else:
from utils import *
from utils import *


class MDP:
Expand Down
File renamed without changes.
5 changes: 1 addition & 4 deletions aimaPy/nlp.py → nlp.py
Expand Up @@ -3,10 +3,7 @@
# (Written for the second edition of AIMA; expect some discrepanciecs
# from the third edition until this gets reviewed.)

if __name__ == "aimaPy.nlp":
from . utils import *
else:
from utils import *
from utils import *

from collections import defaultdict

Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions planning.py
@@ -0,0 +1,12 @@
"""Planning (Chapters 10-11)
"""

from utils import *
import agents

import math
import random
import sys
import time
import bisect
import string
File renamed without changes.
8 changes: 2 additions & 6 deletions aimaPy/probability.py → probability.py
@@ -1,12 +1,8 @@
"""Probability models. (Chapter 13-15)
"""

if __name__ == "aimaPy.probability":
from . utils import *
from . logic import extend
else:
from utils import *
from logic import extend
from utils import *
from logic import extend

import random
from collections import defaultdict
Expand Down
File renamed without changes.
8 changes: 2 additions & 6 deletions aimaPy/rl.py → rl.py
@@ -1,12 +1,8 @@
"""Reinforcement Learning (Chapter 21)
"""

if __name__ == "aimaPy.rl":
from . utils import *
from . import agents
else:
from utils import *
import agents
from utils import *
import agents


class PassiveADPAgent(agents.Agent):
Expand Down
File renamed without changes.
5 changes: 1 addition & 4 deletions aimaPy/search.py → search.py
Expand Up @@ -4,10 +4,7 @@
then create problem instances and solve them with calls to the various search
functions."""

if __name__ == "aimaPy.search":
from . utils import *
else:
from utils import *
from utils import *

import math
import random
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

18 changes: 0 additions & 18 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_grid.py
@@ -1,5 +1,5 @@
import pytest
from aimaPy.grid import *
from grid import *

compare_list = lambda x, y: all([elm_x == y[i] for i, elm_x in enumerate(x)])

Expand Down
2 changes: 1 addition & 1 deletion tests/probability_test.py → tests/test_probability.py
@@ -1,5 +1,5 @@
import pytest
from aimaPy.probability import *
from probability import *


def tests():
Expand Down
2 changes: 1 addition & 1 deletion tests/text_test.py → tests/test_text.py
@@ -1,6 +1,6 @@
import pytest

from aimaPy.text import *
from text import *

from random import choice
from math import isclose
Expand Down
2 changes: 1 addition & 1 deletion tests/utils_test.py → tests/test_utils.py
@@ -1,5 +1,5 @@
import pytest
from aimaPy.utils import *
from utils import *


def test_struct_initialization():
Expand Down
File renamed without changes.
11 changes: 3 additions & 8 deletions aimaPy/text.py → text.py
Expand Up @@ -4,14 +4,9 @@
Then we show a very simple Information Retrieval system, and an example
working on a tiny sample of Unix manual pages."""

if __name__ == "aimaPy.text":
from . utils import *
from . learning import CountingProbDist
from . import search
else:
from utils import *
from learning import CountingProbDist
import search
from utils import *
from learning import CountingProbDist
import search

from math import log, exp
from collections import defaultdict
Expand Down
5 changes: 1 addition & 4 deletions aimaPy/utils.py → utils.py
Expand Up @@ -6,10 +6,7 @@
TODO: Priority queues may not belong here -- see treatment in search.py
"""

if __name__ == "aimaPy.utils":
from . grid import *
else:
from grid import *
from grid import *

import operator
import math
Expand Down

0 comments on commit 8ea6301

Please sign in to comment.