Skip to content

Commit 408616f

Browse files
committed
vimeo directive.
1 parent 7a0a055 commit 408616f

11 files changed

+152
-292
lines changed

‎doc/source/10_trees_and_directed_acyclic_graphs.rst

+16-32
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,12 @@ The splat and double splat operators
2727

2828
.. dropdown:: Video: splat and double splat.
2929

30-
.. container:: vimeo
30+
.. vimeo:: 523477744
3131

32-
.. raw:: html
32+
.. only:: html
3333

34-
<iframe src="https://player.vimeo.com/video/523477744"
35-
frameborder="0" allow="autoplay; fullscreen"
36-
allowfullscreen></iframe>
37-
38-
Imperial students can also `watch this video on Panopto
39-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=2cb93382-321b-4af6-8d5e-aceb0123103d>`__.
34+
Imperial students can also `watch this video on Panopto
35+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=2cb93382-321b-4af6-8d5e-aceb0123103d>`__.
4036

4137

4238
Before we go on to write code for trees and their traversal, we need to
@@ -257,16 +253,12 @@ Data structures for trees
257253

258254
.. dropdown:: Tree data structures.
259255

260-
.. container:: vimeo
261-
262-
.. raw:: html
256+
.. vimeo:: 523477713
263257

264-
<iframe src="https://player.vimeo.com/video/523477713"
265-
frameborder="0" allow="autoplay; fullscreen"
266-
allowfullscreen></iframe>
258+
.. only:: html
267259

268-
Imperial students can also `watch this video on Panopto
269-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=5477e1b1-1040-4a07-97a5-aceb01230fc6>`__.
260+
Imperial students can also `watch this video on Panopto
261+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=5477e1b1-1040-4a07-97a5-aceb01230fc6>`__.
270262

271263
Unlike the sequence types we have previously met, trees are not linear objects.
272264
If we wish to iterate through every node in the tree then we have a choices to
@@ -339,16 +331,12 @@ Traversing :class:`~example_code.graphs.TreeNode`
339331

340332
.. dropdown:: Video: tree traversal.
341333

342-
.. container:: vimeo
334+
.. vimeo:: 523477719
343335

344-
.. raw:: html
336+
.. only:: html
345337

346-
<iframe src="https://player.vimeo.com/video/523477719"
347-
frameborder="0" allow="autoplay; fullscreen"
348-
allowfullscreen></iframe>
349-
350-
Imperial students can also `watch this video on Panopto
351-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=69b00d45-077d-46ff-933c-aceb01231001>`__.
338+
Imperial students can also `watch this video on Panopto
339+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=69b00d45-077d-46ff-933c-aceb01231001>`__.
352340

353341
A function which traverses a tree is often called a tree visitor, because it
354342
visits every node in the tree. What does it do when it visits? Well it could do
@@ -662,16 +650,12 @@ Operations on expression trees
662650

663651
.. dropdown:: Video: evaluating expressions.
664652

665-
.. container:: vimeo
666-
667-
.. raw:: html
653+
.. vimeo:: 523478799
668654

669-
<iframe src="https://player.vimeo.com/video/523478799"
670-
frameborder="0" allow="autoplay; fullscreen"
671-
allowfullscreen></iframe>
655+
.. only:: html
672656

673-
Imperial students can also `watch this video on Panopto
674-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=88f9564a-73c9-4760-8f48-aceb01230f9b>`__.
657+
Imperial students can also `watch this video on Panopto
658+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=88f9564a-73c9-4760-8f48-aceb01230f9b>`__.
675659

676660
Many operations on expression trees can be implemented using tree visitors, most
677661
frequently by visiting the tree in postorder. An example is

‎doc/source/11_further_object-oriented_features.rst

+12-24
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,12 @@ Decorators
1212

1313
.. dropdown:: Video: decorators.
1414

15-
.. container:: vimeo
15+
.. vimeo:: 526946976
1616

17-
.. raw:: html
17+
.. only:: html
1818

19-
<iframe src="https://player.vimeo.com/video/526946976"
20-
frameborder="0" allow="autoplay; fullscreen"
21-
allowfullscreen></iframe>
22-
23-
Imperial students can also `watch this video on Panopto
24-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f1d61410-4200-42e5-92c4-acf2011de8ab>`__.
19+
Imperial students can also `watch this video on Panopto
20+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f1d61410-4200-42e5-92c4-acf2011de8ab>`__.
2521

2622

2723
In :numref:`Week %s <trees>` we encountered the
@@ -209,16 +205,12 @@ Abstract base classes
209205

210206
.. dropdown:: Video: Abstract base classes.
211207

212-
.. container:: vimeo
213-
214-
.. raw:: html
208+
.. vimeo:: 526947635
215209

216-
<iframe src="https://player.vimeo.com/video/526947635"
217-
frameborder="0" allow="autoplay; fullscreen"
218-
allowfullscreen></iframe>
210+
.. only:: html
219211

220-
Imperial students can also `watch this video on Panopto
221-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f4678a69-731c-45fe-bdbf-acf2011de880>`__.
212+
Imperial students can also `watch this video on Panopto
213+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f4678a69-731c-45fe-bdbf-acf2011de880>`__.
222214

223215
We have now on several occasions encountered classes which are not designed to
224216
be instantiated themselves, but merely serve as parent classes to concrete
@@ -392,16 +384,12 @@ Virtual subclasses
392384

393385
.. dropdown:: Video: virtual subclasses.
394386

395-
.. container:: vimeo
396-
397-
.. raw:: html
387+
.. vimeo:: 526947427
398388

399-
<iframe src="https://player.vimeo.com/video/526947427"
400-
frameborder="0" allow="autoplay; fullscreen"
401-
allowfullscreen></iframe>
389+
.. only:: html
402390

403-
Imperial students can also `watch this video on Panopto
404-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=4114bb1d-cc31-4cfc-81a6-acf2011de8d6>`__.
391+
Imperial students can also `watch this video on Panopto
392+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=4114bb1d-cc31-4cfc-81a6-acf2011de8d6>`__.
405393

406394
We learned in :numref:`Week %s <objects>` that we can determine if a type is a
407395
number by checking if it is an instance of :class:`numbers.Number`. This is a

‎doc/source/1_introduction.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Introduction: abstraction in mathematics and programming
66
.. dropdown:: Video introduction.
77

88
.. vimeo:: 486106801
9-
:width: 100%
109

11-
Imperial students can also `watch this video on Panopto <https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=ee8cae7f-1b42-4db3-adc0-ac840144de53>`_
10+
.. only:: html
11+
12+
Imperial students can also `watch this video on Panopto <https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=ee8cae7f-1b42-4db3-adc0-ac840144de53>`_
1213

1314
A core tool of mathematics is to define abstract objects and the
1415
operations which apply to them. This approach defines all the basic

‎doc/source/2_programs_in_files.rst

+16-36
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,11 @@ Setting up a Python environment for this course
2222

2323
.. dropdown:: Video: setting up your virtual environment.
2424

25-
.. container:: vimeo
25+
.. vimeo:: 486546635
2626

27-
.. raw:: html
27+
.. only:: html
2828

29-
<iframe src="https://player.vimeo.com/video/486546635"
30-
frameborder="0" allow="autoplay; fullscreen"
31-
allowfullscreen></iframe>
32-
33-
Imperial students can also `watch this video on Panopto <https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=011d73de-d93c-4dc8-8996-ac8501521b33>`__
29+
Imperial students can also `watch this video on Panopto <https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=011d73de-d93c-4dc8-8996-ac8501521b33>`__
3430

3531

3632
During this course, we're going to create, edit, and install a whole bunch of
@@ -93,15 +89,11 @@ The Python interpreter
9389

9490
.. dropdown:: Video: a first Python script.
9591

96-
.. container:: vimeo
97-
98-
.. raw:: html
92+
.. vimeo:: 486557682
9993

100-
<iframe src="https://player.vimeo.com/video/486557682"
101-
frameborder="0" allow="autoplay; fullscreen"
102-
allowfullscreen></iframe>
94+
.. only:: html
10395

104-
Imperial students can also `watch this video on Panopto <https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=0f9a50a0-59b4-4bdf-ab90-ac850154fafb>`__
96+
Imperial students can also `watch this video on Panopto <https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=0f9a50a0-59b4-4bdf-ab90-ac850154fafb>`__
10597

10698
Before we dive into the various different ways that Python code can be
10799
organised and run, it's helpful to have a mental model of what it
@@ -276,15 +268,11 @@ Modules
276268

277269
.. dropdown:: Video: a first Python module.
278270

279-
.. container:: vimeo
280-
281-
.. raw:: html
271+
.. vimeo:: 486845755
282272

283-
<iframe src="https://player.vimeo.com/video/486845755"
284-
frameborder="0" allow="autoplay; fullscreen"
285-
allowfullscreen></iframe>
273+
.. only:: html
286274

287-
Imperial students can also `watch this video on Panopto <https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=972f92c6-6b55-4510-9c2c-ac8600fca11a>`__
275+
Imperial students can also `watch this video on Panopto <https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=972f92c6-6b55-4510-9c2c-ac8600fca11a>`__
288276

289277
A module is, like a script, a plain text file containing Python
290278
code. Modules must have names ending in :file:`.py`. So far, that's
@@ -442,15 +430,11 @@ Packages
442430

443431
.. dropdown:: Video: a first Python package.
444432

445-
.. container:: vimeo
433+
.. vimeo:: 487003753
446434

447-
.. raw:: html
435+
.. only:: html
448436

449-
<iframe src="https://player.vimeo.com/video/487003753"
450-
frameborder="0" allow="autoplay; fullscreen"
451-
allowfullscreen></iframe>
452-
453-
Imperial students can also `watch this video on Panopto <https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=c4b0aedd-02a8-45d1-946b-ac86015b6d0b>`__
437+
Imperial students can also `watch this video on Panopto <https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=c4b0aedd-02a8-45d1-946b-ac86015b6d0b>`__
454438

455439

456440
Modules are the principal mechanism for storing code which is intended
@@ -654,16 +638,12 @@ Testing frameworks
654638

655639
.. dropdown:: Video: introducing Pytest.
656640

657-
.. container:: vimeo
658-
659-
.. raw:: html
641+
.. vimeo:: 486987209
660642

661-
<iframe src="https://player.vimeo.com/video/486987209"
662-
frameborder="0" allow="autoplay; fullscreen"
663-
allowfullscreen></iframe>
643+
.. only:: html
664644

665-
Imperial students can also `watch this video on Panopto
666-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=c636383d-6125-4a7c-bad7-ac86015b6d4c>`__
645+
Imperial students can also `watch this video on Panopto
646+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=c636383d-6125-4a7c-bad7-ac86015b6d4c>`__
667647

668648
Attempting to establish whether a program correctly implements the
669649
intended algorithm is core to effective programming, and programmers

‎doc/source/3_objects.rst

+20-40
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,12 @@ Defining new types
177177

178178
.. dropdown:: Video: a first class
179179

180-
.. container:: vimeo
180+
.. vimeo:: 488143930
181181

182-
.. raw:: html
182+
.. only:: html
183183

184-
<iframe src="https://player.vimeo.com/video/488143930"
185-
frameborder="0" allow="autoplay; fullscreen"
186-
allowfullscreen></iframe>
187-
188-
Imperial students can also `watch this video on Panopto
189-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f8b07554-16ea-47b8-bf19-ac8a010af0f6>`__
184+
Imperial students can also `watch this video on Panopto
185+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f8b07554-16ea-47b8-bf19-ac8a010af0f6>`__
190186

191187
Python has a rich set of :doc:`built-in types
192188
<library/stdtypes>`. These form powerful building blocks for the
@@ -326,16 +322,12 @@ Methods
326322

327323
.. dropdown:: Video: defining methods
328324

329-
.. container:: vimeo
330-
331-
.. raw:: html
325+
.. vimeo:: 488273256
332326

333-
<iframe src="https://player.vimeo.com/video/488273256"
334-
frameborder="0" allow="autoplay; fullscreen"
335-
allowfullscreen></iframe>
327+
.. only:: html
336328

337-
Imperial students can also `watch this video on Panopto
338-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=613249ca-71b8-4f3b-8db9-ac8a0166aa42>`__
329+
Imperial students can also `watch this video on Panopto
330+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=613249ca-71b8-4f3b-8db9-ac8a0166aa42>`__
339331

340332
We have already met the :term:`special method` :meth:`~object.__init__`,
341333
which defines the class constructor. A much more typical case is an
@@ -388,16 +380,12 @@ String representations of objects
388380

389381
.. dropdown:: Video: printing classes
390382

391-
.. container:: vimeo
392-
393-
.. raw:: html
383+
.. vimeo:: 488275072
394384

395-
<iframe src="https://player.vimeo.com/video/488275072"
396-
frameborder="0" allow="autoplay; fullscreen"
397-
allowfullscreen></iframe>
385+
.. only:: html
398386

399-
Imperial students can also `watch this video on Panopto
400-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=b30db20c-1224-41b7-a5f2-ac8a01680608>`__
387+
Imperial students can also `watch this video on Panopto
388+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=b30db20c-1224-41b7-a5f2-ac8a01680608>`__
401389

402390

403391
Remember that a key reason for defining new classes is to enable users
@@ -498,16 +486,12 @@ Object equality
498486

499487
.. dropdown:: Video: object equality and test driven development
500488

501-
.. container:: vimeo
489+
.. vimeo:: 488981397
502490

503-
.. raw:: html
491+
.. only:: html
504492

505-
<iframe src="https://player.vimeo.com/video/488981397"
506-
frameborder="0" allow="autoplay; fullscreen"
507-
allowfullscreen></iframe>
508-
509-
Imperial students can also `watch this video on Panopto
510-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=821e53ec-d2c8-43a6-bb16-ac8c01045f31>`__
493+
Imperial students can also `watch this video on Panopto
494+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=821e53ec-d2c8-43a6-bb16-ac8c01045f31>`__
511495

512496
When are two objects equal? For built-in types Python has equality rules which
513497
broadly match the mathematical identities that you might expect. For example,
@@ -602,16 +586,12 @@ Defining arithmetic options on objects
602586

603587
.. dropdown:: Video: polynomial addition.
604588

605-
.. container:: vimeo
606-
607-
.. raw:: html
589+
.. vimeo:: 489009900
608590

609-
<iframe src="https://player.vimeo.com/video/489009900"
610-
frameborder="0" allow="autoplay; fullscreen"
611-
allowfullscreen></iframe>
591+
.. only:: html
612592

613-
Imperial students can also `watch this video on Panopto
614-
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=727c5b9a-bf61-480e-912e-ac8c01045f09>`__
593+
Imperial students can also `watch this video on Panopto
594+
<https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=727c5b9a-bf61-480e-912e-ac8c01045f09>`__
615595

616596
It's all very well to be able to compare our polynomial objects, but
617597
we won't really have captured the mathematical abstraction involved

0 commit comments

Comments
 (0)