Skip to content

Commit 9dc0e13

Browse files
committed
Website build
1 parent 1e212bb commit 9dc0e13

29 files changed

+1829
-888
lines changed

0_introduction.html

Lines changed: 20 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ <h3><span class="section-number">1.1.1. </span>The notes<a class="headerlink" hr
150150
new concepts than just the vocabulary, so don’t be tempted to skip reading the
151151
chapter and just jumping to the glossary!</p>
152152
<p>The chapters broadly alternate between introducing new programming concepts,
153-
such as <a class="reference internal" href="2_objects.html#objects"><span class="std std-ref">Objects and abstraction</span></a>, <span class="xref std std-ref">abstract data types</span>, or <a class="reference internal" href="6_inheritance.html#inheritance"><span class="std std-ref">Inheritance and composition</span></a>, and
154-
covering various aspects of the craft of programming, such as <span class="xref std std-ref">style</span>,
155-
<a class="reference internal" href="7_debugging.html#debugging"><span class="std std-ref">Debugging and testing</span></a>. In this way the course combines specific programming knowledge
153+
such as <a class="reference internal" href="2_objects.html#objects"><span class="std std-ref">objects</span></a>, <a class="reference internal" href="4_abstract_data_types.html#abstract-data-types"><span class="std std-ref">abstract data types</span></a>, or <a class="reference internal" href="6_inheritance.html#inheritance"><span class="std std-ref">inheritance</span></a>, and
154+
covering various aspects of the craft of programming, such as <a class="reference internal" href="6_inheritance.html#inheritance"><span class="std std-ref">style</span></a> and
155+
<a class="reference internal" href="7_debugging.html#debugging"><span class="std std-ref">debugging</span></a>. In this way the course combines specific programming knowledge
156156
with more general coding skills.</p>
157157
</div>
158158
<div class="section" id="the-videos">
@@ -180,15 +180,14 @@ <h3><span class="section-number">1.1.4. </span>The exercises<a class="headerlink
180180
writing code. The core of each week’s activities is therefore to put the new
181181
concepts and programming structures you’ve learned into practice. The
182182
programming exercises are given at the end of each chapter, just before the
183-
glossary. Each time there will be a skeleton code available from GitHub
184-
Classroom (we’ll introduce that in <code class="xref std std-numref docutils literal notranslate"><span class="pre">github_classroom</span></code>) which provides
185-
the starting point. Sometimes you might be asked to complete a piece of code
186-
while on other occasions you’ll need to write a whole Python module from
187-
scratch. Each set of exercises will come with a matching set of tests. These are
188-
small programs which check whether your code produces the correct responses to a
189-
range of inputs. Tests like this provide immediate feedback and enable you to
190-
know how you are doing without having to wait for code to be submitted and
191-
marked.</p>
183+
glossary. Each time there will be a skeleton code available from
184+
<a class="reference external" href="https://imperial-fons-computing.github.io/git.html#github-classroom-exercise" title="(in Installation instructions for FoNS v2020.0)"><span class="xref std std-ref">GitHub Classroom</span></a> which provides the starting
185+
point. Sometimes you might be asked to complete a piece of code while on other
186+
occasions you’ll need to write a whole Python module from scratch. Each set of
187+
exercises will come with a matching set of tests. These are small programs which
188+
check whether your code produces the correct responses to a range of inputs.
189+
Tests like this provide immediate feedback and enable you to know how you are
190+
doing without having to wait for code to be submitted and marked.</p>
192191
</div>
193192
<div class="section" id="getting-help">
194193
<h3><span class="section-number">1.1.5. </span>Getting help<a class="headerlink" href="#getting-help" title="Permalink to this headline"></a></h3>
@@ -221,81 +220,15 @@ <h2><span class="section-number">1.2. </span>Obtaining the right software tools<
221220
the instructions in this course will assume that this is what you are using.</p></li>
222221
</ol>
223222
</div></blockquote>
224-
<div class="section" id="windows">
225-
<h3><span class="section-number">1.2.1. </span>Windows<a class="headerlink" href="#windows" title="Permalink to this headline"></a></h3>
226-
<p>If you already have Python (3.6 or later) installed, for example because you
227-
have installed Anaconda then this is likely to be fine. Otherwise, Python for
228-
Windows can be obtained from the <a class="reference external" href="https://www.python.org/downloads/">official Python website</a>. Simply click on the download button and
229-
follow the instructions.</p>
230-
<p>Git for Windows can be downloaded from the <a class="reference external" href="https://git-scm.com/download/win">official Git website</a>.</p>
231-
<p>Visual Studio Code can be downloaded from <a class="reference external" href="https://code.visualstudio.com">Microsoft</a>.</p>
232-
</div>
233-
<div class="section" id="macos">
234-
<h3><span class="section-number">1.2.2. </span>MacOS<a class="headerlink" href="#macos" title="Permalink to this headline"></a></h3>
235-
<p>MacOS comes with Python3, but unfortunately it’s a broken version. Usually the
236-
best option is to install the package manager <a class="reference external" href="https://brew.sh">Homebrew</a> and
237-
use that to install Python (and Git). In order to do this, you’ll need to open a
238-
terminal. This is a program which comes with MacOS and enables you to run other
239-
programs by typing text commands. Press ⌘ + <code class="xref py py-obj docutils literal notranslate"><span class="pre">space</span></code> to open Spotlight Search,
240-
and type <code class="xref py py-obj docutils literal notranslate"><span class="pre">terminal</span></code> followed by return. Now copy the following line and paste it
241-
into the terminal:</p>
242-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">/bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)&quot;</span>
243-
</pre></div>
244-
</div>
245-
<p>and press the return key (⏎). Enter your Mac user password when asked and
246-
Homebrew will install. Next install Python 3 and git by typing the following in
247-
the terminal window:</p>
248-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">brew install python git</span>
249-
</pre></div>
250-
</div>
251-
<p>Once again, you finish by pressing the return key (⏎).</p>
252-
<p>To install Visual Studio Code, follow the instructions on the <a class="reference external" href="https://code.visualstudio.com/docs/setup/mac">Microsoft website</a>.</p>
253-
</div>
254-
<div class="section" id="linux">
255-
<h3><span class="section-number">1.2.3. </span>Linux<a class="headerlink" href="#linux" title="Permalink to this headline"></a></h3>
256-
<p>If you are running a fairly recent version of Linux then you almost certainly
257-
have a suitable Python installed already, and may also have git installed. Open
258-
a terminal (the way you do this depends a little on distribution, but if you’re
259-
a Linux user we’ll assume you know how to do this). At the terminal prompt run
260-
this command:</p>
261-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">python --version</span>
262-
</pre></div>
263-
</div>
264-
<p>so long as it shows at least version 3.6 you should be fine. If an earlier
265-
version is shown then you’ll need to either update your distribution, or search
266-
online for how to install a more recent Python. The method will vary from
267-
distribution to distribution so we can’t provide a general solution.</p>
268-
<p>Next, type the following command in the terminal:</p>
269-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">git --version</span>
270-
</pre></div>
271-
</div>
272-
<p>So long as this actually returns a version number everything is probably fine
273-
(we don’t need a particularly new git). If you get an error that git is not
274-
found then you’ll need to install it using the package manager for your
275-
distribution. For example, if you are running Ubuntu or another Debian-based
276-
distribution, the command would be:</p>
277-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">sudo apt-get install git</span>
278-
</pre></div>
279-
</div>
280-
<p>while on RedHat-distributions such as Fedora or CentOS, the command would be:</p>
281-
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">sudo dnf install git-all</span>
282-
</pre></div>
283-
</div>
284-
<p>On other distributions the command will be different. The simplest option is to
285-
search online for how to install git on your distribution.</p>
286-
<p>In order to install Visual Studio code you simply follow the instructions on the
287-
<a class="reference external" href="https://code.visualstudio.com/download">Microsoft website</a>.</p>
288-
</div>
289-
</div>
290-
<div class="section" id="working-with-revision-control">
291-
<h2><span class="section-number">1.3. </span>Working with revision control<a class="headerlink" href="#working-with-revision-control" title="Permalink to this headline"></a></h2>
292-
<p>In this section we’ll introduce the revision control system Git to the extent to
293-
which we’ll need it in this module, and show how to use it in conjunction with
294-
Visual Studio Code. This is not a comprehensive Git introduction, and readers
295-
are invited to take a little more time to undertake the excellent <a class="reference external" href="https://swcarpentry.github.io/git-novice/">Git tutorial</a> tutorial from <a class="reference external" href="https://software-carpentry.org">Software Carpentry</a>.</p>
296-
<div class="section" id="what-is-revision-control-and-why-should-you-care">
297-
<h3><span class="section-number">1.3.1. </span>What is revision control, and why should you care?<a class="headerlink" href="#what-is-revision-control-and-why-should-you-care" title="Permalink to this headline"></a></h3>
298-
<p>The best way to understand</p>
223+
<p>The Faculty of Natural Sciences at Imperial has centralised instructions for
224+
installing all of these tools, and we’ll follow those.</p>
225+
<div class="section" id="python">
226+
<h3><span class="section-number">1.2.1. </span>Python<a class="headerlink" href="#python" title="Permalink to this headline"></a></h3>
227+
<p>Follow the <a class="reference external" href="https://docs.python.org/3/library/python.html#python" title="(in Python v3.9)"><span class="xref std std-ref">FoNS Python instructions</span></a>. We will exclusively
228+
use <a class="reference external" href="https://imperial-fons-computing.github.io/python.html#python-virtual-environments" title="(in Installation instructions for FoNS v2020.0)"><span class="xref std std-ref">virtual environments</span></a> so for Mac and Linux users, it doesn’t matter at
229+
all whether you use Python from Anaconda or from another source. Mac users
230+
should note, though that the built-in Python will not do, so you should use
231+
either Homebrew or Anaconda.</p>
299232
</div>
300233
</div>
301234
</div>

1_programs_in_files.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ <h2><span class="section-number">2.7. </span>Testing frameworks<a class="headerl
620620
the practical details of including tests in your code here.</p>
621621
<p>There are a number of Python packages which support code testing. The
622622
concepts are largely similar so rather than get bogged down in the
623-
details of multiple frameworks, we will introduce <a class="reference external" href="https://docs.pytest.org/en/latest/index.html" title="(in pytest v0.1.dev266+g69419cb)"><span class="xref std std-doc">pytest</span></a>, which is one of the most widely used.</p>
623+
details of multiple frameworks, we will introduce <a class="reference external" href="https://docs.pytest.org/en/latest/index.html" title="(in pytest v0.1.dev280+gf453460)"><span class="xref std std-doc">pytest</span></a>, which is one of the most widely used.</p>
624624
<div class="section" id="pytest-tests">
625625
<h3><span class="section-number">2.7.1. </span>Pytest tests<a class="headerlink" href="#pytest-tests" title="Permalink to this headline"></a></h3>
626626
<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

2_objects.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ <h2><span class="section-number">3.6. </span>Glossary<a class="headerlink" href=
622622
<dt id="term-attribute">attribute</dt><dd><p>A value encapsulated in another object, such as a
623623
<a class="reference internal" href="#term-class"><span class="xref std std-term">class</span></a>. Attributes are accessed using dot syntax, so if
624624
<code class="xref py py-obj docutils literal notranslate"><span class="pre">b</span></code> is an attribute of <code class="xref py py-obj docutils literal notranslate"><span class="pre">a</span></code> then its value is accessed using the
625-
syntax <code class="xref py py-obj docutils literal notranslate"><span class="pre">a.b</span></code>.</p>
625+
syntax <code class="xref py py-obj docutils literal notranslate"><span class="pre">a.b</span></code>. <a class="reference internal" href="#term-method"><span class="xref std std-term">Methods</span></a> are a special case of attributes.</p>
626626
</dd>
627627
<dt id="term-class">class</dt><dt id="term-type">type</dt><dd><p>An abstraction defined by a set of possible values, and a set
628628
of operators valid for objects of that type. <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> and <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> are essentially synonymous, though
@@ -633,9 +633,15 @@ <h2><span class="section-number">3.6. </span>Glossary<a class="headerlink" href=
633633
responsible for setting up the object. The constructor modifies
634634
<code class="xref py py-obj docutils literal notranslate"><span class="pre">self</span></code> in place: constructors never return a value.</p>
635635
</dd>
636+
<dt id="term-data-attribute">data attribute</dt><dd><p>An <a class="reference internal" href="#term-attribute"><span class="xref std std-term">attribute</span></a> which is not a <a class="reference internal" href="#term-method"><span class="xref std std-term">method</span></a>. As the name
637+
suggests, these are used to store data in an object.</p>
638+
</dd>
636639
<dt id="term-encapsulation">encapsulation</dt><dd><p>The bundling up of attributes and methods into an object which
637640
can be dealt with as a single unit.</p>
638641
</dd>
642+
<dt id="term-infix-operator">infix operator</dt><dd><p>A mathematical operator whose symbol is written between its arguments.
643+
Examples include addition, subtraction, division and multiplication.</p>
644+
</dd>
639645
<dt id="term-instance">instance</dt><dd><p>An object of a particular class. <code class="xref py py-obj docutils literal notranslate"><span class="pre">a</span></code> is an instance of
640646
<code class="xref py py-class docutils literal notranslate"><span class="pre">MyClass</span></code> means that <code class="xref py py-obj docutils literal notranslate"><span class="pre">a</span></code> has class <code class="xref py py-obj docutils literal notranslate"><span class="pre">MyClass</span></code>. We will
641647
return to this concept when we learn about <a class="reference internal" href="6_inheritance.html#inheritance"><span class="std std-ref">inheritance</span></a>.</p>

0 commit comments

Comments
 (0)