Skip to content

Commit 2516c38

Browse files
committed
differences for PR #452
1 parent 1cc411a commit 2516c38

16 files changed

+526
-458
lines changed

12-virtual-environments.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,13 @@ It looks like the script expects a list of input files to process,
649649
so this is expected behaviour since we do not supply any.
650650
We will fix this error in a moment.
651651

652-
## Optional Exercises
652+
## Optional exercises
653+
654+
Checkout [this optional exercise](17-section1-optional-exercises.md)
655+
to try out different virtual environment managers.
656+
Or, [this exercise](17-section1-optional-exercises.md)
657+
to customize the command line.
653658

654-
Have a look at [some optional exercises](17-section1-optional-exercises.md).
655659

656660

657661
:::::::::::::::::::::::::::::::::::::::: keypoints

14-collaboration-using-git.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ You do, however, want to share `requirements.txt` with your team
158158
as this file can be used to replicate the virtual environment on your collaborators' systems.
159159

160160
To tell Git to intentionally ignore and not track certain files and directories,
161-
you need to specify them in the `.gitignore` text file. A common place to put this file is in the project root.
161+
you need to specify them in the `.gitignore` text file in the project root.
162162
Our project already has `.gitignore`,
163163
but in cases where you do not have it -
164164
you can simply create it yourself.
@@ -519,7 +519,7 @@ We still prefer to explicitly state this information in commands.
519519

520520
::::::::::::::::::::::::::::::::::::::::::::::::::
521521

522-
Let us confirm that the new branch `develop` now exists remotely on GitHub too.
522+
Let us confirm that the new branch `develop` now exist remotely on GitHub too.
523523
From the `Code` tab in your repository in GitHub,
524524
click the branch dropdown menu (currently showing the default branch `main`).
525525
You should see your `develop` branch in the list too.

15-coding-conventions.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -138,33 +138,33 @@ or a hanging indent.
138138
```python
139139
# Add an extra level of indentation (extra 4 spaces) to distinguish arguments from the rest of the code that follows
140140
def long_function_name(
141-
var_one, var_two, var_three,
142-
var_four):
143-
print(var_one)
141+
var_one, var_two, var_three,
142+
var_four):
143+
print(var_one)
144144

145145

146146
# Aligned with opening delimiter
147147
foo = long_function_name(var_one, var_two,
148-
var_three, var_four)
148+
var_three, var_four)
149149

150150
# Use hanging indents to add an indentation level like paragraphs of text where all the lines in a paragraph are
151151
# indented except the first one
152152
foo = long_function_name(
153-
var_one, var_two,
154-
var_three, var_four)
153+
var_one, var_two,
154+
var_three, var_four)
155155

156156
# Using hanging indent again, but closing bracket aligned with the first non-blank character of the previous line
157157
a_long_list = [
158-
[[1, 2, 3], [4, 5, 6], [7, 8, 9]], [[0.33, 0.66, 1], [0.66, 0.83, 1], [0.77, 0.88, 1]]
159-
]
158+
[[1, 2, 3], [4, 5, 6], [7, 8, 9]], [[0.33, 0.66, 1], [0.66, 0.83, 1], [0.77, 0.88, 1]]
159+
]
160160

161161
# Using hanging indent again, but closing bracket aligned with the start of the multiline contruct
162162
a_long_list2 = [
163-
1,
164-
2,
165-
3,
166-
# ...
167-
79
163+
1,
164+
2,
165+
3,
166+
# ...
167+
79
168168
]
169169
```
170170

@@ -189,11 +189,11 @@ to indicate line continuation (slightly less preferred method).
189189
```python
190190
# Using delimiters ( ) to wrap a multi-line expression
191191
if (a == True and
192-
b == False):
192+
b == False):
193193

194194
# Using a backslash (\) for line continuation
195195
if a == True and \
196-
b == False:
196+
b == False:
197197
```
198198

199199
### Should a Line Break Before or After a Binary Operator?
@@ -608,7 +608,7 @@ or using triple quotes as a way to 'quickly' comment out an entire block of code
608608
is considered bad practice.
609609

610610
In our example case, we used the
611-
[Sphinx/ReadTheDocs docstring style](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html)
611+
[Sphynx/ReadTheDocs docstring style](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html)
612612
formatting for the `param`, `raises` and `returns` - other docstring formats exist as well.
613613

614614
::::::::::::::::::::::::::::::::::::::::: callout

17-section1-optional-exercises.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 1.7 Optional Exercises
2+
title: 1.7 Optional Exercises for Section 1
33
start: no
44
teaching: 0
55
exercises: 45
@@ -13,25 +13,23 @@ exercises: 45
1313

1414
:::::::::::::::::::::::::::::::::::::::: questions
1515

16-
- How can I further fine-tune my coding environment?
16+
- How can I further finetune my coding environment?
1717

1818
::::::::::::::::::::::::::::::::::::::::::::::::::
1919

20-
This episode has some optional exercises for Section 1.
20+
This episode holds some optional exercises for section 1.
2121
The exercises have an explorative nature, so feel free to go off in any direction that interests you.
2222
You will be looking at some tools that either complement or are alternatives to those already introduced.
2323
Even if you find something that you really like,
24-
for the sake of following through with the course, we still recommend sticking with the tools that we introduced prior to this episode
25-
and then switching to something else afterwards.
24+
we still recommend sticking with the tools that were introduced prior to this episode when you move onto other sections of the course.
2625

27-
::::::::::::::::::::::::::::::::::::::: discussion
26+
::::::::::::::::::::::::::::::::::::::: challenge
2827

2928
## Exercise: Apply to your own project(s)
3029

3130
Apply what you learned in this section to your own project(s).
32-
This is the time to ask any questions of your instructors, helpers or fellow learners.
33-
Everyone has different preferences for tooling, so getting input from experienced developers is a great opportunity to learn new things
34-
or different perspectives.
31+
This is the time to ask any questions to your instructors or helpers.
32+
Everyone has different preferences for tooling, so getting the input of experienced developers is a great opportunity.
3533

3634
::::::::::::::::::::::::::::::::::::::::::::::::::
3735

@@ -42,17 +40,17 @@ or different perspectives.
4240
Install different Integrated Development Environments (IDEs) and test them out.
4341
Which one do you like the most and why?
4442

45-
Some suggestions to try:
43+
You can try:
4644

4745
- [Visual Studio Code](https://code.visualstudio.com/), with setup instructions [in the Extras of this course](../learners/vscode.md)
4846
- [Atom](https://atom-editor.cc/)
4947
- [Sublime Text](https://www.sublimetext.com/)
5048
- [RStudio](https://posit.co/download/rstudio-desktop/)
5149

52-
When compared to PyCharm, the IDEs listed above are advanced source code editors capable of functioning as IDEs.
53-
To function as an IDE, you have to manually install plugins for these tools to obtain more advanced features -
50+
Technically, compared to PyCharm, the 'IDEs' listed above are source code editors capable of functioning as an IDE
51+
(with RStudio as an example).
52+
To function as an IDE, you have to manually install plugins for more powerful features
5453
such as support for a specific programming language or unit testing.
55-
5654
What do you prefer, a lot of tooling out of the box or a lightweight editor with optional extensions?
5755

5856
If you want an even more lightweight setup you can try out these configurable source code editors:
@@ -64,27 +62,28 @@ If you want an even more lightweight setup you can try out these configurable so
6462

6563
::::::::::::::::::::::::::::::::::::::: challenge
6664

67-
## Exercise: Customise the command line tool
65+
## Exercise: Customize the command line
6866

69-
You can customise the command line tool or use alternatives to `bash`, such as:
67+
You can customize the command line or use alternatives to `bash` to make yourself more productive.
7068

71-
- [Bash Prompt Generator](https://bash-prompt-generator.org/) - it lets you try out different prompts,
69+
- Try out [Bash Prompt Generator](https://bash-prompt-generator.org/), it lets you try out different prompts,
7270
depending on the information you want displayed.
73-
- [z, a simple tool to more quickly move around directories](https://github.com/rupa/z).
74-
- [Z shell (zsh)](https://zsh.sourceforge.io/), a shell designed for interactive use.
75-
- [Oh My ZSH](https://ohmyz.sh/), which is a theming and package manager of the `zsh` terminal.
76-
- [fish](https://fishshell.com/), a smart and user-friendly command line shell.
71+
- Try out [z, a simple tool to more quickly move around directories](https://github.com/rupa/z).
72+
- Try out [Z shell (zsh)](https://zsh.sourceforge.io/), a shell designed for interactive use.
73+
- Try out [Oh My ZSH](https://ohmyz.sh/), which is a theming and package manager of the `zsh` terminal.
74+
- Try out [fish](https://fishshell.com/), a smart and user-friendly command line shell.
7775

7876
::::::::::::::::::::::::::::::::::::::::::::::::::
7977

8078
::::::::::::::::::::::::::::::::::::::: challenge
8179

8280
## Exercise: Try out different virtual environment managers
8381

84-
So far we have used `venv`, but there are other virtual environment managers for Python:
82+
So far we used `venv`, but there are other virtual environment managers for Python:
8583

86-
- [Poetry](https://python-poetry.org/), which we will explore using in [Section 4](43-software-release.md).
87-
- `conda`, which is part of [Anaconda Distribution](https://www.anaconda.com/download).
84+
- [Poetry](https://python-poetry.org/), which we will explore using in
85+
[Section 4](43-software-release.md).
86+
- conda, which is part of [Anaconda Distribution)](https://www.anaconda.com/download).
8887

8988
Anaconda is widely used in academia, but the current license does not allow use for research in most circumstances.
9089
An open-source alternative is [mini-forge](https://github.com/conda-forge/miniforge).
@@ -93,11 +92,11 @@ An open-source alternative is [mini-forge](https://github.com/conda-forge/minifo
9392

9493
::::::::::::::::::::::::::::::::::::::: challenge
9594

96-
## Exercise: Customise `pylint`
97-
98-
Tell `pylint` to accept the maximum line length of 100 characters instead of the default 80.
95+
## Exercise: Customize `pylint`
9996

100-
Hint: find out different ways in which you can configure `pylint` (e.g. via `pylint` command line interface or its configuration file).
97+
You decide to change the max line length of your project to 100 instead of the default 80.
98+
Find out how you can configure pylint. You can first try to use the pylint command line interface,
99+
but also play with adding a configuration file that pylint reads in.
101100

102101
::::::::::::::: solution
103102

@@ -109,7 +108,7 @@ Specify the max line length as an argument: `pylint --max-line-length=100`
109108

110109
### Using a configuration file
111110

112-
You can create a file `.pylintrc` in the root of your project folder to overwrite `pylint` settings:
111+
You can create a file `.pylintrc` in the root of your project folder to overwrite pylint settings:
113112

114113
```
115114
[FORMAT]

21-automatically-testing-software.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ There are three main types of automated tests:
9090
for example after making changes your code to add new functionality or fix a bug.
9191

9292
For the purposes of this course, we will focus on unit tests.
93-
But the principles and practices we will talk about can be built on
93+
But the principles and practices we wll talk about can be built on
9494
and applied to the other types of tests too.
9595

9696
## Set Up a New Feature Branch for Writing Tests

23-continuous-integration-automated-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ Let us say we want to add more detail to our list of initial ascenders:
128128
...
129129
first_scaled_by:
130130
- name: Hans Meyer
131-
date_of_birth: 1858-03-22
131+
date_of_birth: 22-03-1858
132132
nationality: German
133133
- name: Ludwig Purtscheller
134-
date_of_birth: 1858-03-22
134+
date_of_birth: 22-03-1858
135135
nationality: Austrian
136136
```
137137

32-software-architecture-design.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ goal of having *maintainable* code, which is:
131131
Now that we know what goals we should aspire to, let us take a critical look at the code in our
132132
software project and try to identify ways in which it can be improved.
133133

134+
## Designing a New Feature for Our Project
135+
134136
Our software project contains a pre-existing branch `full-data-analysis` which contains code for a new feature of our
135137
inflammation analysis software, which we will consider as a contribution by another developer.
136138
Recall that you can see all your branches as follows:
@@ -154,7 +156,7 @@ This bit of functionality is handled by `inflammation-analysis.py` in the projec
154156
The new data analysis code is located in `compute_data.py` file within the `inflammation` directory
155157
in a function called `analyse_data()`.
156158
This function loads all the data files for a given a directory path, then
157-
calculates and compares standard deviation across all the data by day and finaly plots a graph.
159+
calculates and compares standard deviation across all the data by day and finally plots a graph.
158160

159161
::::::::::::::::::::::::::::::::::::::: challenge
160162

34-code-refactoring.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ we refactor or change code in the future.
9595
Start from the skeleton test code below:
9696

9797
```python
98+
from inflammation.compute_data import analyse_data
99+
98100
def test_analyse_data():
99-
from inflammation.compute_data import analyse_data
100-
path = Path.cwd() / "../data"
101+
path = os.path.join( os.getcwd(), "../data")
101102
data_source = CSVDataSource(path)
102103
result = analyse_data(data_source)
103-
104104
# TODO: add assert statement(s) to test the result value is as expected
105105
```
106106

@@ -115,7 +115,6 @@ When determining the correct return data result to use in tests, it may be helpf
115115
result equals some random made-up data, observe the test fail initially and then
116116
copy and paste the correct result into the test.
117117

118-
119118
:::::::::::::::::::::::::
120119

121120
::::::::::::::: solution
@@ -134,11 +133,10 @@ Putting this together, our test may look like:
134133

135134
```python
136135
import numpy.testing as npt
137-
from pathlib import Path
136+
from inflammation.compute_data import analyse_data
138137

139138
def test_analyse_data():
140-
from inflammation.compute_data import analyse_data
141-
path = Path.cwd() / "../data"
139+
path = os.path.join( os.getcwd(), "../data")
142140
data_source = CSVDataSource(path)
143141
result = analyse_data(data_source)
144142
expected_output = [0.,0.22510286,0.18157299,0.1264423,0.9495481,0.27118211,

common-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Git Bash uses its own SSH library by default, which may result in errors such as
143143
even after adding your SSH key correctly:
144144

145145
```
146-
$ git clone git@github.com:ukaea-rse-training/python-intermediate-inflammation
146+
$ git clone git@github.com:https://github.com/ukaea-rse-training/python-intermediate-inflammation
147147
Cloning into 'python-intermediate-inflammation'...
148148
git@github.com: Permission denied (publickey).
149149
fatal: Could not read from remote repository.

0 commit comments

Comments
 (0)