-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtools.html
More file actions
195 lines (183 loc) · 11.8 KB
/
tools.html
File metadata and controls
195 lines (183 loc) · 11.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Computational tools — Computational linear algebra course 2023.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/fenics.css?v=16c5e00f" />
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
<script src="_static/documentation_options.js?v=f1ab3ab9"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/proof.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<!--[if lte IE 6]>
<link rel="stylesheet" href="_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
<![endif]-->
<link rel="stylesheet" href="_static/featured.css">
<link rel="shortcut icon" href="_static/icon.ico" />
</head><body>
<div class="wrapper">
<a href="index.html"><img src="_static/banner.png" width="900px" alt="Project Banner" /></a>
<div id="access">
<div class="menu">
<ul>
<li class="page_item"><a href="https://github.com/Computational-Linear-Algebra-Course/computational-linear-algebra-course" title="GitHub">GitHub</a></li>
</ul>
</div><!-- .menu -->
</div><!-- #access -->
</div><!-- #wrapper -->
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="computational-tools">
<h1>Computational tools<a class="headerlink" href="#computational-tools" title="Link to this heading">¶</a></h1>
<section id="access-to-computers">
<h2>Access to computers<a class="headerlink" href="#access-to-computers" title="Link to this heading">¶</a></h2>
<p>You’ll need access to a suitable computer for the implementation
work. You can either use the machines in the maths department labs, or
you can use your own laptop running Windows, Linux, or macOS. The
core requirements are Python 3, git, and a Python-aware text editor.</p>
<section id="using-the-windows-machines-in-the-computer-labs">
<h3>Using the Windows machines in the computer labs<a class="headerlink" href="#using-the-windows-machines-in-the-computer-labs" title="Link to this heading">¶</a></h3>
<p>(Not currently available under covid19 restrictions.)</p>
<p>Imperial’s lab machines have the software you need installed, in some
cases via the <cite>Software Hub</cite>. To get started, double click the
<cite>Software Hub</cite> icon on the desktop or <a class="reference external" href="https://softwarehub.imperial.ac.uk/">click here</a>. From there you can run <cite>git</cite>,
which will give you a terminal to run git and Python commands, and
<cite>atom</cite>, which will provide you with an editor.</p>
</section>
<section id="using-your-own-machine">
<h3>Using your own machine<a class="headerlink" href="#using-your-own-machine" title="Link to this heading">¶</a></h3>
<p>Up to date information on how to install Python, Git, etc on a
Windows, Linux or Mac machine is available <a class="reference external" href="https://imperial-fons-computing.github.io/">at this location</a>.</p>
</section>
<section id="editing-code">
<h3>Editing code<a class="headerlink" href="#editing-code" title="Link to this heading">¶</a></h3>
<p>In order to write the code required for the implementation exercise,
you’ll need to use a Python-aware text editor. There are many such
editors available and you can use any you like. One good option is
called <cite>Visual Studio Code</cite>, with installation instructions <a class="reference external" href="https://imperial-fons-computing.github.io/vscode.html">here</a>.</p>
</section>
</section>
<section id="the-command-line">
<h2>The command line<a class="headerlink" href="#the-command-line" title="Link to this heading">¶</a></h2>
<p>A lot of the routine activity involved in this module revolves around
executing commands on the Bash command line. For example you use the
command line to work with the revision control system. If you’re not
familiar with the Linux command line, then a brief guide <a class="reference external" href="http://www.tuxarena.com/static/intro_linux_cli.php">is available
here</a>. That
guide focusses on the Bash shell, which is the one we will use.</p>
</section>
<section id="python">
<h2>Python<a class="headerlink" href="#python" title="Link to this heading">¶</a></h2>
<p>Your implementation will be written in Python based on a code skeleton
provided. This means that you’ll need a certain familiarity with the
Python language. But don’t panic! Python is a very easy language to
work with. This module will use Python 3.</p>
<p>If you haven’t done any Python before, then go through <a class="reference external" href="https://docs.python.org/3/tutorial/index.html">the official
Python tutorial</a>
(Sections 1 to 5 are a good start).</p>
<p>The Matlab-like array features of Python are provided by <a class="reference external" href="http://www.numpy.org/">Numpy</a> for which there is a <a class="reference external" href="http://wiki.scipy.org/Tentative_NumPy_Tutorial">helpful tutorial</a>. There is also a
handy <a class="reference external" href="http://wiki.scipy.org/NumPy_for_Matlab_Users">guide for Matlab users</a>. In that context, the
code provided in this course will always use Numpy arrays, and never
Numpy matrices.</p>
</section>
<section id="github-and-git">
<h2>GitHub and git<a class="headerlink" href="#github-and-git" title="Link to this heading">¶</a></h2>
<p>Revision control is a mechanism for recording and managing different
versions of changing software. This enables changes to be tracked and
helps in the process of debugging code, and in managing conflicts when
more than one person is working on the same project. Revision control
can be combined with online hosting to provide secure backups and to
enable you to work on code from different locations.</p>
<p>In this module, you’ll use revision control to access the skeleton
files, and to update those files if and when they change. You’ll also
use the same revision control system to record the edits you make over
time and to submit your work for feedback and, eventually, marking.</p>
<p>We will be using the revision control system <a class="reference external" href="http://git-scm.com/">git</a>, which is the current state of the art and is
widely adopted. We’ll be combining git with the online hosting service GitHub.</p>
<section id="getting-started-with-git-and-github">
<h3>Getting started with git and GitHub<a class="headerlink" href="#getting-started-with-git-and-github" title="Link to this heading">¶</a></h3>
<p>The very first thing you’ll need is a GitHub account. Navigate to <a class="reference external" href="https://github.com/">GitHub</a> and sign up.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Make sure you use your Imperial College email address on
GitHub. This enables you to request unlimited free private GitHub
repositories and other goodies by <a class="reference external" href="https://education.github.com/pack">applying here</a>. You don’t strictly need this
for this module, but there are some nice things in there that you
might want anyway.</p>
</div>
<p>Next you need to do just a little Git setup. At the <cite>Git Bash</cite> command
line, type the following:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">config</span> <span class="o">--</span><span class="k">global</span> <span class="n">user</span><span class="o">.</span><span class="n">name</span> <span class="s2">"Jane Bloggs"</span>
</pre></div>
</div>
<p>Obviously you put in your own name rather than “Jane Bloggs”. Similarly, you need to set your email:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">config</span> <span class="o">--</span><span class="k">global</span> <span class="n">user</span><span class="o">.</span><span class="n">email</span> <span class="s2">"Jane.Bloggs12@imperial.ac.uk"</span>
</pre></div>
</div>
<p>Once again, you obviously use your own email address. Now there is a
small setting which makes the output of git colourful and therefore a
lot easier to read:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">config</span> <span class="o">--</span><span class="k">global</span> <span class="n">color</span><span class="o">.</span><span class="n">ui</span> <span class="s2">"auto"</span>
</pre></div>
</div>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>If you are a more confident computer user, you could go ahead and
set up git to work with ssh, the secure shell. This will save a lot
of password typing but it’s not essential so if you are not so
confident with computers, you can skip this bit. The instructions
are <a class="reference external" href="https://help.github.com/articles/generating-an-ssh-key/">here</a>.</p>
</div>
<p>There is an excellent <a class="reference external" href="https://swcarpentry.github.io/git-novice/">git tutorial</a> over at Software
Carpentry.</p>
</section>
</section>
<section id="sharing-your-problems-with-gists">
<h2>Sharing your problems with gists<a class="headerlink" href="#sharing-your-problems-with-gists" title="Link to this heading">¶</a></h2>
<p>At some points during the module, you’re sure to create bugs in your
code that you don’t know how to fix. If you’re not in class at the
time, you’ll need a convenient way to share a piece of code or output
with the lecturer and the class. GitHub
provides this facility, which they call <cite>gists</cite>.</p>
<p>Once you’ve signed up and logged in, you can navigate to <a class="reference external" href="https://gist.github.com">https://gist.github.com</a> and there’s a very simple webpage into which
you can paste your code or output. You should also set the language so
that GitHub formats your gist correctly. Click <cite>create public gist</cite>
and you’re done. You can then paste the URL of your gist page into an
email or into a GitHub issue.</p>
</section>
<section id="raising-hell-issues">
<h2>Raising <span class="strikethrough">hell</span> issues<a class="headerlink" href="#raising-hell-issues" title="Link to this heading">¶</a></h2>
<p>If you have problems you can’t solve yourself, you can share them with
the class by <a class="reference external" href="https://github.com/comp-lin-alg/comp-lin-alg-course/issues">raising an issue on GitHub</a>. When you do this, here are
some tips which will help get your problem fixed:</p>
<dl class="simple">
<dt>Be precise</dt><dd><p>“It didn’t work” is useless. “I typed <code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">cla_utils</span></code> and
received the following error.” is much better.</p>
</dd>
<dt>Provide a minimal failing example</dt><dd><p>Post the smallest piece of code which exhibits the problem. This
makes finding the issue much easier.</p>
</dd>
<dt>Use gists</dt><dd><p>Copy exactly what happened, complete with error messages,
into a gist and post the link in the issue.</p>
</dd>
</dl>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
© Copyright 2020-2023, Colin J. Cotter.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.4.0.
</div>
</body>
</html>