Skip to content

Commit 096ac6b

Browse files
authored
Merge pull request #1 from aimacode/master
update with latest code
2 parents dc4e2fc + 3e790e9 commit 096ac6b

Some content is hidden

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

82 files changed

+20186
-2319
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,7 @@ target/
7171
# dotenv
7272
.env
7373
.idea
74+
75+
# for macOS
76+
.DS_Store
77+
._.DS_Store

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ install:
1212
- pip install flake8
1313
- pip install ipython
1414
- pip install matplotlib
15+
- pip install networkx
16+
- pip install ipywidgets
17+
- pip install Pillow
1518

1619
script:
1720
- py.test

CONTRIBUTING.md

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
How to Contribute to aima-python
22
==========================
33

4-
Thanks for considering contributing to `aima-python`! Whether you are an aspiring [Google Summer of Code](https://summerofcode.withgoogle.com/organizations/5663121491361792/) student, or an independent contributor, here is a guide on how you can help.
4+
Thanks for considering contributing to `aima-python`! Whether you are an aspiring [Google Summer of Code](https://summerofcode.withgoogle.com/organizations/5674023002832896/) student, or an independent contributor, here is a guide on how you can help.
55

6-
First of all, you can read these write-ups from past GSoC students to get an idea on what you can do for the project. [Chipe1](https://github.com/aimacode/aima-python/issues/641) - [MrDupin](https://github.com/aimacode/aima-python/issues/632)
6+
First of all, you can read these write-ups from past GSoC students to get an idea about what you can do for the project. [Chipe1](https://github.com/aimacode/aima-python/issues/641) - [MrDupin](https://github.com/aimacode/aima-python/issues/632)
77

88
In general, the main ways you can contribute to the repository are the following:
99

1010
1. Implement algorithms from the [list of algorithms](https://github.com/aimacode/aima-python/blob/master/README.md#index-of-algorithms).
11-
1. Add tests for algorithms that are missing them (you can also add more tests to algorithms that already have some).
11+
1. Add tests for algorithms.
1212
1. Take care of [issues](https://github.com/aimacode/aima-python/issues).
1313
1. Write on the notebooks (`.ipynb` files).
1414
1. Add and edit documentation (the docstrings in `.py` files).
@@ -21,20 +21,16 @@ In more detail:
2121
- Look at the [issues](https://github.com/aimacode/aima-python/issues) and pick one to work on.
2222
- One of the issues is that some algorithms are missing from the [list of algorithms](https://github.com/aimacode/aima-python/blob/master/README.md#index-of-algorithms) and that some don't have tests.
2323

24-
## Port to Python 3; Pythonic Idioms; py.test
24+
## Port to Python 3; Pythonic Idioms
2525

26-
- Check for common problems in [porting to Python 3](http://python3porting.com/problems.html), such as: `print` is now a function; `range` and `map` and other functions no longer produce `list`s; objects of different types can no longer be compared with `<`; strings are now Unicode; it would be nice to move `%` string formating to `.format`; there is a new `next` function for generators; integer division now returns a float; we can now use set literals.
26+
- Check for common problems in [porting to Python 3](http://python3porting.com/problems.html), such as: `print` is now a function; `range` and `map` and other functions no longer produce `list`s; objects of different types can no longer be compared with `<`; strings are now Unicode; it would be nice to move `%` string formatting to `.format`; there is a new `next` function for generators; integer division now returns a float; we can now use set literals.
2727
- Replace old Lisp-based idioms with proper Python idioms. For example, we have many functions that were taken directly from Common Lisp, such as the `every` function: `every(callable, items)` returns true if every element of `items` is callable. This is good Lisp style, but good Python style would be to use `all` and a generator expression: `all(callable(f) for f in items)`. Eventually, fix all calls to these legacy Lisp functions and then remove the functions.
28-
- Add more tests in `test_*.py` files. Strive for terseness; it is ok to group multiple asserts into one `def test_something():` function. Move most tests to `test_*.py`, but it is fine to have a single `doctest` example in the docstring of a function in the `.py` file, if the purpose of the doctest is to explain how to use the function, rather than test the implementation.
2928

3029
## New and Improved Algorithms
3130

3231
- Implement functions that were in the third edition of the book but were not yet implemented in the code. Check the [list of pseudocode algorithms (pdf)](https://github.com/aimacode/pseudocode/blob/master/aima3e-algorithms.pdf) to see what's missing.
3332
- As we finish chapters for the new fourth edition, we will share the new pseudocode in the [`aima-pseudocode`](https://github.com/aimacode/aima-pseudocode) repository, and describe what changes are necessary.
3433
We hope to have an `algorithm-name.md` file for each algorithm, eventually; it would be great if contributors could add some for the existing algorithms.
35-
- Give examples of how to use the code in the `.ipynb` files.
36-
37-
We still support a legacy branch, `aima3python2` (for the third edition of the textbook and for Python 2 code).
3834

3935
## Jupyter Notebooks
4036

@@ -69,21 +65,12 @@ a one-line docstring suffices. It is rarely necessary to list what each argument
6965
- At some point I may add [Pep 484](https://www.python.org/dev/peps/pep-0484/) type annotations, but I think I'll hold off for now;
7066
I want to get more experience with them, and some people may still be in Python 3.4.
7167

72-
73-
Contributing a Patch
74-
====================
75-
76-
1. Submit an issue describing your proposed change to the repo in question (or work on an existing issue).
77-
1. The repo owner will respond to your issue promptly.
78-
1. Fork the desired repo, develop and test your code changes.
79-
1. Submit a pull request.
80-
8168
Reporting Issues
8269
================
8370

8471
- Under which versions of Python does this happen?
8572

86-
- Provide an example of the issue occuring.
73+
- Provide an example of the issue occurring.
8774

8875
- Is anybody working on this?
8976

@@ -98,28 +85,6 @@ Patch Rules
9885

9986
- Follow the style guidelines described above.
10087

101-
Running the Test-Suite
102-
=====================
103-
104-
The minimal requirement for running the testsuite is ``py.test``. You can
105-
install it with:
106-
107-
pip install pytest
108-
109-
Clone this repository:
110-
111-
git clone https://github.com/aimacode/aima-python.git
112-
113-
Fetch the aima-data submodule:
114-
115-
cd aima-python
116-
git submodule init
117-
git submodule update
118-
119-
Then you can run the testsuite from the `aima-python` or `tests` directory with:
120-
121-
py.test
122-
12388
# Choice of Programming Languages
12489

12590
Are we right to concentrate on Java and Python versions of the code? I think so; both languages are popular; Java is

0 commit comments

Comments
 (0)