You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename notebook.py to notebook_utils.py to avoid Jupyter package collision (#1294)
The repo shipped notebook.py at its root, which shadowed the Jupyter
'notebook' PyPI package (sys.path[0] is the cwd). Launching Jupyter from
the repo root, or PyCharm's 'from notebook.app import main' launcher,
then failed with ModuleNotFoundError: 'notebook' is not a package.
Rename the module to notebook_utils.py (a visualization/helper module, not
edition-specific, so it keeps the unsuffixed-3e convention intact for the
algorithm modules) and update the 'from notebook import ...' line in the
25 notebooks that use it, plus the CONTRIBUTING.md references. No .py
module or test imports it, so the test suite is unaffected. notebook4e.py
is left as-is (its name does not collide).
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,11 +37,11 @@ We hope to have an `algorithm-name.md` file for each algorithm, eventually; it w
37
37
In this project we use Jupyter/IPython Notebooks to showcase the algorithms in the book. They serve as short tutorials on what the algorithms do, how they are implemented and how one can use them. To install Jupyter, you can follow the instructions [here](https://jupyter.org/install.html). These are some ways you can contribute to the notebooks:
38
38
39
39
- Proofread the notebooks for grammar mistakes, typos, or general errors.
40
-
- Move visualization and unrelated to the algorithm code from notebooks to `notebook.py` (a file used to store code for the notebooks, like visualization and other miscellaneous stuff). Make sure the notebooks still work and have their outputs showing!
41
-
- Replace the `%psource` magic notebook command with the function `psource` from `notebook.py` where needed. Examples where this is useful are a) when we want to show code for algorithm implementation and b) when we have consecutive cells with the magic keyword (in this case, if the code is large, it's best to leave the output hidden).
40
+
- Move visualization and unrelated to the algorithm code from notebooks to `notebook_utils.py` (a file used to store code for the notebooks, like visualization and other miscellaneous stuff). Make sure the notebooks still work and have their outputs showing!
41
+
- Replace the `%psource` magic notebook command with the function `psource` from `notebook_utils.py` where needed. Examples where this is useful are a) when we want to show code for algorithm implementation and b) when we have consecutive cells with the magic keyword (in this case, if the code is large, it's best to leave the output hidden).
42
42
- Add the function `pseudocode(algorithm_name)` in algorithm sections. The function prints the pseudocode of the algorithm. You can see some example usage in [`knowledge.ipynb`](https://github.com/aimacode/aima-python/blob/master/knowledge.ipynb).
43
43
- Edit existing sections for algorithms to add more information and/or examples.
44
-
- Add visualizations for algorithms. The visualization code should go in `notebook.py` to keep things clean.
44
+
- Add visualizations for algorithms. The visualization code should go in `notebook_utils.py` to keep things clean.
45
45
- Add new sections for algorithms not yet covered. The general format we use in the notebooks is the following: First start with an overview of the algorithm, printing the pseudocode and explaining how it works. Then, add some implementation details, including showing the code (using `psource`). Finally, add examples for the implementations, showing how the algorithms work. Don't fret with adding complex, real-world examples; the project is meant for educational purposes. You can of course choose another format if something better suits an algorithm.
46
46
47
47
Apart from the notebooks explaining how the algorithms work, we also have notebooks showcasing some indicative applications of the algorithms. These notebooks are in the `*_apps.ipynb` format. We aim to have an `apps` notebook for each module, so if you don't see one for the module you would like to contribute to, feel free to create it from scratch! In these notebooks we are looking for applications showing what the algorithms can do. The general format of these sections is this: Add a description of the problem you are trying to solve, then explain how you are going to solve it and finally provide your solution with examples. Note that any code you write should not require any external libraries apart from the ones already provided (like `matplotlib`).
0 commit comments