Skip to content

Commit 4cfa19e

Browse files
committed
Website build
1 parent 8c27da0 commit 4cfa19e

File tree

8 files changed

+292
-11
lines changed

8 files changed

+292
-11
lines changed

1_programs_in_files.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ <h3><span class="section-number">2.2.3. </span>When not to use scripts<a class="
210210
</pre></div>
211211
</div>
212212
<p>If I now run IPython in the folder containing my new file
213-
<code class="xref py py-obj docutils literal notranslate"><span class="pre">fibonacci.py</span></code> then I will be able to import the <code class="xref py py-mod docutils literal notranslate"><span class="pre">fibonacci</span></code>
213+
<code class="xref py py-obj docutils literal notranslate"><span class="pre">fibonacci.py</span></code> then I will be able to import the <a class="reference internal" href="fibonacci.html#module-fibonacci" title="fibonacci"><code class="xref py py-mod docutils literal notranslate"><span class="pre">fibonacci</span></code></a>
214214
module, and use the function <code class="xref py py-func docutils literal notranslate"><span class="pre">fib()</span></code>:</p>
215215
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="gp">In [1]: </span><span class="kn">import</span> <span class="nn">fibonacci</span>
216216
<span class="gp">In [2]: </span><span class="n">fibonacci</span><span class="o">.</span><span class="n">fib</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
@@ -224,10 +224,10 @@ <h3><span class="section-number">2.2.3. </span>When not to use scripts<a class="
224224
programs.</p>
225225
<div class="section" id="importing-and-namespaces">
226226
<h3><span class="section-number">2.3.1. </span>Importing and namespaces<a class="headerlink" href="#importing-and-namespaces" title="Permalink to this headline"></a></h3>
227-
<p>When we imported the module <code class="xref py py-mod docutils literal notranslate"><span class="pre">fibonacci</span></code>, this created the name
228-
<code class="xref py py-obj docutils literal notranslate"><span class="pre">fibonacci</span></code> in the current environment. The code in <code class="xref py py-obj docutils literal notranslate"><span class="pre">fibonacci.py</span></code> is
227+
<p>When we imported the module <a class="reference internal" href="fibonacci.html#module-fibonacci" title="fibonacci"><code class="xref py py-mod docutils literal notranslate"><span class="pre">fibonacci</span></code></a>, this created the name
228+
<a class="reference internal" href="fibonacci.html#module-fibonacci" title="fibonacci"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fibonacci</span></code></a> in the current environment. The code in <code class="xref py py-obj docutils literal notranslate"><span class="pre">fibonacci.py</span></code> is
229229
then run, and any names defined in that code (such as the function
230-
<code class="xref py py-func docutils literal notranslate"><span class="pre">fib()</span></code>) are defined within the <a class="reference internal" href="#term-namespace"><span class="xref std std-term">namespace</span></a> <code class="xref py py-obj docutils literal notranslate"><span class="pre">fibonacci</span></code>. As
230+
<code class="xref py py-func docutils literal notranslate"><span class="pre">fib()</span></code>) are defined within the <a class="reference internal" href="#term-namespace"><span class="xref std std-term">namespace</span></a> <a class="reference internal" href="fibonacci.html#module-fibonacci" title="fibonacci"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fibonacci</span></code></a>. As
231231
we begin to compose together code from different parts of mathematics,
232232
the ability to separate identically named but different objects from
233233
each other is essential. For example, Python has a module containing

_modules/fibonacci/fibonacci.html

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
2+
<!DOCTYPE html>
3+
4+
<html>
5+
<head>
6+
<meta charset="utf-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>fibonacci.fibonacci &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
9+
<link rel="stylesheet" href="../../_static/fenics.css" type="text/css" />
10+
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
11+
<link rel="stylesheet" type="text/css" href="../../_static/proof.css" />
12+
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
13+
<script id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
14+
<script src="../../_static/jquery.js"></script>
15+
<script src="../../_static/underscore.js"></script>
16+
<script src="../../_static/doctools.js"></script>
17+
<script src="../../_static/language_data.js"></script>
18+
<script src="../../_static/proof.js"></script>
19+
<script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
20+
<link rel="index" title="Index" href="../../genindex.html" />
21+
<link rel="search" title="Search" href="../../search.html" />
22+
<!--[if lte IE 6]>
23+
<link rel="stylesheet" href="../../_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
24+
<![endif]-->
25+
26+
<link rel="stylesheet" href="../../_static/featured.css">
27+
28+
29+
<link rel="shortcut icon" href="../../_static/icon.ico" />
30+
31+
32+
</head><body>
33+
<div class="wrapper">
34+
<a href="../../index.html"><img src="../../_static/banner.png" width="900px" alt="FInAT Project Banner" /></a>
35+
<div id="access">
36+
<div class="menu">
37+
<ul>
38+
<li class="page_item"><a href="https://github.com/finite-element/finite-element-course" title="GitHub">GitHub</a></li>
39+
</ul>
40+
</div><!-- .menu -->
41+
</div><!-- #access -->
42+
</div><!-- #wrapper -->
43+
44+
45+
<div class="document">
46+
<div class="documentwrapper">
47+
<div class="bodywrapper">
48+
<div class="body" role="main">
49+
50+
<h1>Source code for fibonacci.fibonacci</h1><div class="highlight"><pre>
51+
<span></span><span class="kn">from</span> <span class="nn">numbers</span> <span class="kn">import</span> <span class="n">Integral</span>
52+
53+
54+
<div class="viewcode-block" id="fib"><a class="viewcode-back" href="../../fibonacci.html#fibonacci.fibonacci.fib">[docs]</a><span class="k">def</span> <span class="nf">fib</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
55+
<span class="sd">&quot;&quot;&quot;Return the n-th Fibonacci number.&quot;&quot;&quot;</span>
56+
<span class="k">if</span> <span class="n">n</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
57+
<span class="k">return</span> <span class="mi">0</span>
58+
<span class="k">elif</span> <span class="n">n</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
59+
<span class="k">return</span> <span class="mi">1</span>
60+
<span class="k">else</span><span class="p">:</span>
61+
<span class="k">return</span> <span class="n">fib</span><span class="p">(</span><span class="n">n</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="n">fib</span><span class="p">(</span><span class="n">n</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span></div>
62+
63+
64+
<div class="viewcode-block" id="typesafe_fib"><a class="viewcode-back" href="../../fibonacci.html#fibonacci.fibonacci.typesafe_fib">[docs]</a><span class="k">def</span> <span class="nf">typesafe_fib</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
65+
<span class="sd">&quot;&quot;&quot;Return the n-th Fibonacci number, raising an exception if a</span>
66+
<span class="sd"> non-integer is passed as n.&quot;&quot;&quot;</span>
67+
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">Integral</span><span class="p">):</span>
68+
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;fib expects an integer, not a </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
69+
<span class="k">if</span> <span class="n">n</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
70+
<span class="k">return</span> <span class="mi">0</span>
71+
<span class="k">elif</span> <span class="n">n</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
72+
<span class="k">return</span> <span class="mi">1</span>
73+
<span class="k">else</span><span class="p">:</span>
74+
<span class="k">return</span> <span class="n">fib</span><span class="p">(</span><span class="n">n</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="n">fib</span><span class="p">(</span><span class="n">n</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span></div>
75+
</pre></div>
76+
77+
<div class="clearer"></div>
78+
</div>
79+
</div>
80+
</div>
81+
<div class="clearer"></div>
82+
</div>
83+
<div class="footer" role="contentinfo">
84+
&#169; Copyright 2019-2020, David A. Ham.
85+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
86+
</div>
87+
</body>
88+
</html>

_modules/index.html

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
<!DOCTYPE html>
3+
4+
<html>
5+
<head>
6+
<meta charset="utf-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Overview: module code &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
9+
<link rel="stylesheet" href="../_static/fenics.css" type="text/css" />
10+
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
11+
<link rel="stylesheet" type="text/css" href="../_static/proof.css" />
12+
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />
13+
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
14+
<script src="../_static/jquery.js"></script>
15+
<script src="../_static/underscore.js"></script>
16+
<script src="../_static/doctools.js"></script>
17+
<script src="../_static/language_data.js"></script>
18+
<script src="../_static/proof.js"></script>
19+
<script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
20+
<link rel="index" title="Index" href="../genindex.html" />
21+
<link rel="search" title="Search" href="../search.html" />
22+
<!--[if lte IE 6]>
23+
<link rel="stylesheet" href="../_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
24+
<![endif]-->
25+
26+
<link rel="stylesheet" href="../_static/featured.css">
27+
28+
29+
<link rel="shortcut icon" href="../_static/icon.ico" />
30+
31+
32+
</head><body>
33+
<div class="wrapper">
34+
<a href="../index.html"><img src="../_static/banner.png" width="900px" alt="FInAT Project Banner" /></a>
35+
<div id="access">
36+
<div class="menu">
37+
<ul>
38+
<li class="page_item"><a href="https://github.com/finite-element/finite-element-course" title="GitHub">GitHub</a></li>
39+
</ul>
40+
</div><!-- .menu -->
41+
</div><!-- #access -->
42+
</div><!-- #wrapper -->
43+
44+
45+
<div class="document">
46+
<div class="documentwrapper">
47+
<div class="bodywrapper">
48+
<div class="body" role="main">
49+
50+
<h1>All modules for which code is available</h1>
51+
<ul><li><a href="fibonacci/fibonacci.html">fibonacci.fibonacci</a></li>
52+
</ul>
53+
54+
<div class="clearer"></div>
55+
</div>
56+
</div>
57+
</div>
58+
<div class="clearer"></div>
59+
</div>
60+
<div class="footer" role="contentinfo">
61+
&#169; Copyright 2019-2020, David A. Ham.
62+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
63+
</div>
64+
</body>
65+
</html>

fibonacci.html

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,24 @@ <h1>fibonacci package<a class="headerlink" href="#fibonacci-package" title="Perm
5252
<div class="section" id="submodules">
5353
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline"></a></h2>
5454
</div>
55-
<div class="section" id="fibonacci-fibonacci-module">
56-
<h2>fibonacci.fibonacci module<a class="headerlink" href="#fibonacci-fibonacci-module" title="Permalink to this headline"></a></h2>
55+
<div class="section" id="module-fibonacci.fibonacci">
56+
<span id="fibonacci-fibonacci-module"></span><h2>fibonacci.fibonacci module<a class="headerlink" href="#module-fibonacci.fibonacci" title="Permalink to this headline"></a></h2>
57+
<dl class="py function">
58+
<dt id="fibonacci.fibonacci.fib">
59+
<code class="sig-prename descclassname">fibonacci.fibonacci.</code><code class="sig-name descname">fib</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/fibonacci/fibonacci.html#fib"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#fibonacci.fibonacci.fib" title="Permalink to this definition"></a></dt>
60+
<dd><p>Return the n-th Fibonacci number.</p>
61+
</dd></dl>
62+
63+
<dl class="py function">
64+
<dt id="fibonacci.fibonacci.typesafe_fib">
65+
<code class="sig-prename descclassname">fibonacci.fibonacci.</code><code class="sig-name descname">typesafe_fib</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/fibonacci/fibonacci.html#typesafe_fib"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#fibonacci.fibonacci.typesafe_fib" title="Permalink to this definition"></a></dt>
66+
<dd><p>Return the n-th Fibonacci number, raising an exception if a
67+
non-integer is passed as n.</p>
68+
</dd></dl>
69+
5770
</div>
58-
<div class="section" id="module-contents">
59-
<h2>Module contents<a class="headerlink" href="#module-contents" title="Permalink to this headline"></a></h2>
71+
<div class="section" id="module-fibonacci">
72+
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-fibonacci" title="Permalink to this headline"></a></h2>
6073
</div>
6174
</div>
6275

genindex.html

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,24 @@ <h2 id="E">E</h2>
138138
<h2 id="F">F</h2>
139139
<table style="width: 100%" class="indextable genindextable"><tr>
140140
<td style="width: 33%; vertical-align: top;"><ul>
141+
<li><a href="fibonacci.html#fibonacci.fibonacci.fib">fib() (in module fibonacci.fibonacci)</a>
142+
</li>
143+
<li>
144+
fibonacci
145+
146+
<ul>
147+
<li><a href="fibonacci.html#module-fibonacci">module</a>
148+
</li>
149+
</ul></li>
150+
</ul></td>
151+
<td style="width: 33%; vertical-align: top;"><ul>
152+
<li>
153+
fibonacci.fibonacci
154+
155+
<ul>
156+
<li><a href="fibonacci.html#module-fibonacci.fibonacci">module</a>
157+
</li>
158+
</ul></li>
141159
<li><a href="4_abstract_data_types.html#term-FIFO-first-in-first-out"><strong>FIFO (first in, first out)</strong></a>
142160
</li>
143161
</ul></td>
@@ -174,12 +192,18 @@ <h2 id="M">M</h2>
174192
</li>
175193
<li><a href="2_objects.html#term-method"><strong>method</strong></a>
176194
</li>
177-
</ul></td>
178-
<td style="width: 33%; vertical-align: top;"><ul>
179195
<li><a href="3_style.html#term-modularity"><strong>modularity</strong></a>
180196
</li>
197+
</ul></td>
198+
<td style="width: 33%; vertical-align: top;"><ul>
181199
<li><a href="1_programs_in_files.html#term-module"><strong>module</strong></a>
200+
201+
<ul>
202+
<li><a href="fibonacci.html#module-fibonacci">fibonacci</a>
182203
</li>
204+
<li><a href="fibonacci.html#module-fibonacci.fibonacci">fibonacci.fibonacci</a>
205+
</li>
206+
</ul></li>
183207
</ul></td>
184208
</tr></table>
185209

@@ -253,6 +277,8 @@ <h2 id="T">T</h2>
253277
</ul></td>
254278
<td style="width: 33%; vertical-align: top;"><ul>
255279
<li><a href="2_objects.html#term-type"><strong>type</strong></a>
280+
</li>
281+
<li><a href="fibonacci.html#fibonacci.fibonacci.typesafe_fib">typesafe_fib() (in module fibonacci.fibonacci)</a>
256282
</li>
257283
</ul></td>
258284
</tr></table>

objects.inv

39 Bytes
Binary file not shown.

py-modindex.html

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
<!DOCTYPE html>
3+
4+
<html>
5+
<head>
6+
<meta charset="utf-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Python Module Index &#8212; Object oriented programming in Python for mathematicians 2020.0 documentation</title>
9+
<link rel="stylesheet" href="_static/fenics.css" type="text/css" />
10+
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
11+
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
12+
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
13+
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
14+
<script src="_static/jquery.js"></script>
15+
<script src="_static/underscore.js"></script>
16+
<script src="_static/doctools.js"></script>
17+
<script src="_static/language_data.js"></script>
18+
<script src="_static/proof.js"></script>
19+
<script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
20+
<link rel="index" title="Index" href="genindex.html" />
21+
<link rel="search" title="Search" href="search.html" />
22+
23+
<!--[if lte IE 6]>
24+
<link rel="stylesheet" href="_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
25+
<![endif]-->
26+
27+
<link rel="stylesheet" href="_static/featured.css">
28+
29+
30+
<link rel="shortcut icon" href="_static/icon.ico" />
31+
32+
33+
34+
35+
</head><body>
36+
<div class="wrapper">
37+
<a href="index.html"><img src="_static/banner.png" width="900px" alt="FInAT Project Banner" /></a>
38+
<div id="access">
39+
<div class="menu">
40+
<ul>
41+
<li class="page_item"><a href="https://github.com/finite-element/finite-element-course" title="GitHub">GitHub</a></li>
42+
</ul>
43+
</div><!-- .menu -->
44+
</div><!-- #access -->
45+
</div><!-- #wrapper -->
46+
47+
48+
<div class="document">
49+
<div class="documentwrapper">
50+
<div class="bodywrapper">
51+
<div class="body" role="main">
52+
53+
54+
<h1>Python Module Index</h1>
55+
56+
<div class="modindex-jumpbox">
57+
<a href="#cap-f"><strong>f</strong></a>
58+
</div>
59+
60+
<table class="indextable modindextable">
61+
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
62+
<tr class="cap" id="cap-f"><td></td><td>
63+
<strong>f</strong></td><td></td></tr>
64+
<tr>
65+
<td><img src="_static/minus.png" class="toggler"
66+
id="toggle-1" style="display: none" alt="-" /></td>
67+
<td>
68+
<a href="fibonacci.html#module-fibonacci"><code class="xref">fibonacci</code></a></td><td>
69+
<em></em></td></tr>
70+
<tr class="cg-1">
71+
<td></td>
72+
<td>&#160;&#160;&#160;
73+
<a href="fibonacci.html#module-fibonacci.fibonacci"><code class="xref">fibonacci.fibonacci</code></a></td><td>
74+
<em></em></td></tr>
75+
</table>
76+
77+
78+
<div class="clearer"></div>
79+
</div>
80+
</div>
81+
</div>
82+
<div class="clearer"></div>
83+
</div>
84+
<div class="footer" role="contentinfo">
85+
&#169; Copyright 2019-2020, David A. Ham.
86+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
87+
</div>
88+
</body>
89+
</html>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)