Skip to content

Commit 1243032

Browse files
committed
the ants readme was missing the download admonition
1 parent 732ae90 commit 1243032

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

notebooks/tps/ants/.teacher/README-ants-corrige-nb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ language_info:
2424
there are no difference - apart from this very cell - between the teacher and the student version, but the notebook is duplicated in .teacher for consistency
2525
````
2626

27-
+++ {"tags": ["prune-cell"]}
27+
+++ {"editable": true, "slideshow": {"slide_type": ""}}
2828

2929
```{admonition} grab the zip for starters
3030

notebooks/tps/ants/README-ants-nb.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ kernelspec:
88
display_name: Python 3 (ipykernel)
99
language: python
1010
name: python3
11-
language_info:
12-
name: python
13-
nbconvert_exporter: python
14-
pygments_lexer: ipython3
1511
---
1612

1713
# ants: a genetic algorithm
1814

1915
+++
2016

17+
```{admonition} grab the zip for starters
18+
19+
{download}`you will need the zipfile that you can find here<./ARTEFACTS-ants.zip>`
20+
```
21+
22+
+++
23+
2124
## problem statement
2225

2326
our goal in this activity is to implement an optimization algorithm that is an example of a *genetic algorithm*
@@ -96,38 +99,38 @@ here we provide the results found by our own implementation; this in particular
9699

97100
also provided in the zip, you can use `problem.py` like so:
98101

99-
```{code-cell} ipython3
102+
```{code-cell}
100103
from problem import Problem2D
101104
102105
problem = Problem2D("data/video-06.csv")
103106
```
104107

105-
```{code-cell} ipython3
108+
```{code-cell}
106109
# how many nodes
107110
len(problem)
108111
```
109112

110-
```{code-cell} ipython3
113+
```{code-cell}
111114
# to iterate over nodes
112115
113116
for node in problem:
114117
print(node)
115118
```
116119

117-
```{code-cell} ipython3
120+
```{code-cell}
118121
# or rather
119122
120123
for index, node in enumerate(problem):
121124
print(f"{index}-th node is {node}")
122125
```
123126

124-
```{code-cell} ipython3
127+
```{code-cell}
125128
# get distance between 2 nodes
126129
127130
problem.distance(0, 2)
128131
```
129132

130-
```{code-cell} ipython3
133+
```{code-cell}
131134
# what it says
132135
133136
problem.distance_along_path([0, 1, 2, 3, 0])
@@ -141,13 +144,13 @@ we've also coded some display featured for your convenience
141144

142145
1st off, **provided that you have `graphviz` installed**
143146

144-
```{code-cell} ipython3
147+
```{code-cell}
145148
# you can do display it with graphviz like this
146149
147150
problem.to_graphviz()
148151
```
149152

150-
```{code-cell} ipython3
153+
```{code-cell}
151154
# or this if you prefer
152155
153156
problem.to_graphviz(show_distances=False)
@@ -157,14 +160,14 @@ problem.to_graphviz(show_distances=False)
157160

158161
and there again, **provided that you have `plotly` installed** you could do
159162

160-
```{code-cell} ipython3
163+
```{code-cell}
161164
import plotly.io as pio
162165
163166
# Try one of these depending on your setup:
164167
pio.renderers.default = "notebook" # for classic Jupyter Notebook
165168
```
166169

167-
```{code-cell} ipython3
170+
```{code-cell}
168171
problem.to_plotly()
169172
```
170173

0 commit comments

Comments
 (0)