Skip to content

Commit

Permalink
Merge pull request #195 from alan-turing-institute/187-fix-typos
Browse files Browse the repository at this point in the history
Fix minor issues
  • Loading branch information
jemrobinson authored Jan 27, 2023
2 parents 00605df + aba520e commit 7751c3f
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"Not just big scientific simulation codes, but also the small scripts which we use to tidy up data and produce plots.\n",
"This should be code, so that the whole research pipeline is recorded for reproducibility.\n",
"Data manipulation in spreadsheets is much harder to share or check.\n",
"There are many data analysis examples out there, like the on the [software carpentry site](https://swcarpentry.github.io/python-novice-inflammation/01-numpy/index.html)."
"There are many data analysis examples out there, like the on the [software carpentry site](https://swcarpentry.github.io/python-novice-inflammation/01-intro/index.html)."
]
},
{
Expand Down Expand Up @@ -351,7 +351,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can make the script directly executable (on Linux or Mac) by inserting a [hashbang](https://en.wikipedia.org/wiki/Shebang_(Unix%29)) and [setting the permissions](http://v4.software-carpentry.org/shell/perm.html) to execute."
"We can make the script directly executable (on Linux or Mac) by inserting a [shebang](https://en.wikipedia.org/wiki/Shebang_%28Unix%29) and [setting the permissions](http://v4.software-carpentry.org/shell/perm.html) to execute."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"*Supplementary material*: http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html"
"*Supplementary material*: https://docs.python.org/3/reference/expressions.html#operator-precedence"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion module01_introduction_to_python/01_03_types.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
"source": [
"*Supplementary material*:\n",
"\n",
"* https://docs.python.org/2/tutorial/floatingpoint.html\n",
"* https://docs.python.org/3/tutorial/floatingpoint.html\n",
"* http://floating-point-gui.de/formats/fp/\n",
"* Advanced: http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html"
]
Expand Down
2 changes: 1 addition & 1 deletion module02_intermediate_python/02_01_functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In this example, we're using `[:]` to access into the same list, and write it's data.\n",
"In this example, we're using `[:]` to access into the same list, and write its data.\n",
"\n",
" vec = [element*2 for element in vec]\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
"**Supplementary Materials**: If you're not already comfortable with how files fit into folders, and folders form a tree,\n",
" with folders containing subfolders, then look at http://swcarpentry.github.io/shell-novice/02-filedir/index.html. \n",
"\n",
"Satisfy yourself that after using `%%writefile`, you can then find the file on disk with Windows Explorer, OSX Finder, or the Linux Shell."
"Satisfy yourself that after using `%%writefile`, you can then find the file on disk with Windows Explorer, macOS Finder, or the Linux Shell."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can loop over each element in out list of coordinates, and get a map for that place:"
"We can loop over each element in our list of coordinates, and get a map for that place:"
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions module02_intermediate_python/02_06_defining_classes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# 2.7 Defining your own classes"
"# 2.6 Defining your own classes"
]
},
{
Expand All @@ -18,7 +18,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2.7.1 User Defined Types"
"## 2.6.1 User Defined Types"
]
},
{
Expand Down Expand Up @@ -161,7 +161,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2.7.2 Methods"
"## 2.6.2 Methods"
]
},
{
Expand Down Expand Up @@ -278,7 +278,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2.7.3 Constructors"
"## 2.6.3 Constructors"
]
},
{
Expand Down Expand Up @@ -347,7 +347,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2.7.4 Object-oriented design"
"## 2.6.4 Object-oriented design"
]
},
{
Expand Down Expand Up @@ -634,7 +634,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2.7.5 Alternative object models"
"## 2.6.5 Alternative object models"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@
" ]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that a line like `from .map import Map` will import the definition of `Map` from the file `map.py` in the current directory."
]
},
{
"cell_type": "code",
"execution_count": 3,
Expand Down
4 changes: 2 additions & 2 deletions module02_intermediate_python/02_08_classroom_exercises.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"id": "333e37f3",
"metadata": {},
"source": [
"Investigate the similarities and differences between the responses (if any) from the `numpy`, `scipy`, `statistics`, and `math` modules to the following calculations:\n",
"Investigate the similarities and differences between the responses (if any) from the `numpy`, `scipy`, `statistics` and `math` modules to the following calculations:\n",
"\n",
"\n",
"$\\pi$\n",
Expand All @@ -168,7 +168,7 @@
"id": "57f50256",
"metadata": {},
"source": [
"For those interested, each of these libraries has their own documentation. [NumPy](https://numpy.org/doc/stable/user/whatisnumpy.html), [SciPy](https://docs.scipy.org/doc/scipy/tutorial/general.html), [statistics](https://docs.python.org/3/library/statistics.html), and [math](https://docs.python.org/3/library/math.html)"
"For those interested, each of these libraries has their own documentation. [NumPy](https://numpy.org/doc/stable/user/whatisnumpy.html), [SciPy](https://docs.scipy.org/doc/scipy/tutorial/general.html), [statistics](https://docs.python.org/3/library/statistics.html) and [math](https://docs.python.org/3/library/math.html)"
]
},
{
Expand Down
30 changes: 15 additions & 15 deletions solutions/module_02.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -162,30 +162,30 @@
"source": [
"**Answer 2d**\n",
"\n",
"Will have to import libraries.\n",
"After `import`ing the libraries you can use ```dir(X)``` to list the attributes of each module\n",
"\n",
"Can use ```dir(X)``` to list the attributes of the modules\n",
"There will be some depreciation warnings from `scipy` instructing users to use `numpy` or `numpy.lib` (which can also be investigated via ```dir(numpy.lib)```\n",
"\n",
"There will be some depreciation warnings from scipy instructing users to go use numpy or numpy.lib (which can also be investigated via ```dir(np.lib)``` \n",
"`pi`: Use `numpy.pi`, `scipy.pi`, `math.pi`. `statistics` has `tau` but not `pi`.\n",
"\n",
"Statistics will return the mean as an integer whereas numpy and scipy will return a float.\n",
"`log`: Use `numpy.log10`, `scipy.log10`, `math.log10`. `statistics` has `log` but not `log10`: `log(n)/log(10)` can be used instead.\n",
"\n",
"All return the same value of pi.\n",
"For log(+ive) we use +12.01 as an example while for log(-ive) we use -11.99 as an example.\n",
"\n",
"scipy returns a complex number for the negative log example with an imaginary part of pi.\n",
"| Module | pi | log(+ive) | log(-ive) | mean |\n",
"|:-----------|:----------:|:----------:|:------------------------:|:----:|\n",
"| numpy | 3.14159... | 1.07954... | nan | 5.0 |\n",
"| scipy | 3.14159... | 1.07954... | (1.07881...+1.36437...j) | 5.0 |\n",
"| math | 3.14159... | 1.07954... | math domain error | n/a |\n",
"| statistics | n/a | 1.07954... | math domain error | 5 |\n",
"\n",
"log(+ive) using +12.01 as an example\n",
"All libraries return the same value of pi.",
"\n",
"log(-ive) using -11.99 as an example\n",
"All libraries return the same value of log(+ive).",
"\n",
"| Module | pi| log(+ive) | log(-ive)| mean|\n",
"| :-------|:-------------:|:-----:|:-----:|:-----:|\n",
"|numpy|3.14159...|2.48573...|nan|5.0|\n",
"|scipy|3.14159...|2.48573...|(2.48407... + 3.14159...j)|5.0|\n",
"|math|3.14159...|2.48573...|math domain error|§|\n",
"|statistics|§|2.48573...|math domain error|5|\n",
"scipy returns a complex number for the negative log example while all others produce an error.\n",
"\n",
"§ module doesn't have method"
"`statistics` returns the mean as an integer whereas `numpy` and `scipy` return a float.\n"
]
},
{
Expand Down

0 comments on commit 7751c3f

Please sign in to comment.