Skip to content

Commit c9e6520

Browse files
committed
Website build
1 parent cb828d3 commit c9e6520

Some content is hidden

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

48 files changed

+357
-228
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: deaa46c820e7d7258d09a89e9a731161
3+
config: 6dc77e83c8ab02d3fb6e6302ff875ff3
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

10_trees_and_directed_acyclic_graphs.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<script src="_static/jquery.js"></script>
1818
<script src="_static/underscore.js"></script>
1919
<script src="_static/doctools.js"></script>
20-
<script src="_static/language_data.js"></script>
2120
<script src="_static/proof.js"></script>
2221
<script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
2322
<link rel="index" title="Index" href="genindex.html" />
@@ -811,10 +810,10 @@ <h3><span class="section-number">10.3.3. </span>Single dispatch functions<a clas
811810
</div>
812811
<p><a class="reference internal" href="#tree-evaluate"><span class="std std-numref">Listing 10.6</span></a> shows a single dispatch function for a visitor function
813812
which evaluates a <code class="xref py py-class docutils literal notranslate"><span class="pre">Expression</span></code>. Start with lines 6-19. These define a
814-
function <a class="reference internal" href="example_code.html#example_code.expression_tools.evaluate" title="example_code.expression_tools.evaluate"><code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code></a> which will be used in
813+
function <code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code> which will be used in
815814
the default case, that is, in the case where the <a class="reference external" href="https://docs.python.org/3/library/functions.html#type" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">type</span></code></a> of the first
816815
argument doesn’t match any of the other implementations of
817-
<a class="reference internal" href="example_code.html#example_code.expression_tools.evaluate" title="example_code.expression_tools.evaluate"><code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code></a>. In this case, the first
816+
<code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code>. In this case, the first
818817
argument is the expression that we’re evaluating, so if the type doesn’t match
819818
then this means that we don’t know how to evaluate this object, and the only
820819
course of action available is to throw an <a class="reference internal" href="6_exceptions.html#term-exception"><span class="xref std std-term">exception</span></a>.</p>
@@ -832,13 +831,13 @@ <h3><span class="section-number">10.3.3. </span>Single dispatch functions<a clas
832831
Notice that the function name is given as <code class="xref py py-obj docutils literal notranslate"><span class="pre">_</span></code>. This is the Python convention for
833832
a name which will never be used. This function will never be called by its
834833
declared name. Instead, look at the decorator on line 26. The single dispatch
835-
function <a class="reference internal" href="example_code.html#example_code.expression_tools.evaluate" title="example_code.expression_tools.evaluate"><code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code></a> has a <a class="reference internal" href="3_objects.html#term-method"><span class="xref std std-term">method</span></a>
834+
function <code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code> has a <a class="reference internal" href="3_objects.html#term-method"><span class="xref std std-term">method</span></a>
836835
<code class="xref py py-meth docutils literal notranslate"><span class="pre">register()</span></code>. When used as a decorator, the <code class="xref py py-meth docutils literal notranslate"><span class="pre">register()</span></code> method of a
837836
single dispatch function registers the function that follows as implementation
838837
for the <a class="reference external" href="https://docs.python.org/3/reference/compound_stmts.html#class" title="(in Python v3.9)"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">class</span></code></a> given as an argument to <code class="xref py py-meth docutils literal notranslate"><span class="pre">register()</span></code>. On this
839838
occasion, this is <code class="xref py py-class docutils literal notranslate"><span class="pre">expressions.Number</span></code>.</p>
840839
<p>Now look at lines 31-33. These contain the implementation of
841-
<a class="reference internal" href="example_code.html#example_code.expression_tools.evaluate" title="example_code.expression_tools.evaluate"><code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code></a> for <code class="xref py py-class docutils literal notranslate"><span class="pre">expressions.Symbol</span></code>.
840+
<code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code> for <code class="xref py py-class docutils literal notranslate"><span class="pre">expressions.Symbol</span></code>.
842841
In order to evaluate a symbol, we depend on the mapping from symbol names to
843842
numerical values that has been passed in.</p>
844843
<p>Finally, look at lines 36-38. These define the evaluation visitor for addition.
@@ -1244,7 +1243,7 @@ <h2><span class="section-number">10.8. </span>Exercises<a class="headerlink" hre
12441243
</div>
12451244
<div class="footer" role="contentinfo">
12461245
&#169; Copyright 2019-2020, David A. Ham.
1247-
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.3.1.
1246+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
12481247
</div>
12491248
</body>
12501249
</html>

11_further_object-oriented_features.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<script src="_static/jquery.js"></script>
1818
<script src="_static/underscore.js"></script>
1919
<script src="_static/doctools.js"></script>
20-
<script src="_static/language_data.js"></script>
2120
<script src="_static/proof.js"></script>
2221
<script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
2322
<link rel="index" title="Index" href="genindex.html" />
@@ -83,7 +82,7 @@ <h3><span class="section-number">11.3.1. </span>Glossary<a class="headerlink" hr
8382
</div>
8483
<div class="footer" role="contentinfo">
8584
&#169; Copyright 2019-2020, David A. Ham.
86-
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.3.1.
85+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
8786
</div>
8887
</body>
8988
</html>

1_introduction.html

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<script src="_static/jquery.js"></script>
1818
<script src="_static/underscore.js"></script>
1919
<script src="_static/doctools.js"></script>
20-
<script src="_static/language_data.js"></script>
2120
<script src="_static/proof.js"></script>
2221
<script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
2322
<link rel="index" title="Index" href="genindex.html" />
@@ -534,9 +533,11 @@ <h4><span class="section-number">1.3.8.3. </span>Including mathematics<a class="
534533
<h4><span class="section-number">1.3.8.4. </span>Including links<a class="headerlink" href="#including-links" title="Permalink to this headline"></a></h4>
535534
<p>Just dumping URLs into the text often results in hard to read code. Instead,
536535
Markdown enables you to write the link text in square brackets followed by the
537-
URL in round brackets. So <code class="xref py py-obj docutils literal notranslate"><span class="pre">[the</span> <span class="pre">Markdown</span> <span class="pre">Cheat</span>
538-
<span class="pre">Sheet](https://www.markdownguide.org/cheat-sheet/)</span></code> becomes <a class="reference external" href="https://www.markdownguide.org/cheat-sheet/">the Markdown Cheat
539-
Sheet</a>.</p>
536+
URL in round brackets. So:</p>
537+
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">the</span> <span class="n">Markdown</span> <span class="n">Cheat</span> <span class="n">Sheet</span><span class="p">](</span><span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">www</span><span class="o">.</span><span class="n">markdownguide</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">cheat</span><span class="o">-</span><span class="n">sheet</span><span class="o">/</span><span class="p">)</span>
538+
</pre></div>
539+
</div>
540+
<p>becomes <a class="reference external" href="https://www.markdownguide.org/cheat-sheet/">the Markdown Cheat Sheet</a>.</p>
540541
</div>
541542
<div class="section" id="more-advanced-markdown">
542543
<h4><span class="section-number">1.3.8.5. </span>More advanced Markdown<a class="headerlink" href="#more-advanced-markdown" title="Permalink to this headline"></a></h4>
@@ -555,14 +556,14 @@ <h3><span class="section-number">1.3.9. </span>An example issue report<a class="
555556

556557
The following code is in the file <span class="sb">`square.py`</span>:
557558

558-
<span class="s">```python3</span>
559+
<span class="sb">```python3</span>
559560
<span class="k">def</span> <span class="nf">square</span><span class="p">(</span><span class="n">x</span><span class="p">):</span>
560561
<span class="k">return</span> <span class="n">x</span><span class="o">^</span><span class="mi">2</span>
561-
<span class="s">```</span>
562+
<span class="sb">```</span>
562563

563564
I try out this function in iPython and observe the wrong answers:
564565

565-
<span class="s">```ipython3</span>
566+
<span class="sb">```ipython3</span>
566567
<span class="n">In</span> <span class="p">[</span><span class="mi">1</span><span class="p">]:</span> <span class="kn">from</span> <span class="nn">square</span> <span class="kn">import</span> <span class="n">square</span>
567568

568569
<span class="n">In</span> <span class="p">[</span><span class="mi">2</span><span class="p">]:</span> <span class="n">square</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
@@ -573,7 +574,7 @@ <h3><span class="section-number">1.3.9. </span>An example issue report<a class="
573574

574575
<span class="n">In</span> <span class="p">[</span><span class="mi">4</span><span class="p">]:</span> <span class="n">square</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
575576
<span class="n">Out</span><span class="p">[</span><span class="mi">4</span><span class="p">]:</span> <span class="mi">6</span>
576-
<span class="s">```</span>
577+
<span class="sb">```</span>
577578

578579
I would expect to see 4, 9, 16 respectively. I do not understand what is
579580
going wrong.
@@ -642,7 +643,7 @@ <h2><span class="section-number">1.4. </span>Exercises<a class="headerlink" href
642643
</div>
643644
<div class="footer" role="contentinfo">
644645
&#169; Copyright 2019-2020, David A. Ham.
645-
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.3.1.
646+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
646647
</div>
647648
</body>
648649
</html>

2_programs_in_files.html

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<script src="_static/jquery.js"></script>
1818
<script src="_static/underscore.js"></script>
1919
<script src="_static/doctools.js"></script>
20-
<script src="_static/language_data.js"></script>
2120
<script src="_static/proof.js"></script>
2221
<script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
2322
<link rel="index" title="Index" href="genindex.html" />
@@ -370,11 +369,7 @@ <h3><span class="section-number">2.5.1. </span>Importing and namespaces<a class=
370369
with them for as long as you have used a computer, without even
371370
thinking about it. This is because folders are simply namespaces
372371
for files. Each filename can exist only once in each folder, and
373-
you can nest folders inside folders. Indeed, “directory” is an
374-
older synonym for “folder” and makes the link to namespaces much
375-
clearer: a folder or directory is just a list of named files in the
376-
same way that a telephone directory is a list of named phone
377-
numbers.</p>
372+
you can nest folders inside folders.</p>
378373
</div>
379374
</div>
380375
<div class="section" id="other-forms-of-import">
@@ -507,7 +502,7 @@ <h2><span class="section-number">2.6. </span>Packages<a class="headerlink" href=
507502
containing a file <code class="file docutils literal notranslate"><span class="pre">__init__.py</span></code>. It can also contain modules and
508503
further subpackages.</p>
509504
</dd>
510-
<dt><code class="file docutils literal notranslate"><span class="pre">setup.py</span></code></dt><dd><p>This file is outside the package directory and is not
505+
<dt><code class="file docutils literal notranslate"><span class="pre">setup.py</span></code></dt><dd><p>This file is outside the package folder and is not
511506
actually a part of the package. The role of <code class="file docutils literal notranslate"><span class="pre">setup.py</span></code> will be
512507
covered in <a class="reference internal" href="#installable-packages"><span class="std std-numref">Section 2.6.2</span></a>.</p>
513508
</dd>
@@ -602,7 +597,7 @@ <h3><span class="section-number">2.6.3. </span>Installing a package from local c
602597
repository: the folder containing <code class="file docutils literal notranslate"><span class="pre">setup.py</span></code>. The option flag <code class="xref py py-obj docutils literal notranslate"><span class="pre">-e</span></code>
603598
tells pip to install the package in ‘editable’ mode. This means that
604599
instead of copying the package files to your venv’s Python packages
605-
directory, symbolic links will be created. This means that any changes
600+
folder, symbolic links will be created. This means that any changes
606601
that you make to your package will show up the next time the package
607602
is imported in a new Python process, avoiding the need to reinstall
608603
the package every time you change it.</p>
@@ -642,7 +637,7 @@ <h2><span class="section-number">2.7. </span>Testing frameworks<a class="headerl
642637
the practical details of including tests in your code here.</p>
643638
<p>There are a number of Python packages which support code testing. The
644639
concepts are largely similar so rather than get bogged down in the
645-
details of multiple frameworks, we will introduce <a class="reference external" href="https://docs.pytest.org/en/latest/index.html" title="(in pytest v6.3.0.dev67+g7585221d5)"><span class="xref std std-doc">pytest</span></a>, which is one of the most widely used.</p>
640+
details of multiple frameworks, we will introduce <a class="reference external" href="https://docs.pytest.org/en/latest/index.html" title="(in pytest v6.3.0.dev88+gf6529fd3a)"><span class="xref std std-doc">pytest</span></a>, which is one of the most widely used.</p>
646641
<div class="section" id="pytest-tests">
647642
<h3><span class="section-number">2.7.1. </span>Pytest tests<a class="headerlink" href="#pytest-tests" title="Permalink to this headline"></a></h3>
648643
<p>A Pytest test is simply a function whose name starts with <code class="xref py py-obj docutils literal notranslate"><span class="pre">test_</span></code>. In
@@ -682,7 +677,7 @@ <h3><span class="section-number">2.7.2. </span>Pytest files<a class="headerlink"
682677
</pre></div>
683678
</div>
684679
<p>These files don’t themselves form part of the package, instead they
685-
are usually gathered in a separate tests directory. For example:</p>
680+
are usually gathered in a separate tests folder. For example:</p>
686681
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>fibonacci
687682
├── fibonacci
688683
│ ├── __init__.py
@@ -762,7 +757,7 @@ <h3><span class="section-number">2.7.3. </span>Additional useful pytest tricks<a
762757
<div class="admonition note">
763758
<p class="admonition-title">Note</p>
764759
<p>The exercise repositories in this course will usually contain a
765-
<code class="file docutils literal notranslate"><span class="pre">tests</span></code> directory full of tests that check that you have correctly
760+
<code class="file docutils literal notranslate"><span class="pre">tests</span></code> folder full of tests that check that you have correctly
766761
implemented the week’s exercises. You should get in the habit of running the
767762
tests as you work through the exercises, as they are designed not just to
768763
pass if your code is correct, but to provide feedback as to what might be
@@ -832,9 +827,16 @@ <h2><span class="section-number">2.9. </span>Glossary<a class="headerlink" href=
832827
</div>
833828
<div class="section" id="exercises">
834829
<h2><span class="section-number">2.10. </span>Exercises<a class="headerlink" href="#exercises" title="Permalink to this headline"></a></h2>
835-
<div class="admonition note">
836-
<p class="admonition-title">Note</p>
837-
<p>Put a link to the first week quiz here.</p>
830+
<div class="sphinx-bs container pb-4 docutils">
831+
<div class="row docutils">
832+
<div class="d-flex col-lg-6 col-md-6 col-sm-6 col-xs-12 p-2 docutils">
833+
<div class="card w-100 quiz shadow docutils">
834+
<div class="card-body docutils">
835+
<p class="card-text"><a class="sphinx-bs btn text-wrap stretched-link reference external" href="https://bb.imperial.ac.uk/webapps/assessment/take/launchAssessment.jsp?course_id=_25965_1&amp;content_id=_2054443_1&amp;mode=cpview"><span>This week’s quiz</span></a></p>
836+
</div>
837+
</div>
838+
</div>
839+
</div>
838840
</div>
839841
<div class="proof proof-type-exercise" id="id5">
840842

@@ -947,7 +949,7 @@ <h2><span class="section-number">2.10. </span>Exercises<a class="headerlink" hre
947949
</div>
948950
<div class="footer" role="contentinfo">
949951
&#169; Copyright 2019-2020, David A. Ham.
950-
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.3.1.
952+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
951953
</div>
952954
</body>
953955
</html>

3_objects.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<script src="_static/jquery.js"></script>
1818
<script src="_static/underscore.js"></script>
1919
<script src="_static/doctools.js"></script>
20-
<script src="_static/language_data.js"></script>
2120
<script src="_static/proof.js"></script>
2221
<script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
2322
<link rel="index" title="Index" href="genindex.html" />
@@ -867,6 +866,17 @@ <h2><span class="section-number">3.5. </span>Glossary<a class="headerlink" href=
867866
</div>
868867
<div class="section" id="exercises">
869868
<h2><span class="section-number">3.6. </span>Exercises<a class="headerlink" href="#exercises" title="Permalink to this headline"></a></h2>
869+
<div class="sphinx-bs container pb-4 docutils">
870+
<div class="row docutils">
871+
<div class="d-flex col-lg-6 col-md-6 col-sm-6 col-xs-12 p-2 docutils">
872+
<div class="card w-100 quiz shadow docutils">
873+
<div class="card-body docutils">
874+
<p class="card-text"><a class="sphinx-bs btn text-wrap stretched-link reference external" href="https://bb.imperial.ac.uk/webapps/blackboard/content/launchAssessment.jsp?course_id=_23985_1&amp;content_id=_2049499_1&amp;mode=view"><span>This week’s quiz</span></a></p>
875+
</div>
876+
</div>
877+
</div>
878+
</div>
879+
</div>
870880
<p>Obtain the <a class="reference internal" href="not_released.html"><span class="doc">skeleton code for these exercises from GitHub classroom</span></a>.
871881
The skeleton code contains a <code class="xref py py-mod docutils literal notranslate"><span class="pre">polynomial</span></code> package with a version of
872882
the <code class="xref py py-class docutils literal notranslate"><span class="pre">Polynomial</span></code> class.</p>
@@ -944,7 +954,7 @@ <h2><span class="section-number">3.6. </span>Exercises<a class="headerlink" href
944954
</div>
945955
<div class="footer" role="contentinfo">
946956
&#169; Copyright 2019-2020, David A. Ham.
947-
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.3.1.
957+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
948958
</div>
949959
</body>
950960
</html>

0 commit comments

Comments
 (0)