Skip to content

Commit e82a480

Browse files
committed
Website build
1 parent c9e6520 commit e82a480

37 files changed

+113
-85
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: 6dc77e83c8ab02d3fb6e6302ff875ff3
3+
config: 18c7289200738997ec7febc99c4d2e0a
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

10_trees_and_directed_acyclic_graphs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>10. Trees and directed acyclic graphs &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
8+
<title>10. Trees and directed acyclic graphs &#8212; Object oriented programming in Python for mathematicians 2021.0 documentation</title>
99
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1010
<link rel="stylesheet" href="_static/fenics.css" type="text/css" />
1111
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
@@ -1242,7 +1242,7 @@ <h2><span class="section-number">10.8. </span>Exercises<a class="headerlink" hre
12421242
<div class="clearer"></div>
12431243
</div>
12441244
<div class="footer" role="contentinfo">
1245-
&#169; Copyright 2019-2020, David A. Ham.
1245+
&#169; Copyright 2019-2021, David A. Ham.
12461246
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
12471247
</div>
12481248
</body>

11_further_object-oriented_features.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>11. Further object-oriented features &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
8+
<title>11. Further object-oriented features &#8212; Object oriented programming in Python for mathematicians 2021.0 documentation</title>
99
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1010
<link rel="stylesheet" href="_static/fenics.css" type="text/css" />
1111
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
@@ -81,7 +81,7 @@ <h3><span class="section-number">11.3.1. </span>Glossary<a class="headerlink" hr
8181
<div class="clearer"></div>
8282
</div>
8383
<div class="footer" role="contentinfo">
84-
&#169; Copyright 2019-2020, David A. Ham.
84+
&#169; Copyright 2019-2021, David A. Ham.
8585
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
8686
</div>
8787
</body>

1_introduction.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>1. Introduction: abstraction in mathematics and programming &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
8+
<title>1. Introduction: abstraction in mathematics and programming &#8212; Object oriented programming in Python for mathematicians 2021.0 documentation</title>
99
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1010
<link rel="stylesheet" href="_static/fenics.css" type="text/css" />
1111
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
@@ -642,7 +642,7 @@ <h2><span class="section-number">1.4. </span>Exercises<a class="headerlink" href
642642
<div class="clearer"></div>
643643
</div>
644644
<div class="footer" role="contentinfo">
645-
&#169; Copyright 2019-2020, David A. Ham.
645+
&#169; Copyright 2019-2021, David A. Ham.
646646
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
647647
</div>
648648
</body>

2_programs_in_files.html

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>2. Programs in files &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
8+
<title>2. Programs in files &#8212; Object oriented programming in Python for mathematicians 2021.0 documentation</title>
99
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1010
<link rel="stylesheet" href="_static/fenics.css" type="text/css" />
1111
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
@@ -637,7 +637,11 @@ <h2><span class="section-number">2.7. </span>Testing frameworks<a class="headerl
637637
the practical details of including tests in your code here.</p>
638638
<p>There are a number of Python packages which support code testing. The
639639
concepts are largely similar so rather than get bogged down in the
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>
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. Pytest is simply a Python
641+
package, so you can install it into your current environment using:</p>
642+
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> python3 -m pip install pytest
643+
</pre></div>
644+
</div>
641645
<div class="section" id="pytest-tests">
642646
<h3><span class="section-number">2.7.1. </span>Pytest tests<a class="headerlink" href="#pytest-tests" title="Permalink to this headline"></a></h3>
643647
<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
@@ -689,7 +693,7 @@ <h3><span class="section-number">2.7.2. </span>Pytest files<a class="headerlink"
689693
</div>
690694
<p>We can then invoke the tests from the shell:</p>
691695
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> <span class="nb">cd</span> fibonacci
692-
<span class="gp">$</span> py.test tests
696+
<span class="gp">$</span> pytest tests
693697
<span class="go">========================== test session starts ===========================</span>
694698
<span class="go">platform darwin -- Python 3.7.7, pytest-5.4.1, py-1.8.1, pluggy-0.13.1</span>
695699
<span class="go">rootdir: /Users/dham/docs/object-oriented-programming, inifile: setup.cfg</span>
@@ -703,7 +707,7 @@ <h3><span class="section-number">2.7.2. </span>Pytest files<a class="headerlink"
703707
<p>The single dot indicates that we passed the one test in
704708
<code class="xref py py-obj docutils literal notranslate"><span class="pre">test_fibonacci.py</span></code>. Had we made an error in our code, we would
705709
instead see something like:</p>
706-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> py.test tests
710+
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> pytest tests
707711
<span class="go">========================== test session starts ===========================</span>
708712
<span class="go">platform darwin -- Python 3.7.7, pytest-5.4.1, py-1.8.1, pluggy-0.13.1</span>
709713
<span class="go">rootdir: /Users/dham/docs/object-oriented-programming, inifile: setup.cfg</span>
@@ -734,20 +738,20 @@ <h3><span class="section-number">2.7.2. </span>Pytest files<a class="headerlink"
734738
<div class="section" id="additional-useful-pytest-tricks">
735739
<h3><span class="section-number">2.7.3. </span>Additional useful pytest tricks<a class="headerlink" href="#additional-useful-pytest-tricks" title="Permalink to this headline"></a></h3>
736740
<p>It can be useful to run a specific test file, which is achieved simply by naming
737-
that file as the argument to py.test. For example:</p>
738-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> py.test tests/test_fibonacci.py
741+
that file as the argument to pytest. For example:</p>
742+
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> pytest tests/test_fibonacci.py
739743
</pre></div>
740744
</div>
741745
<p>It is even possible to select an individual test to run, using a double colon
742746
<code class="xref py py-obj docutils literal notranslate"><span class="pre">::</span></code> followed by the test name:</p>
743-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> py.test tests/test_fibonacci.py::test_fibonacci_values
747+
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> pytest tests/test_fibonacci.py::test_fibonacci_values
744748
</pre></div>
745749
</div>
746750
<p>Often if one test fails then the same problem in your code will cause a whole
747751
series of tests to fail, resulting in a very long list of error messages which
748752
is hard to read. A useful tool in this circumstance is the <code class="xref py py-obj docutils literal notranslate"><span class="pre">-x</span></code> option, which
749753
tells pytest to stop after the first test fail. For example:</p>
750-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> py.test -x tests
754+
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> pytest -x tests
751755
</pre></div>
752756
</div>
753757
<p>The tests are usually arranged in increasing order of sophistication, so the
@@ -889,7 +893,12 @@ <h2><span class="section-number">2.10. </span>Exercises<a class="headerlink" hre
889893
returns <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(in Python v3.9)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(in Python v3.9)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a> depending on whether or not the argument is prime.
890894
There is no need to be sophisticated in the algorithm used to check for
891895
primeness, simply checking whether the number is zero modulo any of the
892-
integers less than its square root will be fine.</p>
896+
integers less than its square root will be fine. Test your code by running
897+
the following in your week 2 exercise repository:</p>
898+
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> pytest tests/test__exercise_2_4.py
899+
</pre></div>
900+
</div>
901+
<p>Then push your code to GitHub and check that the tests pass there too.</p>
893902
<div class="admonition hint">
894903
<p class="admonition-title">Hint</p>
895904
<p>The Python modulo operator is <code class="xref py py-obj docutils literal notranslate"><span class="pre">%</span></code>. For example:</p>
@@ -915,6 +924,9 @@ <h2><span class="section-number">2.10. </span>Exercises<a class="headerlink" hre
915924
<p>Following <a class="reference internal" href="#installable-packages"><span class="std std-numref">Section 2.6.2</span></a>, create a <code class="file docutils literal notranslate"><span class="pre">setup.py</span></code> file in
916925
your exercise repository, so that the <code class="xref py py-mod docutils literal notranslate"><span class="pre">math_utils</span></code> <a class="reference internal" href="#term-package"><span class="xref std std-term">package</span></a> is
917926
installable.</p>
927+
<p>Pytest can’t easily test installability for you, so once you have managed to
928+
install your package yourself, commit and push to github to check that the
929+
tests there are also able to install your package.</p>
918930
</div></div><div class="proof proof-type-exercise" id="id10">
919931

920932
<div class="proof-title">
@@ -948,7 +960,7 @@ <h2><span class="section-number">2.10. </span>Exercises<a class="headerlink" hre
948960
<div class="clearer"></div>
949961
</div>
950962
<div class="footer" role="contentinfo">
951-
&#169; Copyright 2019-2020, David A. Ham.
963+
&#169; Copyright 2019-2021, David A. Ham.
952964
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
953965
</div>
954966
</body>

3_objects.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>3. Objects and abstraction &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
8+
<title>3. Objects and abstraction &#8212; Object oriented programming in Python for mathematicians 2021.0 documentation</title>
99
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1010
<link rel="stylesheet" href="_static/fenics.css" type="text/css" />
1111
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
@@ -953,7 +953,7 @@ <h2><span class="section-number">3.6. </span>Exercises<a class="headerlink" href
953953
<div class="clearer"></div>
954954
</div>
955955
<div class="footer" role="contentinfo">
956-
&#169; Copyright 2019-2020, David A. Ham.
956+
&#169; Copyright 2019-2021, David A. Ham.
957957
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
958958
</div>
959959
</body>

4_style.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>4. A matter of style &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
8+
<title>4. A matter of style &#8212; Object oriented programming in Python for mathematicians 2021.0 documentation</title>
99
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1010
<link rel="stylesheet" href="_static/fenics.css" type="text/css" />
1111
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
@@ -983,7 +983,7 @@ <h2><span class="section-number">4.9. </span>Exercises<a class="headerlink" href
983983
<div class="clearer"></div>
984984
</div>
985985
<div class="footer" role="contentinfo">
986-
&#169; Copyright 2019-2020, David A. Ham.
986+
&#169; Copyright 2019-2021, David A. Ham.
987987
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
988988
</div>
989989
</body>

5_abstract_data_types.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>5. Abstract data types &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
8+
<title>5. Abstract data types &#8212; Object oriented programming in Python for mathematicians 2021.0 documentation</title>
99
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1010
<link rel="stylesheet" href="_static/fenics.css" type="text/css" />
1111
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
@@ -172,9 +172,9 @@
172172
<rect fill="rgb(255,165,0)" height="30" stroke="rgb(0,0,0)" width="128" x="640" y="40" />
173173
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="30" x="704.0" y="61">Stack</text>
174174
<rect fill="rgb(255,255,255)" height="30" stroke="rgb(0,0,0)" width="128" x="640" y="110" />
175-
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="12" x="704.0" y="131">12</text>
175+
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="12" x="704.0" y="131">24</text>
176176
<rect fill="rgb(255,255,255)" height="30" stroke="rgb(0,0,0)" width="128" x="640" y="180" />
177-
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="12" x="704.0" y="201">57</text>
177+
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="12" x="704.0" y="201">12</text>
178178
<rect fill="rgb(46,139,87)" height="30" stroke="rgb(0,0,0)" width="128" x="64" y="40" />
179179
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="42" x="128.0" y="61">push 24</text>
180180
<rect fill="rgb(46,139,87)" height="30" stroke="rgb(0,0,0)" width="128" x="64" y="250" />
@@ -1180,7 +1180,7 @@ <h2><span class="section-number">5.9. </span>Exercises<a class="headerlink" href
11801180
<div class="clearer"></div>
11811181
</div>
11821182
<div class="footer" role="contentinfo">
1183-
&#169; Copyright 2019-2020, David A. Ham.
1183+
&#169; Copyright 2019-2021, David A. Ham.
11841184
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
11851185
</div>
11861186
</body>

6_exceptions.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>6. Errors and exceptions &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
8+
<title>6. Errors and exceptions &#8212; Object oriented programming in Python for mathematicians 2021.0 documentation</title>
99
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1010
<link rel="stylesheet" href="_static/fenics.css" type="text/css" />
1111
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
@@ -790,7 +790,7 @@ <h2><span class="section-number">6.8. </span>Exercises<a class="headerlink" href
790790
<div class="clearer"></div>
791791
</div>
792792
<div class="footer" role="contentinfo">
793-
&#169; Copyright 2019-2020, David A. Ham.
793+
&#169; Copyright 2019-2021, David A. Ham.
794794
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
795795
</div>
796796
</body>

7_midterm.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>7. Midterm test preparation &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
8+
<title>7. Midterm test preparation &#8212; Object oriented programming in Python for mathematicians 2021.0 documentation</title>
99
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1010
<link rel="stylesheet" href="_static/fenics.css" type="text/css" />
1111
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
@@ -166,7 +166,7 @@ <h2><span class="section-number">7.5. </span>Exercises<a class="headerlink" href
166166
<div class="clearer"></div>
167167
</div>
168168
<div class="footer" role="contentinfo">
169-
&#169; Copyright 2019-2020, David A. Ham.
169+
&#169; Copyright 2019-2021, David A. Ham.
170170
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3.
171171
</div>
172172
</body>

0 commit comments

Comments
 (0)