README.md 2.14 KB
Newer Older
Paul McCarthy's avatar
readme  
Paul McCarthy committed
1
2
3
4
5
6
# 2018 WIN PyTreat


This repository contains Jupyter notebooks and data for the 2018 WIN PyTreat.


Paul McCarthy's avatar
Paul McCarthy committed
7
The upstream repository can be found at:
Paul McCarthy's avatar
Paul McCarthy committed
8
9

https://git.fmrib.ox.ac.uk/fsl/pytreat-2018-practicals
Paul McCarthy's avatar
readme  
Paul McCarthy committed
10
11
12
13


To contribute to the practicals:

Paul McCarthy's avatar
Paul McCarthy committed
14
1. Fork the upstream repository on gitlab
Paul McCarthy's avatar
readme  
Paul McCarthy committed
15

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

Paul McCarthy's avatar
Paul McCarthy committed
18
19
20
    ```
    git clone git@git.fmrib.ox.ac.uk:<username>/pytreat-2018-practicals
    ```
Paul McCarthy's avatar
Paul McCarthy committed
21
22
23

3. Add the upstream repository as a remote:

Paul McCarthy's avatar
Paul McCarthy committed
24
25
26
    ```
    git remote add upstream git@git.fmrib.ox.ac.uk:fsl/pytreat-2018-practicals.git
    ```
Paul McCarthy's avatar
Paul McCarthy committed
27
28
29
30
31

4. Make your changes on your local repository

5. Rebase onto the upstream repository, and push your changes to your fork:

Paul McCarthy's avatar
Paul McCarthy committed
32
33
    ```
    git fetch --all
Paul McCarthy's avatar
Paul McCarthy committed
34
35
    git rebase upstream/master
    git push --force origin master
Paul McCarthy's avatar
Paul McCarthy committed
36
    ```
Paul McCarthy's avatar
Paul McCarthy committed
37
38
39

6. In gitlab, submit a merge request from your fork back to the upstream
   repository.
Paul McCarthy's avatar
Paul McCarthy committed
40
41
42
43
44


To run these notebooks in the `fslpython` environment, you must first install
jupyter:

Paul McCarthy's avatar
Paul McCarthy committed
45

Paul McCarthy's avatar
Paul McCarthy committed
46
```
47
48
49
50
51
52
53
54
55
# If your FSL installation requires administrative privileges, then you MUST
# run these commands as root - don't just prefix each individual command with
# sudo!
#
# One further complication - once you have become root, $FSLDIR may not be set,
# so either set it as we have ione below, or make sure that it is set, before
# proceeding.
sudo su
export FSLDIR=/usr/local/fsl
Paul McCarthy's avatar
Paul McCarthy committed
56
57
58
59
60
61
62
63
64
65
source $FSLDIR/fslpython/bin/activate fslpython
conda install jupyter
pip install notedown
source deactivate
ln -s $FSLDIR/fslpython/envs/fslpython/bin/jupyter $FSLDIR/bin/fsljupyter
ln -s $FSLDIR/fslpython/envs/fslpython/bin/notedown $FSLDIR/bin/fslnotedown
```


> [`notedown`](https://github.com/aaren/notedown) is a handy tool which allows
Paul McCarthy's avatar
typo    
Paul McCarthy committed
66
> you to convert a markdown (`.md`) file to a Jupyter notebook (`.ipynb`)
Paul McCarthy's avatar
Paul McCarthy committed
67
68
> 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
Paul McCarthy's avatar
Paul McCarthy committed
69
70
71
72
> 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
73
> fslnotedown my_markdown_file.md > my_notebook.ipynb
Paul McCarthy's avatar
Paul McCarthy committed
74
> ```
Paul McCarthy's avatar
Paul McCarthy committed
75
76
77
78
79
80
81


Now you can start the notebook server from the repository root:

```
fsljupyter notebook
```