From e5438eb9e160657c4fa67b17616f93e965813dcd Mon Sep 17 00:00:00 2001 From: "behinger (s-ccs 001)" Date: Wed, 13 Sep 2023 14:22:46 +0000 Subject: [PATCH] moving things --- cheatsheets/git.qmd | 0 cheatsheets/githubactions.qmd | 0 cheatsheets/julia.qmd | 0 installation/julia.qmd | 0 installation/vscode.qmd | 0 material/1_mon/envs/envs_handout.qmd | 8 ++--- .../1_mon/firststeps/firststeps_handout.qmd | 31 +++++++++++++++---- schedule.qmd | 25 +-------------- 8 files changed, 30 insertions(+), 34 deletions(-) create mode 100644 cheatsheets/git.qmd create mode 100644 cheatsheets/githubactions.qmd create mode 100644 cheatsheets/julia.qmd create mode 100644 installation/julia.qmd create mode 100644 installation/vscode.qmd diff --git a/cheatsheets/git.qmd b/cheatsheets/git.qmd new file mode 100644 index 0000000..e69de29 diff --git a/cheatsheets/githubactions.qmd b/cheatsheets/githubactions.qmd new file mode 100644 index 0000000..e69de29 diff --git a/cheatsheets/julia.qmd b/cheatsheets/julia.qmd new file mode 100644 index 0000000..e69de29 diff --git a/installation/julia.qmd b/installation/julia.qmd new file mode 100644 index 0000000..e69de29 diff --git a/installation/vscode.qmd b/installation/vscode.qmd new file mode 100644 index 0000000..e69de29 diff --git a/material/1_mon/envs/envs_handout.qmd b/material/1_mon/envs/envs_handout.qmd index e53170a..7440cdd 100644 --- a/material/1_mon/envs/envs_handout.qmd +++ b/material/1_mon/envs/envs_handout.qmd @@ -6,13 +6,13 @@ # Environments -### What is a environment** +### What is a environment - A list of "installed" packages^[libraries, dlls, .so etc.] at certain versions - sometimes includes the operation system ### **Reproducible** vs. **Replicable** - Reproducible: Someone else can get the same results given your code + data - Replicable: Someone else can repeat the whole study on new data +- **Reproducible**: Someone else can get the same results given your code + data +- **Replicable**: Someone else can repeat the whole study on new data ### Why do I need it? - Version control @@ -27,7 +27,7 @@ -## Environemnts in Julia +## Environments in Julia Every folder with an `Project.toml` file has it's own environment (see below) The "base" environment is active by default: diff --git a/material/1_mon/firststeps/firststeps_handout.qmd b/material/1_mon/firststeps/firststeps_handout.qmd index 72e517a..7c01e6e 100644 --- a/material/1_mon/firststeps/firststeps_handout.qmd +++ b/material/1_mon/firststeps/firststeps_handout.qmd @@ -9,12 +9,12 @@ The [julia manual](https://docs.julialang.org/en/v1/manual/getting-started/) is excellent! ::: -At this point we assume that you have Julia 1.9 installed, VSCode ready, and installed the VSCode Julia plugin. There are some more [recommended settings in VSCode](vscode.qmd) which are not necessary, but helpful. +At this point we assume that you have [Julia 1.9 installed](../../../installation/vscode.qmd), VSCode ready, and installed the VSCode Julia plugin. There are some more [recommended settings in VSCode](../../../installation/vscode.qmd) which are not necessary, but helpful. We further recommend to not use the small "play" button on the top right (which opens a new julia process everytime you change something), but rather open a new Julia repl (`ctrl`+`shift`+`p` => `>Julia: Start Repl`) which you keep open as long as possible. ::: callout-tip -VSCode automatically loads the `Revise.jl` package, which screens all your actively loaded packages/files and updates the methods instances whenever it detects a change. This is quite similar to `%autorelad 2` in python. If you use VSCode, you dont need to think about it, if you prefer a command line, you should put Revise.jl in your startup.jl file. +VSCode automatically loads the `Revise.jl` package, which screens all your actively loaded packages/files and updates the methods instances whenever it detects a change. This is quite similar to `%autorelad 2` in ipython. If you use VSCode, you dont need to think about it, if you prefer a command line, you should put Revise.jl in your startup.jl file. ::: @@ -69,7 +69,11 @@ Each of those has a specific purpose, but most likely we will only need `a = not myfunction(0,5;keyword1 = "notdefault") ``` 1. everything before the `;` => positional, after => `kwargs` -2. returns two functions, due to the `b=123` optional positional argument +2. List all methods with that function name - returns two functions, due to the `b=123` optional positional argument + +:: callout-tip +## Terminology function vs. method +Methods are instantiations of a abstract `function` ```julia anonym = (x,y) -> x+y @@ -83,8 +87,22 @@ function mylongfunction(x) end ``` +```julia +myfunction(args...;kwargs...) = myotherfunction(newarg,args...;kwargs...) +``` + +#### Excourse: splatting & slurping +Think of it as unpacking / collecting something + +```julia +a = [1,2,3] ++(a) ++(a...) # <1> +``` +1. equivalent to `+(1,2,3)` + #### elementwise-function / broadcasting -Julia is very neat in regards of applying functions elementwise (also called broadcasting). (Matlab users know this already). +Julia is very neat in regards of applying functions elementwise (also called broadcasting). ```julia a = [1,2,3,4] @@ -139,7 +157,7 @@ And a nice sideeffect: by doing this, we get rid of any specialized "serialized" | variables | lowercase, lower_case| | Types,Modules | UpperCamelCase| | functions, macro | lowercase | -| inplace / side-effects | `endwith!()` | +| inplace / side-effects | `endwith!()`^[A functionname ending with a `!` indicates that inplace operations will occur / side-effects are possible. This is convention only, but in 99% of cases adopted] | # Task 1 Ok - lot of introduction, but I think you are ready for your first interactive task. @@ -335,7 +353,8 @@ once defined, a type-definition in the global scope of the REPL cannot be re-def ::: # Task 2 -Follow [Task 2 here](tasks.qmd#2) ) +Follow [Task 2 here](tasks.qmd#2) + # Julia Basics III ## Modules ```julia diff --git a/schedule.qmd b/schedule.qmd index 0604719..bfa3440 100644 --- a/schedule.qmd +++ b/schedule.qmd @@ -1,27 +1,4 @@ --- title: "Schedule" --- - -::: callout-note -The schedule is very preliminary and will most likely change drastically :) -::: - -| | Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | -|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -| | Arrival | Basics of RSE and Julia | Julia+RSE | Julia+Viz+Simulation | Stats + Projects | Optimization + Project | -| | | | | | | | -| 09.00 | | | **Benjamin**: Advanced Git / Contributing (1+1) | **Hendrik**: All the nice Julia Features (1+1)? | **Marco** Resampling: Bootstrap & Permutation tests (2+2) | **Doug**: Optimized (bootstrap) code (1)? | -| 10.00 | | **Benjamin**: Welcome / What and why RSE? (1) | **Benjamin/Bene**: Unittests (1+1) | **Bene** Vizualization in Julia (1+1) | \~\~\~ | Project Work | -| 11.00 | | **Hendrik**: Why Julia? (1)? | \~\~\~\~ | \~\~\~ | | cont. | -| 12.00 | | **Bene**: First Steps - "Hello World" + Types (1+1) | \~\~\~\~ | \~\~\~ | | | -| 13.00 | | **Lunch** | **Lunch** | **Lunch** | **Lunch** | **Lunch** | -| 14.00 | | \~\~\~ | **Benjamin**: Continuous Integration (1+1) | **Lisa**: Simulating Data (1+1) | Project Work | Project Work | -| 15.00 | | **Bene**: Julia + Git + Packages/Environments (1+1) | **Lisa**: Code-Review (1+1)? | \~\~\~ | | cont. | -| 16.00 | | \~\~\~ | \~\~\~ | **Doug**: Things to keep in mind for datastorage (1+1)? | | | -| 17.00 | | **Bene**: MyFirstPackage.jl (1+1) | \~\~\~ | \~\~\~ | | Farewell | -| 18.00 | | \~\~\~ | **Bene**: PkgTemplates.jl (0.5+0.5) =\> wed/hendrik? | \~\~\~ | | | -| 19.00 | Pre-Get-together | Welcome-BBQ \@ SimTech | Social 1 | Social 2 | Social 3 | | - -: {.striped .hover} - -Missing Topics right now: Documentation, License, MultipleRegression? Simulating Data - Requirements regarding regression? \ No newline at end of file +![Summerschool Schedule](https://www.simtech.uni-stuttgart.de/img/events/Summer-School/Flyer_Programm_langes_Format_2308010.png) \ No newline at end of file