|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": null, |
| 5 | + "execution_count": 1, |
6 | 6 | "metadata": { |
7 | 7 | "deletable": false, |
8 | 8 | "editable": false |
|
74 | 74 | }, |
75 | 75 | { |
76 | 76 | "cell_type": "code", |
77 | | - "execution_count": null, |
| 77 | + "execution_count": 2, |
78 | 78 | "metadata": {}, |
79 | 79 | "outputs": [], |
80 | 80 | "source": [ |
|
88 | 88 | }, |
89 | 89 | { |
90 | 90 | "cell_type": "code", |
91 | | - "execution_count": null, |
| 91 | + "execution_count": 3, |
92 | 92 | "metadata": {}, |
93 | 93 | "outputs": [], |
94 | 94 | "source": [ |
|
99 | 99 | }, |
100 | 100 | { |
101 | 101 | "cell_type": "code", |
102 | | - "execution_count": null, |
| 102 | + "execution_count": 4, |
103 | 103 | "metadata": {}, |
104 | 104 | "outputs": [], |
105 | 105 | "source": [ |
|
126 | 126 | }, |
127 | 127 | { |
128 | 128 | "cell_type": "code", |
129 | | - "execution_count": null, |
| 129 | + "execution_count": 5, |
130 | 130 | "metadata": { |
131 | 131 | "tags": [ |
132 | 132 | "otter_answer_cell" |
|
144 | 144 | }, |
145 | 145 | { |
146 | 146 | "cell_type": "code", |
147 | | - "execution_count": null, |
| 147 | + "execution_count": 6, |
148 | 148 | "metadata": { |
149 | 149 | "deletable": false, |
150 | 150 | "editable": false |
151 | 151 | }, |
152 | | - "outputs": [], |
| 152 | + "outputs": [ |
| 153 | + { |
| 154 | + "data": { |
| 155 | + "text/html": [ |
| 156 | + "<p><strong><pre style='display: inline;'>square_points</pre></strong> passed! 🌈</p>" |
| 157 | + ], |
| 158 | + "text/plain": [ |
| 159 | + "square_points results: All test cases passed!" |
| 160 | + ] |
| 161 | + }, |
| 162 | + "execution_count": 6, |
| 163 | + "metadata": {}, |
| 164 | + "output_type": "execute_result" |
| 165 | + } |
| 166 | + ], |
153 | 167 | "source": [ |
154 | 168 | "grader.check(\"square_points\")" |
155 | 169 | ] |
|
179 | 193 | }, |
180 | 194 | { |
181 | 195 | "cell_type": "code", |
182 | | - "execution_count": null, |
| 196 | + "execution_count": 7, |
183 | 197 | "metadata": { |
184 | 198 | "tags": [ |
185 | 199 | "otter_answer_cell" |
|
207 | 221 | }, |
208 | 222 | { |
209 | 223 | "cell_type": "code", |
210 | | - "execution_count": null, |
| 224 | + "execution_count": 8, |
211 | 225 | "metadata": { |
212 | 226 | "tags": [ |
213 | 227 | "otter_answer_cell" |
|
224 | 238 | }, |
225 | 239 | { |
226 | 240 | "cell_type": "code", |
227 | | - "execution_count": null, |
| 241 | + "execution_count": 9, |
228 | 242 | "metadata": { |
229 | 243 | "tags": [ |
230 | 244 | "otter_answer_cell" |
231 | 245 | ] |
232 | 246 | }, |
233 | | - "outputs": [], |
| 247 | + "outputs": [ |
| 248 | + { |
| 249 | + "name": "stdout", |
| 250 | + "output_type": "stream", |
| 251 | + "text": [ |
| 252 | + "Class name: check_name, color: Grey\n", |
| 253 | + "Key: shape_to_use, Value: wedge\n", |
| 254 | + "Key: link_length, Value: 2.0\n", |
| 255 | + "Key: link_width, Value: 2.0\n", |
| 256 | + "Key: og_size, Value: 2.0\n", |
| 257 | + "Key: length_ratio, Value: 1.0\n", |
| 258 | + "Key: width_ratio, Value: 1.0\n", |
| 259 | + "Key: current_angle, Value: 0.0\n", |
| 260 | + "Key: rotate_angle, Value: 0.0\n", |
| 261 | + "Key: pts, Value:\n", |
| 262 | + "[[-1.000000 1.000000 0.800000 -0.800000 -1.000000]\n", |
| 263 | + " [-1.000000 -1.000000 1.000000 1.000000 -1.000000]\n", |
| 264 | + " [1.000000 1.000000 1.000000 1.000000 1.000000]]\n", |
| 265 | + "Key: mat_resize_shape, Value:\n", |
| 266 | + "[[1.000000 0.000000 0.000000]\n", |
| 267 | + " [0.000000 1.000000 0.000000]\n", |
| 268 | + " [0.000000 0.000000 1.000000]]\n", |
| 269 | + "Key: mat_rotate, Value:\n", |
| 270 | + "[[1.000000 0.000000 0.000000]\n", |
| 271 | + " [0.000000 1.000000 0.000000]\n", |
| 272 | + " [0.000000 0.000000 1.000000]]\n", |
| 273 | + "Key: mat_translate_shape, Value:\n", |
| 274 | + "[[1.000000 0.000000 1.000000]\n", |
| 275 | + " [0.000000 1.000000 0.000000]\n", |
| 276 | + " [0.000000 0.000000 1.000000]]\n", |
| 277 | + "\n" |
| 278 | + ] |
| 279 | + } |
| 280 | + ], |
234 | 281 | "source": [ |
235 | 282 | "# I set up a convert-the-class-to-a-string method for you, which you can use to print out the class in a sort-of readable form\n", |
236 | 283 | "# See the str method in the class\n", |
|
239 | 286 | }, |
240 | 287 | { |
241 | 288 | "cell_type": "code", |
242 | | - "execution_count": null, |
| 289 | + "execution_count": 10, |
243 | 290 | "metadata": { |
244 | 291 | "tags": [ |
245 | 292 | "otter_answer_cell" |
246 | 293 | ] |
247 | 294 | }, |
248 | | - "outputs": [], |
| 295 | + "outputs": [ |
| 296 | + { |
| 297 | + "data": { |
| 298 | + "text/plain": [ |
| 299 | + "Ellipsis" |
| 300 | + ] |
| 301 | + }, |
| 302 | + "execution_count": 10, |
| 303 | + "metadata": {}, |
| 304 | + "output_type": "execute_result" |
| 305 | + } |
| 306 | + ], |
249 | 307 | "source": [ |
250 | 308 | "# GUIDES: P2: Now set band_name to be your favorite band name HERE, by doing \n", |
251 | 309 | "# arm_component_blank.band_name = \"band name\"\n", |
|
258 | 316 | }, |
259 | 317 | { |
260 | 318 | "cell_type": "code", |
261 | | - "execution_count": null, |
| 319 | + "execution_count": 11, |
262 | 320 | "metadata": { |
263 | 321 | "tags": [ |
264 | 322 | "otter_answer_cell" |
265 | 323 | ] |
266 | 324 | }, |
267 | | - "outputs": [], |
| 325 | + "outputs": [ |
| 326 | + { |
| 327 | + "name": "stdout", |
| 328 | + "output_type": "stream", |
| 329 | + "text": [ |
| 330 | + "Class name: check_name, color: Grey\n", |
| 331 | + "Key: shape_to_use, Value: wedge\n", |
| 332 | + "Key: link_length, Value: 2.0\n", |
| 333 | + "Key: link_width, Value: 2.0\n", |
| 334 | + "Key: og_size, Value: 2.0\n", |
| 335 | + "Key: length_ratio, Value: 1.0\n", |
| 336 | + "Key: width_ratio, Value: 1.0\n", |
| 337 | + "Key: current_angle, Value: 0.0\n", |
| 338 | + "Key: rotate_angle, Value: 0.0\n", |
| 339 | + "Key: pts, Value:\n", |
| 340 | + "[[-1.000000 1.000000 0.800000 -0.800000 -1.000000]\n", |
| 341 | + " [-1.000000 -1.000000 1.000000 1.000000 -1.000000]\n", |
| 342 | + " [1.000000 1.000000 1.000000 1.000000 1.000000]]\n", |
| 343 | + "Key: mat_resize_shape, Value:\n", |
| 344 | + "[[1.000000 0.000000 0.000000]\n", |
| 345 | + " [0.000000 1.000000 0.000000]\n", |
| 346 | + " [0.000000 0.000000 1.000000]]\n", |
| 347 | + "Key: mat_rotate, Value:\n", |
| 348 | + "[[1.000000 0.000000 0.000000]\n", |
| 349 | + " [0.000000 1.000000 0.000000]\n", |
| 350 | + " [0.000000 0.000000 1.000000]]\n", |
| 351 | + "Key: mat_translate_shape, Value:\n", |
| 352 | + "[[1.000000 0.000000 1.000000]\n", |
| 353 | + " [0.000000 1.000000 0.000000]\n", |
| 354 | + " [0.000000 0.000000 1.000000]]\n", |
| 355 | + "Key: band_name, Value: \n", |
| 356 | + "\n" |
| 357 | + ] |
| 358 | + } |
| 359 | + ], |
268 | 360 | "source": [ |
269 | 361 | "# GUIDES: P3: When you print this time, band_name should be set to your favorite band \n", |
270 | 362 | "print(arm_component_blank)" |
271 | 363 | ] |
272 | 364 | }, |
273 | 365 | { |
274 | 366 | "cell_type": "code", |
275 | | - "execution_count": null, |
| 367 | + "execution_count": 12, |
276 | 368 | "metadata": { |
277 | 369 | "deletable": false, |
278 | 370 | "editable": false |
279 | 371 | }, |
280 | | - "outputs": [], |
| 372 | + "outputs": [ |
| 373 | + { |
| 374 | + "data": { |
| 375 | + "text/html": [ |
| 376 | + "<p><strong style='color: red;'><pre style='display: inline;'>init_method</pre> results:</strong></p><p><strong><pre style='display: inline;'>init_method - 1</pre> result:</strong></p><pre> ✅ Test case passed</pre><p><strong><pre style='display: inline;'>init_method - 2</pre> result:</strong></p><pre> ✅ Test case passed</pre><p><strong><pre style='display: inline;'>init_method - 3</pre> result:</strong></p><pre> ❌ Test case failed\n", |
| 377 | + " Trying:\n", |
| 378 | + " assert arm_component_blank.band_name != ''\n", |
| 379 | + " Expecting nothing\n", |
| 380 | + " **********************************************************************\n", |
| 381 | + " Line 1, in init_method 2\n", |
| 382 | + " Failed example:\n", |
| 383 | + " assert arm_component_blank.band_name != ''\n", |
| 384 | + " Exception raised:\n", |
| 385 | + " Traceback (most recent call last):\n", |
| 386 | + " File \"C:\\Users\\JPizzle\\AppData\\Roaming\\uv\\python\\cpython-3.12.7-windows-x86_64-none\\Lib\\doctest.py\", line 1368, in __run\n", |
| 387 | + " exec(compile(example.source, filename, \"single\",\n", |
| 388 | + " File \"<doctest init_method 2[0]>\", line 1, in <module>\n", |
| 389 | + " assert arm_component_blank.band_name != ''\n", |
| 390 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 391 | + " AssertionError\n", |
| 392 | + "</pre>" |
| 393 | + ], |
| 394 | + "text/plain": [ |
| 395 | + "init_method results:\n", |
| 396 | + " init_method - 1 result:\n", |
| 397 | + " ✅ Test case passed\n", |
| 398 | + "\n", |
| 399 | + " init_method - 2 result:\n", |
| 400 | + " ✅ Test case passed\n", |
| 401 | + "\n", |
| 402 | + " init_method - 3 result:\n", |
| 403 | + " ❌ Test case failed\n", |
| 404 | + " Trying:\n", |
| 405 | + " assert arm_component_blank.band_name != ''\n", |
| 406 | + " Expecting nothing\n", |
| 407 | + " **********************************************************************\n", |
| 408 | + " Line 1, in init_method 2\n", |
| 409 | + " Failed example:\n", |
| 410 | + " assert arm_component_blank.band_name != ''\n", |
| 411 | + " Exception raised:\n", |
| 412 | + " Traceback (most recent call last):\n", |
| 413 | + " File \"C:\\Users\\JPizzle\\AppData\\Roaming\\uv\\python\\cpython-3.12.7-windows-x86_64-none\\Lib\\doctest.py\", line 1368, in __run\n", |
| 414 | + " exec(compile(example.source, filename, \"single\",\n", |
| 415 | + " File \"<doctest init_method 2[0]>\", line 1, in <module>\n", |
| 416 | + " assert arm_component_blank.band_name != ''\n", |
| 417 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 418 | + " AssertionError" |
| 419 | + ] |
| 420 | + }, |
| 421 | + "execution_count": 12, |
| 422 | + "metadata": {}, |
| 423 | + "output_type": "execute_result" |
| 424 | + } |
| 425 | + ], |
281 | 426 | "source": [ |
282 | 427 | "grader.check(\"init_method\")" |
283 | 428 | ] |
|
307 | 452 | "otter_answer_cell" |
308 | 453 | ] |
309 | 454 | }, |
310 | | - "outputs": [], |
| 455 | + "outputs": [ |
| 456 | + { |
| 457 | + "ename": "AssertionError", |
| 458 | + "evalue": "", |
| 459 | + "output_type": "error", |
| 460 | + "traceback": [ |
| 461 | + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", |
| 462 | + "\u001b[31mAssertionError\u001b[39m Traceback (most recent call last)", |
| 463 | + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[49]\u001b[39m\u001b[32m, line 18\u001b[39m\n\u001b[32m 14\u001b[39m \u001b[38;5;66;03m# to this one - we will be changing base sizes later\u001b[39;00m\n\u001b[32m 15\u001b[39m mat_base_check = np.array([[\u001b[32m0.5\u001b[39m, \u001b[32m0.0\u001b[39m, \u001b[32m0\u001b[39m], [\u001b[32m0.0\u001b[39m, \u001b[32m0.25\u001b[39m, \u001b[32m0.25\u001b[39m], [\u001b[32m0.0\u001b[39m, \u001b[32m0.0\u001b[39m, \u001b[32m1.0\u001b[39m]])\n\u001b[32m 16\u001b[39m \n\u001b[32m 17\u001b[39m \u001b[38;5;66;03m# Once this passes, copy the code into set_to_base_shape in arm component\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m18\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m np.all(np.isclose(mat_my_base, mat_base_check))\n", |
| 464 | + "\u001b[31mAssertionError\u001b[39m: " |
| 465 | + ] |
| 466 | + } |
| 467 | + ], |
311 | 468 | "source": [ |
312 | 469 | "# The size of the base \n", |
313 | 470 | "base_width = 1.0\n", |
|
779 | 936 | ], |
780 | 937 | "metadata": { |
781 | 938 | "kernelspec": { |
782 | | - "display_name": "base", |
| 939 | + "display_name": "jpintropythonprogramming", |
783 | 940 | "language": "python", |
784 | 941 | "name": "python3" |
785 | 942 | }, |
|
793 | 950 | "name": "python", |
794 | 951 | "nbconvert_exporter": "python", |
795 | 952 | "pygments_lexer": "ipython3", |
796 | | - "version": "3.12.4" |
| 953 | + "version": "3.12.7" |
797 | 954 | }, |
798 | 955 | "otter": { |
799 | 956 | "OK_FORMAT": true, |
|
0 commit comments