README.md 3.18 KB
Newer Older
Paul McCarthy's avatar
Paul McCarthy committed
1
# 2020 WIN PyTreat
Paul McCarthy's avatar
readme  
Paul McCarthy committed
2
3


Paul McCarthy's avatar
Paul McCarthy committed
4
This repository contains Jupyter notebooks and data for the 2020 WIN PyTreat.
Paul McCarthy's avatar
Paul McCarthy committed
5
6
7
8
It contains the following:

- The `talks` directory contains some (but not all) of the _Topyc_ talks that
  will be given throughout the week.
9
10
11
12
13
14
15
16
17
18
19

- The `getting_started` directory contains a series of practicals intended
  for those of you who are new to the Python programming language, or need
  a refresher.

- The `advanced_topics` directory contains a series of practicals on various
  aspects of the Python programming language - these are intended for those
  of you who are familiar with the basics of Python, and want to learn more
  about the language.


Paul McCarthy's avatar
Paul McCarthy committed
20
The practicals have been written under the assumption that FSL 6.0.3 is
21
22
23
24
25
26
installed.


## For attendees


27
These notebooks can be run in the `fslpython` environment using:
28
29
30


```
Paul McCarthy's avatar
Paul McCarthy committed
31
32
git clone git@git.fmrib.ox.ac.uk:fsl/pytreat-practicals-2020.git
cd pytreat-practicals-2020
33
fslpython -m notebook
34
35
36
```


Paul McCarthy's avatar
Paul McCarthy committed
37
38
39
40
41
42
Throughout the week we might make changes to this repository. When this
happens, we will ask you to update your local clone of the repository with the
following command:


```
Paul McCarthy's avatar
Paul McCarthy committed
43
git stash save
Paul McCarthy's avatar
Paul McCarthy committed
44
git pull origin master
Paul McCarthy's avatar
Paul McCarthy committed
45
git stash pop
Paul McCarthy's avatar
Paul McCarthy committed
46
47
48
```


49
50
51
52
Have fun!


## For contributors
Paul McCarthy's avatar
readme  
Paul McCarthy committed
53
54


Paul McCarthy's avatar
Paul McCarthy committed
55
The main repository can be found at:
Paul McCarthy's avatar
Paul McCarthy committed
56

Paul McCarthy's avatar
Paul McCarthy committed
57
https://git.fmrib.ox.ac.uk/fsl/pytreat-practicals-2020
Paul McCarthy's avatar
readme  
Paul McCarthy committed
58
59


Paul McCarthy's avatar
Paul McCarthy committed
60
61
62
63
Updates to the master branch should occur via merge requests. You can choose
to either work on a fork of this repository, or on a branch in this
repository. To contribute to the practicals using a fork:

Paul McCarthy's avatar
readme  
Paul McCarthy committed
64

Paul McCarthy's avatar
Paul McCarthy committed
65
1. Fork the upstream repository on gitlab
Paul McCarthy's avatar
readme  
Paul McCarthy committed
66

Paul McCarthy's avatar
Paul McCarthy committed
67
2. Make a local clone of your fork:
Paul McCarthy's avatar
readme  
Paul McCarthy committed
68

Paul McCarthy's avatar
Paul McCarthy committed
69
    ```
Paul McCarthy's avatar
Paul McCarthy committed
70
    git clone git@git.fmrib.ox.ac.uk:<username>/pytreat-practicals-2020
Paul McCarthy's avatar
Paul McCarthy committed
71
    ```
Paul McCarthy's avatar
Paul McCarthy committed
72
73
74

3. Add the upstream repository as a remote:

Paul McCarthy's avatar
Paul McCarthy committed
75
    ```
Paul McCarthy's avatar
Paul McCarthy committed
76
    git remote add upstream git@git.fmrib.ox.ac.uk:fsl/pytreat-practicals-2020.git
Paul McCarthy's avatar
Paul McCarthy committed
77
    ```
Paul McCarthy's avatar
Paul McCarthy committed
78
79
80

4. Make your changes on your local repository

Paul McCarthy's avatar
Paul McCarthy committed
81
5. Push your changes to your fork:
Paul McCarthy's avatar
Paul McCarthy committed
82

Paul McCarthy's avatar
Paul McCarthy committed
83
    ```
Paul McCarthy's avatar
Paul McCarthy committed
84
    git push origin master
Paul McCarthy's avatar
Paul McCarthy committed
85
    ```
Paul McCarthy's avatar
Paul McCarthy committed
86
87
88

6. In gitlab, submit a merge request from your fork back to the upstream
   repository.
Paul McCarthy's avatar
Paul McCarthy committed
89
90


Paul McCarthy's avatar
Paul McCarthy committed
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Or, to contribute via a branch:

1. Make a local clone of the repository:

    ```
    git clone git@git.fmrib.ox.ac.uk:fsl/pytreat-practicals-2020
    ```

2. Create a branch for your work:

    ```
    git checkout -b my_cool_branch origin/master
    ```

3. Make your changes on this branch.

4. Push your changes to the gitlab repository:

    ```
    git push origin my_cool_branch
    ```

5. In gitlab, submit a merge request from your branch onto the master
   branch.


117
You may also wish to install
118
[`notedown`](https://github.com/aaren/notedown):
Paul McCarthy's avatar
Paul McCarthy committed
119

Paul McCarthy's avatar
Paul McCarthy committed
120
```
121
source $FSLDIR/fslpython/bin/activate fslpython
Paul McCarthy's avatar
Paul McCarthy committed
122
123
pip install notedown
source deactivate
124
fslpython -m notedown
Paul McCarthy's avatar
Paul McCarthy committed
125
126
127
ln -s $FSLDIR/fslpython/envs/fslpython/bin/notedown $FSLDIR/bin/fslnotedown
```

128
129
130
131
132
`notedown` is a handy tool which allows you to convert a markdown (`.md`) file
to a Jupyter notebook (`.ipynb`) file. So you can write your practical in your
text editor of choice, and then convert it into a notebook, instead of writing
the practical in the web browser interface. If you install notedown as
suggested in the code block above, you can run it on a markdown file like so:
Paul McCarthy's avatar
Paul McCarthy committed
133
134
135


```
136
fslnotedown my_markdown_file.md > my_notebook.ipynb
Paul McCarthy's avatar
Paul McCarthy committed
137
```