Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • linigodelacruz/practicum-lecture-notes
  • stephandehoop/practicum-lecture-notes
  • saghajani/practicum-lecture-notes
  • jeroenkalkman/practicum-lecture-notes
  • python-for-applied-physics/practicum-lecture-notes
5 results
Show changes
Commits on Source (89)
Showing
with 1486 additions and 95 deletions
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
.DS_Store .DS_Store
*.zip *.zip
*.ipynb
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
......
...@@ -3,6 +3,7 @@ outputs: ...@@ -3,6 +3,7 @@ outputs:
- conda install jupytext -c conda-forge - conda install jupytext -c conda-forge
script: script:
- "jupytext */Notebook*md Outline\\ of\\ notebooks.md --to notebook" - "jupytext */Notebook*md Outline\\ of\\ notebooks.md --to notebook"
- "jupytext Additional*/*md --to notebook"
artifacts: artifacts:
paths: paths:
- "*/Notebook*ipynb" - "*/Notebook*ipynb"
...@@ -11,6 +12,8 @@ outputs: ...@@ -11,6 +12,8 @@ outputs:
- "Notebook*/*png" - "Notebook*/*png"
- "Notebook 5/exercise_data.dat" - "Notebook 5/exercise_data.dat"
- "Notebook 5/v_vs_time.dat" - "Notebook 5/v_vs_time.dat"
- "Notebook 5/example2.dat"
- "Outline of notebooks.ipynb" - "Outline of notebooks.ipynb"
- "Additional*/*" - "Additional*/*ipynb"
- "Additional*/*png"
name: Lecture_Notebooks name: Lecture_Notebooks
...@@ -5,15 +5,14 @@ jupyter: ...@@ -5,15 +5,14 @@ jupyter:
text_representation: text_representation:
extension: .md extension: .md
format_name: markdown format_name: markdown
format_version: '1.1' format_version: '1.2'
jupytext_version: 1.2.2 jupytext_version: 1.3.0
kernelspec: kernelspec:
display_name: Python 3 display_name: Python 3
language: python language: python
name: python3 name: python3
--- ---
<!-- #region -->
# Additional Programming Concepts in Python # Additional Programming Concepts in Python
In this notebook, you will learn about additional programming concepts in Python. They are not part of the learning objectives of the course, but you may run into them at some point, or wonder what they are, or find them fun and useful if you already have some programming experience. In this notebook, you will learn about additional programming concepts in Python. They are not part of the learning objectives of the course, but you may run into them at some point, or wonder what they are, or find them fun and useful if you already have some programming experience.
...@@ -31,7 +30,6 @@ my_tuple = (a, b, c, ...etc...) ...@@ -31,7 +30,6 @@ my_tuple = (a, b, c, ...etc...)
``` ```
As a concrete example, this will create a tuple of three integers: As a concrete example, this will create a tuple of three integers:
<!-- #endregion -->
```python ```python
tup1 = (5,6,7) tup1 = (5,6,7)
...@@ -101,7 +99,7 @@ for n in tup1: ...@@ -101,7 +99,7 @@ for n in tup1:
During each subsequent iteartion of the loop, the variable `n` will be assigned to the next item that is stored in the tuple. During each subsequent iteartion of the loop, the variable `n` will be assigned to the next item that is stored in the tuple.
<!-- #region -->
## Lists ## Lists
In this section, we will introduce a very commonly used data structure in python: the `list`. In this section, we will introduce a very commonly used data structure in python: the `list`.
...@@ -111,7 +109,6 @@ A list is a list of values, like a `tuple`, but that is made using square bracke ...@@ -111,7 +109,6 @@ A list is a list of values, like a `tuple`, but that is made using square bracke
``` ```
my_list = [a, b, c, ...etc...] my_list = [a, b, c, ...etc...]
``` ```
<!-- #endregion -->
```python ```python
l1 = list(range(10)) l1 = list(range(10))
...@@ -505,11 +502,11 @@ For some types of objects in python, specifically "immutable" ("unchangeable") o ...@@ -505,11 +502,11 @@ For some types of objects in python, specifically "immutable" ("unchangeable") o
This procedure is called "call by value" in programming languages, and is illustrated here: This procedure is called "call by value" in programming languages, and is illustrated here:
<img src="call_by_value.png"></img> <img src="resource/asnlib/public/call_by_value.png"></img>
For "mutable" objects, python uses a different concept: "call by reference". In call by reference, `b = a` instead does the following: it make a new variable `b` in the list of variables, and make it point to the spot in memory where variable `a` is stored, illustrated here: For "mutable" objects, python uses a different concept: "call by reference". In call by reference, `b = a` instead does the following: it make a new variable `b` in the list of variables, and make it point to the spot in memory where variable `a` is stored, illustrated here:
<img src="call_by_reference.png"></img> <img src="resource/asnlib/public/call_by_reference.png"></img>
It is now obvious why changing the values in `a` will also changes the values in `b`: it is because they point to the same data in your computers memory. It is now obvious why changing the values in `a` will also changes the values in `b`: it is because they point to the same data in your computers memory.
...@@ -613,7 +610,6 @@ def update_plot3(slope=0.5, offset=0): ...@@ -613,7 +610,6 @@ def update_plot3(slope=0.5, offset=0):
interact(update_plot3, slope=(0,10,0.1), offset=(-4,3,0.2)) interact(update_plot3, slope=(0,10,0.1), offset=(-4,3,0.2))
``` ```
<!-- #region -->
## Functions ## Functions
### Keyword and optional arguments ### Keyword and optional arguments
...@@ -630,7 +626,6 @@ The "default_value" is the value that the optional argument will have if it is n ...@@ -630,7 +626,6 @@ The "default_value" is the value that the optional argument will have if it is n
In python-speak, these "optional" arguement as called "keyword" arguments, and the normal arguments we introduced above are called "positional" arguments. In python, in both defining and using functions, keyword arguments must always come after all of the positional arguments. In python-speak, these "optional" arguement as called "keyword" arguments, and the normal arguments we introduced above are called "positional" arguments. In python, in both defining and using functions, keyword arguments must always come after all of the positional arguments.
Here, we will show an example where we use an optional parameter to change the way we print the status sentence. Here, we will show an example where we use an optional parameter to change the way we print the status sentence.
<!-- #endregion -->
```python ```python
def print_status4(x, long=True): def print_status4(x, long=True):
...@@ -644,7 +639,6 @@ print_status4(2.5, long=True) ...@@ -644,7 +639,6 @@ print_status4(2.5, long=True)
print_status4(2.4, long=False) print_status4(2.4, long=False)
``` ```
<!-- #region -->
Because python assigns the value of keyword argument variables in the function by matching the keyword and not their position in the list, if you have multiple keyword arguments, you can also change the order of them when you use the function. Because python assigns the value of keyword argument variables in the function by matching the keyword and not their position in the list, if you have multiple keyword arguments, you can also change the order of them when you use the function.
For example, if I define a function: For example, if I define a function:
...@@ -662,7 +656,6 @@ myfunction(1,var2=54, var2=3) ...@@ -662,7 +656,6 @@ myfunction(1,var2=54, var2=3)
``` ```
Finally, one can also use keywords as a way to send values to functions even if the functions are not defined with keyword arguments. This allows you to change to order of variables you send to a function if you want. For example: Finally, one can also use keywords as a way to send values to functions even if the functions are not defined with keyword arguments. This allows you to change to order of variables you send to a function if you want. For example:
<!-- #endregion -->
```python ```python
def myfun(x,y): def myfun(x,y):
...@@ -705,7 +698,7 @@ The most important information is at the very top and at the very bottom (you ca ...@@ -705,7 +698,7 @@ The most important information is at the very top and at the very bottom (you ca
At the top, it shows us the part of our code that triggered the error: At the top, it shows us the part of our code that triggered the error:
<img src="big_error_1.png"></img> <img src="resource/asnlib/public/big_error_1.png"></img>
The error type is a `ValueError`, which according to the documentation, indicates "an argument that has the right type but an inappropriate value". The error type is a `ValueError`, which according to the documentation, indicates "an argument that has the right type but an inappropriate value".
......
Additional Material/resource/asnlib/public/call_by_reference.png

11.8 KiB

Additional Material/resource/asnlib/public/call_by_value.png

11.9 KiB

Course_Information/Course_Information_anaconda_prompt_windows.png

25.2 KiB

Course_Information/Course_Information_cell_type.png

20.8 KiB

Course_Information/Course_Information_disable_box.png

17.3 KiB

Course_Information/Course_Information_enable_toc.png

14.5 KiB

Course_Information/Course_Information_mac_terminal.png

123 KiB

Course_Information/Course_Information_nbextensions.png

12.2 KiB

Course_Information/Course_Information_notebook_server.png

228 KiB

%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Installing and running the server ## Installing and running the server
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
### My Jupyter server has crashed, link does not work ### My Jupyter server has crashed, link does not work
If the link http://localhost:8888 does not work, your server may have crashed (or may be running on a different port if you accidentally started muliple servers). If the link http://localhost:8888 does not work, your server may have crashed (or may be running on a different port if you accidentally started muliple servers).
If this is the case, you should go back to the Anaconda prompt window it was running in and do the following: If this is the case, you should go back to the Anaconda prompt window it was running in and do the following:
1. Type `Ctrl-C` 1. Type `Ctrl-C`
2. Run the command `jupyter notebook stop` 2. Run the command `jupyter notebook stop`
3. Run the command `jupyter notebook start` 3. Run the command `jupyter notebook start`
If you cannot find the Anaconda prompt window anymore, you can also open a new Anaconda prompt window and do steps 2 and 3 above. If you cannot find the Anaconda prompt window anymore, you can also open a new Anaconda prompt window and do steps 2 and 3 above.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
### My files are not in my home directory, how do I get to them? ### My files are not in my home directory, how do I get to them?
If your files are stored outside of your home directory, for example if they are on your D: drive in windows, you will have to first change directories in the Anaconda prompt to that folder before you run the command `jupyter notebook`. If your files are stored outside of your home directory, for example if they are on your D: drive in windows, you will have to first change directories in the Anaconda prompt to that folder before you run the command `jupyter notebook`.
For example, let's say your files are on the D: drive in a folder `D:\Python\Practicum`. First you should stop the notebook server (see steps 1 and 2 of "Restarting a notebook server") and then you can use the following commands in the Anaconda prompt: For example, let's say your files are on the D: drive in a folder `D:\Python\Practicum`. First you should stop the notebook server (see steps 1 and 2 of "Restarting a notebook server") and then you can use the following commands in the Anaconda prompt:
* `d:` * `d:`
* `cd Python` * `cd Python`
* `jupyter notebook` * `jupyter notebook`
This will start a notebook server with the "root directory" as `D:\Python`, which will allow you to access all the files in subfolders of `D:\Python`. This will start a notebook server with the "root directory" as `D:\Python`, which will allow you to access all the files in subfolders of `D:\Python`.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
### Why is my web browser going to http://localhost:8889/ (instead of 8888)? ### Why is my web browser going to http://localhost:8889/ (instead of 8888)?
This can happen when you (accidentally) open multiple notebook servers. You can list all the notebook servers that are running using the following command at the Anaconda prompt: This can happen when you (accidentally) open multiple notebook servers. You can list all the notebook servers that are running using the following command at the Anaconda prompt:
`jupyter notebook list` `jupyter notebook list`
You can then close any extra ones you don't want by using the `stop` command with their "port" number (the four numbers after "localhost"). For example, to stop one running on port 8889, use: You can then close any extra ones you don't want by using the `stop` command with their "port" number (the four numbers after "localhost"). For example, to stop one running on port 8889, use:
`jupyter notebook stop 8889` `jupyter notebook stop 8889`
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Using Jupyter Notebooks ## Using Jupyter Notebooks
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
### My code cell sometimes changes to a text cell, how do we change this back? ### My code cell sometimes changes to a text cell, how do we change this back?
You have probably changed the "cell type" from "Code" to "Markdown". You can change it back using the menu toolbar dropdown box: You have probably changed the "cell type" from "Code" to "Markdown". You can change it back using the menu toolbar dropdown box:
<img src="cell_type.png"></img> <img src="resource/asnlib/public/Course_Information_cell_type.png"></img>
There also <a href=https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Notebook%20Basics.html#Keyboard-Navigation>keyboard shortcuts</a> for many things. There also <a href=https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Notebook%20Basics.html#Keyboard-Navigation>keyboard shortcuts</a> for many things.
Most likely, you pushing the `M` key while the cell was selected in "command" mode (blue border). You can change it back by pushing the `Y` key. Most likely, you pushing the `M` key while the cell was selected in "command" mode (blue border). You can change it back by pushing the `Y` key.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
``` ```
......
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Installation instructions # Installation instructions
This page explains how to: This page explains how to:
1. Install python using Anaconda 1. Install python using Anaconda
2. Install `nbextensions` 2. Install `nbextensions`
3. Start a Jupyter Notebook server 3. Start a Jupyter Notebook server
4. Enable the "Table of Contents" Extension 4. Enable the "Table of Contents" Extension
## 1. Install python using Anaconda ## 1. Install python using Anaconda
First, download and install Anaconda: First, download and install Anaconda:
https://www.anaconda.com/distribution/ https://www.anaconda.com/distribution/
Run the installer with the default options. Run the installer with the default options.
**Warning:** Even if you already have Anaconda installed, we recommend that you download it again and re-install it to make sure you have the latest version of the packages. **Warning:** Even if you already have Anaconda installed, we recommend that you download it again and re-install it to make sure you have the latest version of the packages.
## 2. Install the notebook extensions ## 2. Install the notebook extensions
On **Windows**, open an "Anaconda prompt" (type "Anaconda prompt" in search in Windows 10, or look for it in the program menu): On **Windows**, open an "Anaconda prompt" (type "Anaconda prompt" in search in Windows 10, or look for it in the program menu):
<img src="anaconda_prompt_windows.png" width=50%></img> <img src="resource/asnlib/public/Course_Information_anaconda_prompt_windows.png" width=40%></img>
On **MacOS**, open a "Teminal" app (use "Spotlight Search" and type "Terminal"): On **MacOS**, open a "Teminal" app (use "Spotlight Search" and type "Terminal"):
<img src="mac_terminal.png" width=40%></img> <img src="resource/asnlib/public/Course_Information_mac_terminal.png" width=40%></img>
At the command line of the terminal, run the following command by copy-pasting in the text and typing "enter": At the command line of the terminal, run the following command by copy-pasting in the text and typing "enter":
`conda install -c conda-forge jupyter_contrib_nbextensions` `conda install -c conda-forge jupyter_contrib_nbextensions`
When it is done, you can close the terminal, or you can leave it open for the next step. When it is done, you can close the terminal, or you can leave it open for the next step.
## 3. Start a jupyter notebook server ## 3. Start a jupyter notebook server
From the "Anaconda prompt" (in windows) or from "Terminal" (on MacOS), run the following command: From the "Anaconda prompt" (in windows) or from "Terminal" (on MacOS), run the following command:
`jupyter notebook` `jupyter notebook`
This will start the notebook server and automatically open a tab in your web browser sending you to the (local) web address of the notebook server running on your computer, showing you the files in your home directory: This will start the notebook server and automatically open a tab in your web browser sending you to the (local) web address of the notebook server running on your computer, showing you the files in your home directory:
<img width=70% src="notebook_server.png"><img> <img width=70% src="resource/asnlib/public/Course_Information_notebook_server.png"><img>
If you close your browser, you can always use this link to get back to your local notebook server: If you close your browser, you can always use this link to get back to your local notebook server:
http://localhost:8888/ http://localhost:8888/
You should leave the terminal running and minimize the window. You should leave the terminal running and minimize the window.
## 4. Enable the "Table of Contents" notebook extension ## 4. Enable the "Table of Contents" notebook extension
The notebooks for the Python Practicum course use the "Table of contents" notebook extension to make enable section numbers and tables of contents. (The notebooks will work fine without them, but you will miss the table of contents button in the toolbar and you will miss the section numbering.) The notebooks for the Python Practicum course use the "Table of contents" notebook extension to make enable section numbers and tables of contents. (The notebooks will work fine without them, but you will miss the table of contents button in the toolbar and you will miss the section numbering.)
To enable it, go to the notebook server home page: To enable it, go to the notebook server home page:
http://localhost:8888/ http://localhost:8888/
Click on the "Nbextensions" tab: Click on the "Nbextensions" tab:
<img src="nbextensions.png" width=50%></img> <img src="resource/asnlib/public/Course_Information_nbextensions.png" width=50%></img>
Make sure that this box is not clicked: Make sure that this box is not clicked:
<img src="disable_box.png" width=50%></img> <img src="resource/asnlib/public/Course_Information_disable_box.png" width=50%></img>
<p> And enable the "Table of Contents" extension: <p> And enable the "Table of Contents" extension:
<img src="enable_toc.png" width=50%></img> <img src="resource/asnlib/public/Course_Information_enable_toc.png" width=50%></img>
## Frequently asked questions ## Frequently asked questions
### My Jupyter server has crashed, link does not work ### My Jupyter server has crashed, link does not work
If the link http://localhost:8888 does not work, your server may have crashed (or may be running on a different port if you accidentally started muliple servers). If the link http://localhost:8888 does not work, your server may have crashed (or may be running on a different port if you accidentally started muliple servers).
If this is the case, you should go back to the Anaconda prompt window it was running in and do the following: If this is the case, you should go back to the Anaconda prompt window it was running in and do the following:
1. Type `Ctrl-C` 1. Type `Ctrl-C`
2. Run the command `jupyter notebook stop` 2. Run the command `jupyter notebook stop`
3. Run the command `jupyter notebook start` 3. Run the command `jupyter notebook start`
If you cannot find the Anaconda prompt window anymore, you can also open a new Anaconda prompt window and do steps 2 and 3 above. If you cannot find the Anaconda prompt window anymore, you can also open a new Anaconda prompt window and do steps 2 and 3 above.
### My files are not in my home directory, how do I get to them? ### My files are not in my home directory, how do I get to them?
If your files are stored outside of your home directory, for example if they are on your D: drive in windows, you will have to first change directories in the Anaconda prompt to that folder before you run the command `jupyter notebook`. If your files are stored outside of your home directory, for example if they are on your D: drive in windows, you will have to first change directories in the Anaconda prompt to that folder before you run the command `jupyter notebook`.
For example, let's say your files are on the D: drive in a folder `D:\Python\Practicum`. First you should stop the notebook server (see steps 1 and 2 of "Restarting a notebook server") and then you can use the following commands in the Anaconda prompt: For example, let's say your files are on the D: drive in a folder `D:\Python\Practicum`. First you should stop the notebook server (see steps 1 and 2 of "Restarting a notebook server") and then you can use the following commands in the Anaconda prompt:
* `d:` * `d:`
* `cd Python` * `cd Python`
* `jupyter notebook` * `jupyter notebook`
This will start a notebook server with the "root directory" as `D:\Python`, which will allow you to access all the files in subfolders of `D:\Python`. This will start a notebook server with the "root directory" as `D:\Python`, which will allow you to access all the files in subfolders of `D:\Python`.
### Why is my web browser going to http://localhost:8889/ (instead of 8888)? ### Why is my web browser going to http://localhost:8889/ (instead of 8888)?
This can happen when you (accidentally) open multiple notebook servers. You can list all the notebook servers that are running using the following command at the Anaconda prompt: This can happen when you (accidentally) open multiple notebook servers. You can list all the notebook servers that are running using the following command at the Anaconda prompt:
`jupyter notebook list` `jupyter notebook list`
You can then close any extra ones you don't want by using the `stop` command with their "port" number (the four numbers after "localhost"). For example, to stop one running on port 8889, use: You can then close any extra ones you don't want by using the `stop` command with their "port" number (the four numbers after "localhost"). For example, to stop one running on port 8889, use:
`jupyter notebook stop 8889` `jupyter notebook stop 8889`
......
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Python in the practicum # Python in the practicum
## Overview ## Overview
As part of the "Inleidend Practicum" course, you will have 5 lectures in which we will teach you the basics of programming with python. As part of the "Inleidend Practicum" course, you will have 5 lectures in which we will teach you the basics of programming with python.
For doing this, we have created a set of 5 "Lecture Notebooks", with the topics: For doing this, we have created a set of 5 "Lecture Notebooks", with the topics:
* **Notebook 1: Python Basics** * **Notebook 1: Python Basics**
* **Notebook 2: Functions** * **Notebook 2: Functions**
* **Notebook 3: Program Flow Control** * **Notebook 3: Program Flow Control**
* **Notebook 4: Scientific Computing with Numpy** * **Notebook 4: Scientific Computing with Numpy**
* **Notebook 5: Data in Python** * **Notebook 5: Data in Python**
For the material of Notebooks 1-3, we have an assignment connected to each notebook, and for Notebooks 4 and 5, there will be a final project that will cover the material in those notebooks: There are also to additional notebooks: one with advice on good coding practices, and one on "Advanced programming concepts" for those that are interested:
* **Assignment 1 (Must pass)** * **Good coding practices**
* **Assignment 2 (Must pass)** * **Advanced programming concepts**
* **Assignment 3 (Must pass)**
* **Final Project (100%)**
The assignments will be checked in class. You must have completed and passed the three assignments in order to be allowed to submit your final project. **Good coding practices** is a short notebook that you should read and apply in your assignments. **Advanced programming concepts** is optional in this course.
For the material of Notebooks 1-3, we have an assignment connected to each notebook, and for Notebooks 4 and 5, there will be a final project applying what you have learned to data analysis. The python component of this course makes up 15% of your final grade. Each of the assignments will count for 3 points out of 15 towards your python grade component, and the final project will count for 6 points of 15.
* **Assignment 1 (3 points)** Due date: Tuesday, 8 Sep at 17.59
* **Assignment 2 (3 points)** Due date: Tuesday, 15 Sep at 17.59
* **Assignment 3 (3 points)** Due date: Tuesday, 22 Sep at 17.59
* **Final Project (6 points)** Due date: Friday, 25 Sep at 17.59
The assignments must be submitted before the assigned deadlines by using the "Submit" button in Vocareum.
## Platform
You will be working in an online cloud-based computing platform called "Vocareum". You will access Vocareum through the links that will be created in the brightspace course page.
There will be information available in the course MS Teams "Python" channel about how to use Vocareum.
## Pace ## Pace
While there are 5 lectures and 5 notebooks, we encourage you to work at your own pace through the material. More experienced programmers may cover the material more quickly, perhaps with more than one notebook worth of material per lecture, while those with less (or no) programming experience may want to go through the material more slowly and finish the material at home. While there are 5 lectures and 5 notebooks, we encourage you to work at your own pace through the material. More experienced programmers may cover the material more quickly, perhaps with more than one notebook worth of material per lecture, while those with less (or no) programming experience may want to go through the material more slowly and finish the material at home.
## Final Grade You should make sure, however, that you cover the material at a sufficient pace that you do not miss the deadlines for the assignments.
Your python grade will count for 18% of the practicum grade (1ECTS). You grade will be determined by the final project, but your project will only be graded if you have passed all three assignments, which must be checked by a TA or lecturer in the lecture sessions (more on this below).
## What do I do with the "Lecture" notebooks? ## What do I do with the "Lecture" notebooks?
The lecture notebooks explain the concepts of the material we expect you to learn. They contain both "information" sections for you to read, as well as "code sections" that you can run to demonstrate these concepts live. The lecture notebooks explain the concepts of the material we expect you to learn. They contain both "information" sections for you to read, as well as "code sections" that you can run to demonstrate these concepts live.
At the top of each notebook, we have created a summary of the learning objectives we aim to achieve. At the top of each notebook, we have created a summary of the learning objectives we aim to achieve.
What should I do? You should first take a look at the learning objectives at the top of the notebook to understand what we want to achieve, then you can read through the learning material and execute the code cells to see what happens. What should I do? You should first take a look at the learning objectives at the top of the notebook to understand what we want to achieve, then you can read through the learning material and execute the code cells to see what happens.
The notebooks also contain exercises where you can test what you have learned. Some are easy, some are a bit trickier: if you get stuck with the exercises, you should not hesitate to ask a fellow student, a TA, or a lecturer for help. The notebooks also contain exercises where you can test what you have learned. Some are easy, some are a bit trickier: if you get stuck with the exercises, you should not hesitate to ask a fellow student, a TA, or a lecturer for help.
Try it yourself! Feel free to add code cells to the notebook (using the "Insert" menu) to try things out. If you find something you don't understand, you are always welcome to ask a TA or a lecturer to have a look. Try it yourself! Feel free to add code cells to the notebook (using the "Insert" menu) to try things out. If you find something you don't understand, you are always welcome to ask a TA or a lecturer to have a look.
## Assignment Notebooks ## Assignments
For lectures 1-3, there are "Assignment Notebooks" which we will ask you to complete. For lectures 1-3, there are "Assignment Notebooks" which we will ask you to complete.
The Assignment notebooks are designed to test if you have learned and understood the material from the lecture notebooks and have achieved the learning objective we have defined. Once you think you have mastered the material of the lecture notebooks and have played with writing code in the Try it yourself code cells and the exercise cells, you should move on to the Assignment Notebooks. The Assignment notebooks are designed to test if you have learned and understood the material from the lecture notebooks and have achieved the learning objective we have defined. Once you think you have mastered the material of the lecture notebooks and have played with writing code in the Try it yourself code cells and the exercise cells, you should move on to the Assignment Notebooks.
For the assignment notebooks, you should write your answer in the provided cells. When you think you have the correct answers, bring your laptop to a TA or lecturer and have them check your code. If you code is correct and you can explain it properly, then the TA will approve your completion of that assignment and you be marked as a "Pass". Your assignments will be submitted via Vocareum, and **must be submitted before the submission deadline**. In the week of October 5th, there will be short 10 minute examinations with the teaching assistants to determine your grade. In this examination, you will sit with a TA for 5 minutes, quickly demonstrate your code, and explain what the code does. The TA will then take 5 minutes on their own to assess the following criteria:
Our pass criteria are:
* The code achieves what is asked in the question * The code achieves what is asked in the question
* The student is able to explain what the code is doing to the TA * The student is able to explain what the code is doing to the TA
* The code cells contains comments explaining what it is doing * The code cells contains comments explaining what it is doing
If the TA determines that your assignment has not satisfied these criteria, then you can continue to work on it and have it checked again when you think it is correct. A more detailed rubric for the assessment of assignments 1-3 will be made public when ready.
Before the TA marks your assignment as a "Pass", you will be required to upload that code to the appropriate assignment folder on Brightspace.
The assignments must be checked and approved by a TA before the following deadlines:
* Assignment 1: End of session P3
* Assignment 2: End of session P4
* Assignment 3: End of session P5
Individual exceptions are possible for reasons such as illness in discussion with the lecturers.
### Am I allowed to ask for help? ### Am I allowed to ask for help?
Yes, of course! You are welcome to ask the teacher, the TAs, and other students for help with both the material in the Lecture Notebooks and in the Assignment Notebooks. Yes, of course! You are welcome to ask the teacher, the TAs, and other students for help with both the material in the Lecture Notebooks and in the Assignment Notebooks.
Note that the TAs will be happy to help you "debug" your code and point you in the right direction, they will not give you the answers to the assignment questions. Note that the TAs will be happy to help you "debug" your code and point you in the right direction, they will not give you the answers to the assignment questions.
### Am I allowed to copy my friends code? ### Am I allowed to copy my friends code?
No! While we encourage you to ask fellow students for help, you are not allowed to directly cut-and-paste they code (or copy their notebook files). At the end of the course, we will be performing a specialized plagiarism scan (designed for computer code) on the submitted assignments and any anomalies will be investigated. No! While we encourage you to ask fellow students for help, you are not allowed to directly cut-and-paste they code (or copy their notebook files). At the end of the course, we will be performing a specialized plagiarism scan (designed for computer code) on the submitted assignments and any anomalies will be investigated.
## Final Project ## Python Final Project
In addition to the assignments related to the core programming concepts, we will also have a final assignment that will determining your the final grade.
In this final assignment, you will load, process, plot and analyze a dataset using python. You will create a lab-report-style notebook in which you summarize your findings and you will submit this via Brightspace for grading by the TAs.
The final projects will be submitted via Brightspace in an assignment folder with a deadline announced per student group.
**Important:** Your final project will NOT be graded unless you have achieved a pass evaluation on all the assignments as described above.
%% Cell type:code id: tags:
``` python In addition to the assignments related to the core programming concepts, we will also have a final assignment that will be connected to the material of Lecture Notebooks 4 and 5 in which you will apply your python skills for loading, plotting, and analysing data. More information on the format and assessment of the Python Final Project will follow soon.
```
......
...@@ -5,14 +5,15 @@ jupyter: ...@@ -5,14 +5,15 @@ jupyter:
text_representation: text_representation:
extension: .md extension: .md
format_name: markdown format_name: markdown
format_version: '1.1' format_version: '1.2'
jupytext_version: 1.2.2 jupytext_version: 1.3.0
kernelspec: kernelspec:
display_name: Python 3 display_name: Python 3
language: python language: python
name: python3 name: python3
--- ---
<!-- #region -->
# Python in the practicum # Python in the practicum
## Overview ## Overview
...@@ -27,22 +28,34 @@ For doing this, we have created a set of 5 "Lecture Notebooks", with the topics: ...@@ -27,22 +28,34 @@ For doing this, we have created a set of 5 "Lecture Notebooks", with the topics:
* **Notebook 4: Scientific Computing with Numpy** * **Notebook 4: Scientific Computing with Numpy**
* **Notebook 5: Data in Python** * **Notebook 5: Data in Python**
For the material of Notebooks 1-3, we have an assignment connected to each notebook, and for Notebooks 4 and 5, there will be a final project that will cover the material in those notebooks: There are also to additional notebooks: one with advice on good coding practices, and one on "Advanced programming concepts" for those that are interested:
* **Assignment 1 (Must pass)** * **Good coding practices**
* **Assignment 2 (Must pass)** * **Advanced programming concepts**
* **Assignment 3 (Must pass)**
* **Final Project (100%)**
The assignments will be checked in class. You must have completed and passed the three assignments in order to be allowed to submit your final project. **Good coding practices** is a short notebook that you should read and apply in your assignments. **Advanced programming concepts** is optional in this course.
For the material of Notebooks 1-3, we have an assignment connected to each notebook, and for Notebooks 4 and 5, there will be a final project applying what you have learned to data analysis. The python component of this course makes up 15% of your final grade. Each of the assignments will count for 3 points out of 15 towards your python grade component, and the final project will count for 6 points of 15.
* **Assignment 1 (3 points)** Due date: Tuesday, 8 Sep at 17.59
* **Assignment 2 (3 points)** Due date: Tuesday, 15 Sep at 17.59
* **Assignment 3 (3 points)** Due date: Tuesday, 22 Sep at 17.59
* **Final Project (6 points)** Due date: Friday, 25 Sep at 17.59
The assignments must be submitted before the assigned deadlines by using the "Submit" button in Vocareum.
## Platform
You will be working in an online cloud-based computing platform called "Vocareum". You will access Vocareum through the links that will be created in the brightspace course page.
There will be information available in the course MS Teams "Python" channel about how to use Vocareum.
## Pace ## Pace
While there are 5 lectures and 5 notebooks, we encourage you to work at your own pace through the material. More experienced programmers may cover the material more quickly, perhaps with more than one notebook worth of material per lecture, while those with less (or no) programming experience may want to go through the material more slowly and finish the material at home. While there are 5 lectures and 5 notebooks, we encourage you to work at your own pace through the material. More experienced programmers may cover the material more quickly, perhaps with more than one notebook worth of material per lecture, while those with less (or no) programming experience may want to go through the material more slowly and finish the material at home.
## Final Grade You should make sure, however, that you cover the material at a sufficient pace that you do not miss the deadlines for the assignments.
Your python grade will count for 18% of the practicum grade (1ECTS). You grade will be determined by the final project, but your project will only be graded if you have passed all three assignments, which must be checked by a TA or lecturer in the lecture sessions (more on this below).
## What do I do with the "Lecture" notebooks? ## What do I do with the "Lecture" notebooks?
...@@ -56,31 +69,19 @@ The notebooks also contain exercises where you can test what you have learned. S ...@@ -56,31 +69,19 @@ The notebooks also contain exercises where you can test what you have learned. S
Try it yourself! Feel free to add code cells to the notebook (using the "Insert" menu) to try things out. If you find something you don't understand, you are always welcome to ask a TA or a lecturer to have a look. Try it yourself! Feel free to add code cells to the notebook (using the "Insert" menu) to try things out. If you find something you don't understand, you are always welcome to ask a TA or a lecturer to have a look.
## Assignment Notebooks ## Assignments
For lectures 1-3, there are "Assignment Notebooks" which we will ask you to complete. For lectures 1-3, there are "Assignment Notebooks" which we will ask you to complete.
The Assignment notebooks are designed to test if you have learned and understood the material from the lecture notebooks and have achieved the learning objective we have defined. Once you think you have mastered the material of the lecture notebooks and have played with writing code in the Try it yourself code cells and the exercise cells, you should move on to the Assignment Notebooks. The Assignment notebooks are designed to test if you have learned and understood the material from the lecture notebooks and have achieved the learning objective we have defined. Once you think you have mastered the material of the lecture notebooks and have played with writing code in the Try it yourself code cells and the exercise cells, you should move on to the Assignment Notebooks.
For the assignment notebooks, you should write your answer in the provided cells. When you think you have the correct answers, bring your laptop to a TA or lecturer and have them check your code. If you code is correct and you can explain it properly, then the TA will approve your completion of that assignment and you be marked as a "Pass". Your assignments will be submitted via Vocareum, and **must be submitted before the submission deadline**. In the week of October 5th, there will be short 10 minute examinations with the teaching assistants to determine your grade. In this examination, you will sit with a TA for 5 minutes, quickly demonstrate your code, and explain what the code does. The TA will then take 5 minutes on their own to assess the following criteria:
Our pass criteria are:
* The code achieves what is asked in the question * The code achieves what is asked in the question
* The student is able to explain what the code is doing to the TA * The student is able to explain what the code is doing to the TA
* The code cells contains comments explaining what it is doing * The code cells contains comments explaining what it is doing
If the TA determines that your assignment has not satisfied these criteria, then you can continue to work on it and have it checked again when you think it is correct. A more detailed rubric for the assessment of assignments 1-3 will be made public when ready.
Before the TA marks your assignment as a "Pass", you will be required to upload that code to the appropriate assignment folder on Brightspace.
The assignments must be checked and approved by a TA before the following deadlines:
* Assignment 1: End of session P3
* Assignment 2: End of session P4
* Assignment 3: End of session P5
Individual exceptions are possible for reasons such as illness in discussion with the lecturers.
### Am I allowed to ask for help? ### Am I allowed to ask for help?
...@@ -92,16 +93,7 @@ Note that the TAs will be happy to help you "debug" your code and point you in ...@@ -92,16 +93,7 @@ Note that the TAs will be happy to help you "debug" your code and point you in
No! While we encourage you to ask fellow students for help, you are not allowed to directly cut-and-paste they code (or copy their notebook files). At the end of the course, we will be performing a specialized plagiarism scan (designed for computer code) on the submitted assignments and any anomalies will be investigated. No! While we encourage you to ask fellow students for help, you are not allowed to directly cut-and-paste they code (or copy their notebook files). At the end of the course, we will be performing a specialized plagiarism scan (designed for computer code) on the submitted assignments and any anomalies will be investigated.
## Final Project ## Python Final Project
In addition to the assignments related to the core programming concepts, we will also have a final assignment that will determining your the final grade.
In this final assignment, you will load, process, plot and analyze a dataset using python. You will create a lab-report-style notebook in which you summarize your findings and you will submit this via Brightspace for grading by the TAs.
The final projects will be submitted via Brightspace in an assignment folder with a deadline announced per student group.
**Important:** Your final project will NOT be graded unless you have achieved a pass evaluation on all the assignments as described above.
```python
``` In addition to the assignments related to the core programming concepts, we will also have a final assignment that will be connected to the material of Lecture Notebooks 4 and 5 in which you will apply your python skills for loading, plotting, and analysing data. More information on the format and assessment of the Python Final Project will follow soon.
<!-- #endregion -->
%% Cell type:markdown id: tags:
# The Python Online Classroom in TN1405-P 2020/2021
Due to the circumstances, the course in the 2020/2021 academic year will be run primarily online. Fortunately there are many great tools that will enable you to learn online, work online, and intearct with us and each other online. Particularly for programming, this can be very effective.
For the python, there are three important online tools which we will use in the following way:
* **Brightspace / Vocareum:** Where you log in and work
* **Microsoft Teams:** A "virtual classroom"
* **Support Forum:** Where you can post questions both inside and outside of lecture hours
In the sections below, I will describe in a bit more detail how we will use them.
## Brightspace / Vocareum
This is where you we will post information and the material for you to work on. Vocareum is our cloud-based computing platform, and is accessed by links from inside Brightspace.
## Microsoft Teams
We will use Microsoft teams as an online classroom where you can work and interact with the teachers, the TAs, and with each other.
Microsoft teams is a "chat" based communications tool that organises discussions inside a "team" into "channels", similar to the platform discord (https://discord.com/) that some of you may be familiar with from online gaming communities.
For Python, the following channels are relevant:
* **Python:** Where I will post things like instructional videos and other information that is hard to post on brightsapce
* **Tafel 01-10:** Virtual "tables" where you can work with other students using text chat, video chat, posting images / screenshots, and sharing documents
* **TA gevraagd:** A channel where you can request "live" help from a TA during lecture hours by mentioning your table name
I will post a video in the Python Teams channel illustrating this in more detail.
The video support is quite handy, it allows screen sharing, and also allows you to let others control your screen for technical support emergencies.
You are welcome to "sit together" virtually on Teams whenever you want, also outside of lecture hours! However, the course team (TAs / teachers) will only provide support in Teams during official lecture hours.
## Support Forum
In addition, for python, we will also work with an external support forum:
https://tn1405-forum.quantumtinkerer.tudelft.nl/
You have all been sent an invitation to join the forum at your TU Delft student email address. Note you will have to create a separate password. (If you forget the password, it is easy to reset using your email address.)
The forum is a place where you can ask questions about the course material. **What is the difference between the forum and asking for help in teams?** There are three things:
* The answers the course team provide will be visible to everyone so that people who have a similar problem can already find the answer
* You might be able to get help from other students as well who had or are having similar problems
* **Questions in the forum will also be answered outside of office hours**
Some advice and ground rules:
* Don't be shy: just post. We will do our best to answer all questions politely and respectfully.
* Try to include as much info as you can in your post: details will help us figure out your problem. Posting error messages is highly valuable.
* **Don't post solution code to the assignments!** Question about problems with the assignment are welcome, but please formulate your questions in words. If we get stuck trying to figure it out, we will ask you to send the code to the course team in a personal message.
* When you post or reply, do your best to be polite and respectful: let's make this a comfortable place for everyone!