Skip to content

Commit

Permalink
Connect to prior knowledge
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Jan 16, 2024
1 parent ca424b5 commit d82f1c1
Show file tree
Hide file tree
Showing 11 changed files with 678 additions and 26 deletions.
78 changes: 78 additions & 0 deletions docs/afternoon_session/command_line_arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,84 @@ In this session, we practice this,
going through the problems and errors that occur
when you want to 'just want to run the stupid code'.

```mermaid
flowchart TD
python[[Python]]
%% Give a white background to all nodes, instead of a transparent one
classDef node fill:#fff,color:#000,stroke:#000
subgraph sub_programming_language[Programming language]
interpreted_language[Interpreted language]
programming_language[Programming language]
scripting_language[Scripting language]
interpreter[Interpreter]
scripts[Scripts]
text_files[Text files]
end
style sub_programming_language fill:#ccf,color:#000,stroke:#fcc
subgraph sub_programming_terms[Programming terms]
user_input[User input]
file_io[File I/O]
command_line_arguments[Command-line arguments]
variables[Variables]
operators[Operators]
%% functions[Functions]
python_packages[Python packages]
graphics[Graphics]
end
style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc
subgraph sub_uppmax[UPPMAX]
uppmax[UPPMAX]
uppmax_modules[UPPMAX modules]
uppmax_clusters[UPPMAX clusters]
text_editors[Text editors]
x_forwarding[X-forwarding]
remote_desktop[Remote desktop]
end
style sub_uppmax fill:#fcc,color:#000,stroke:#fcc
python --> |is a| programming_language
python --> |is a| interpreted_language
python --> |is a| scripting_language
programming_language --> |uses| text_files
interpreted_language --> |has a| interpreter
scripting_language --> |is|interpreted_language
scripting_language --> |runs| scripts
scripts --> |are| text_files
scripts --> |can use| command_line_arguments
python --> |has| python_packages
python --> |has| variables
%%python --> |has| functions
python --> |has| operators
%%functions --> |use| variables
operators --> |work on| variables
python_packages --> |allow| graphics
python_packages --> |allow to use| user_input
python_packages --> |allow to do| file_io
python_packages --> |allow to use| command_line_arguments
uppmax --> |has| uppmax_clusters
uppmax_clusters --> |have| uppmax_modules
uppmax_clusters --> |have| text_editors
uppmax_clusters --> |allow| x_forwarding
uppmax_clusters --> |has| remote_desktop
uppmax_modules --> |allow the use of| python_packages
uppmax_modules --> |allow the use of| interpreter
text_editors --> |work on|text_files
x_forwarding --> |allows|graphics
remote_desktop --> |allows|graphics
variables ~~~ uppmax
```


## Exercises

### Exercise 1: Read the command-line arguments
Expand Down
77 changes: 77 additions & 0 deletions docs/afternoon_session/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,83 @@ Most programmers need to work on data and produce some result.
In Python, we -of course- can read from files and write to files.
Here we do just that.

```mermaid
flowchart TD
python[[Python]]
%% Give a white background to all nodes, instead of a transparent one
classDef node fill:#fff,color:#000,stroke:#000
subgraph sub_programming_language[Programming language]
interpreted_language[Interpreted language]
programming_language[Programming language]
scripting_language[Scripting language]
interpreter[Interpreter]
scripts[Scripts]
text_files[Text files]
end
style sub_programming_language fill:#ccf,color:#000,stroke:#fcc
subgraph sub_programming_terms[Programming terms]
user_input[User input]
file_io[File I/O]
%% command_line_arguments[Command-line arguments]
variables[Variables]
operators[Operators]
%% functions[Functions]
python_packages[Python packages]
graphics[Graphics]
end
style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc
subgraph sub_uppmax[UPPMAX]
uppmax[UPPMAX]
uppmax_modules[UPPMAX modules]
uppmax_clusters[UPPMAX clusters]
text_editors[Text editors]
x_forwarding[X-forwarding]
remote_desktop[Remote desktop]
end
style sub_uppmax fill:#fcc,color:#000,stroke:#fcc
python --> |is a| programming_language
python --> |is a| interpreted_language
python --> |is a| scripting_language
programming_language --> |uses| text_files
interpreted_language --> |has a| interpreter
scripting_language --> |is|interpreted_language
scripting_language --> |runs| scripts
scripts --> |are| text_files
%% scripts --> |can use| command_line_arguments
python --> |has| python_packages
python --> |has| variables
%%python --> |has| functions
python --> |has| operators
%%functions --> |use| variables
operators --> |work on| variables
python_packages --> |allow| graphics
python_packages --> |allow to use| user_input
python_packages --> |allow to do| file_io
%% python_packages --> |allow to use| command_line_arguments
uppmax --> |has| uppmax_clusters
uppmax_clusters --> |have| uppmax_modules
uppmax_clusters --> |have| text_editors
uppmax_clusters --> |allow| x_forwarding
uppmax_clusters --> |has| remote_desktop
uppmax_modules --> |allow the use of| python_packages
uppmax_modules --> |allow the use of| interpreter
text_editors --> |work on|text_files
x_forwarding --> |allows|graphics
remote_desktop --> |allows|graphics
variables ~~~ uppmax
```

## Exercises

### Exercise 1: create a simple text file
Expand Down
80 changes: 80 additions & 0 deletions docs/afternoon_session/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,86 @@

## Overview

Sometime you need to do a same multi-line calculation multiple times in your code.
Instead of copy-pasting, one can use a so-called 'function'
to bundle a calculation is something that can be reused.

```
flowchart TD
python[[Python]]
%% Give a white background to all nodes, instead of a transparent one
classDef node fill:#fff,color:#000,stroke:#000
subgraph sub_programming_language[Programming language]
interpreted_language[Interpreted language]
programming_language[Programming language]
scripting_language[Scripting language]
interpreter[Interpreter]
scripts[Scripts]
text_files[Text files]
end
style sub_programming_language fill:#ccf,color:#000,stroke:#fcc
subgraph sub_programming_terms[Programming terms]
user_input[User input]
file_io[File I/O]
command_line_arguments[Command-line arguments]
variables[Variables]
operators[Operators]
functions[Functions]
python_packages[Python packages]
graphics[Graphics]
end
style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc
subgraph sub_uppmax[UPPMAX]
uppmax[UPPMAX]
uppmax_modules[UPPMAX modules]
uppmax_clusters[UPPMAX clusters]
text_editors[Text editors]
x_forwarding[X-forwarding]
remote_desktop[Remote desktop]
end
style sub_uppmax fill:#fcc,color:#000,stroke:#fcc
python --> |is a| programming_language
python --> |is a| interpreted_language
python --> |is a| scripting_language
programming_language --> |uses| text_files
interpreted_language --> |has a| interpreter
scripting_language --> |is|interpreted_language
scripting_language --> |runs| scripts
scripts --> |are| text_files
scripts --> |can use| command_line_arguments
python --> |has| python_packages
python --> |has| variables
python --> |has| functions
python --> |has| operators
functions --> |use| variables
operators --> |work on| variables
python_packages --> |allow| graphics
python_packages --> |allow to use| user_input
python_packages --> |allow to do| file_io
python_packages --> |allow to use| command_line_arguments
uppmax --> |has| uppmax_clusters
uppmax_clusters --> |have| uppmax_modules
uppmax_clusters --> |have| text_editors
uppmax_clusters --> |allow| x_forwarding
uppmax_clusters --> |has| remote_desktop
uppmax_modules --> |allow the use of| python_packages
uppmax_modules --> |allow the use of| interpreter
text_editors --> |work on|text_files
x_forwarding --> |allows|graphics
remote_desktop --> |allows|graphics
variables ~~~ uppmax
```

## Exercises

Expand Down
77 changes: 77 additions & 0 deletions docs/afternoon_session/graphics.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,83 @@ Sometimes one wants to make a plot, such like a scatterplot or barchart.
Matplotlib is a popular Python package to make plots.
Here we experience how easy/hard it is to use Matplotlib on Rackham.

```mermaid
flowchart TD
python[[Python]]
%% Give a white background to all nodes, instead of a transparent one
classDef node fill:#fff,color:#000,stroke:#000
subgraph sub_programming_language[Programming language]
interpreted_language[Interpreted language]
programming_language[Programming language]
scripting_language[Scripting language]
interpreter[Interpreter]
scripts[Scripts]
text_files[Text files]
end
style sub_programming_language fill:#ccf,color:#000,stroke:#fcc
subgraph sub_programming_terms[Programming terms]
user_input[User input]
file_io[File I/O]
command_line_arguments[Command-line arguments]
variables[Variables]
operators[Operators]
%% functions[Functions]
python_packages[Python packages]
graphics[Graphics]
end
style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc
subgraph sub_uppmax[UPPMAX]
uppmax[UPPMAX]
uppmax_modules[UPPMAX modules]
uppmax_clusters[UPPMAX clusters]
text_editors[Text editors]
x_forwarding[X-forwarding]
remote_desktop[Remote desktop]
end
style sub_uppmax fill:#fcc,color:#000,stroke:#fcc
python --> |is a| programming_language
python --> |is a| interpreted_language
python --> |is a| scripting_language
programming_language --> |uses| text_files
interpreted_language --> |has a| interpreter
scripting_language --> |is|interpreted_language
scripting_language --> |runs| scripts
scripts --> |are| text_files
scripts --> |can use| command_line_arguments
python --> |has| python_packages
python --> |has| variables
%%python --> |has| functions
python --> |has| operators
%%functions --> |use| variables
operators --> |work on| variables
python_packages --> |allow| graphics
python_packages --> |allow to use| user_input
python_packages --> |allow to do| file_io
python_packages --> |allow to use| command_line_arguments
uppmax --> |has| uppmax_clusters
uppmax_clusters --> |have| uppmax_modules
uppmax_clusters --> |have| text_editors
uppmax_clusters --> |allow| x_forwarding
uppmax_clusters --> |has| remote_desktop
uppmax_modules --> |allow the use of| python_packages
uppmax_modules --> |allow the use of| interpreter
text_editors --> |work on|text_files
x_forwarding --> |allows|graphics
remote_desktop --> |allows|graphics
variables ~~~ uppmax
```

## Exercises

### Exercise 1: Use matplotlib to show a plot
Expand Down
Loading

0 comments on commit d82f1c1

Please sign in to comment.