Skip to content

Commit

Permalink
Update README and install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth committed Jun 29, 2017
1 parent e9054d3 commit c5c3b54
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 88 deletions.
108 changes: 28 additions & 80 deletions README.md
@@ -1,6 +1,7 @@
# Numba: Tell those C++ bullies to get lost
# Numba: Tell those C++ bullies to get lost

This is the repository for the Scipy 2016 tutorial. The tutorial will be presented as a set of Jupyter notebooks with exercises sprinkled throughout.
This is the repository for the Scipy 2017 tutorial. The tutorial will be
presented as a set of Jupyter notebooks with exercises sprinkled throughout.

1. [Installation](#installation-instructions)
2. [Optional extras](#optional-extras)
Expand All @@ -9,21 +10,23 @@ This is the repository for the Scipy 2016 tutorial. The tutorial will be presen

# Installation Instructions

We _strongly_, *strongly*, __strongly__ encourage you to use `conda` to install the required packages for this tutorial. There are non-Python dependencies required that make manual installation or installing with `pip` very involved.
We _strongly_, *strongly*, __strongly__ encourage you to use `conda` to install
the required packages for this tutorial. There are non-Python dependencies
required that make manual installation or installing with `pip` very involved.

Note also that this tutorial is written for Python 3.5. Most things will still work on Python 3.4. No guarantees of any kind are made that it will be compatible with Python 2.
Note also that this tutorial is written for Python 3.6. Most things will still
work on Python 3.4+.

## Regarding `matplotlib`

This tutorial uses the Viridis colormap pretty much everywhere we can use a colormap. This colormap was first made available in matplotlib 1.5.0. Please upgrade if you have an earlier version installed.
*No guarantees of any kind are made that it will be
compatible with Python 2.*

## Installing with `conda`

### Option a) Create a new environment
Download the `environment.yml` file in the root of this repository, e.g.

```console
wget https://raw.githubusercontent.com/barbagroup/numba_tutorial_scipy2016/master/environment.yml
wget https://raw.githubusercontent.com/gforsyth/numba_tutorial_scipy2017/master/environment.yml
```

and then create the environment with
Expand All @@ -34,7 +37,7 @@ conda env create -f environment.yml

This will create a conda environment named `numbatutorial` with all of the required packages.

You can activate the environment with
You can activate the environment with

```console
source activate numbatutorial
Expand All @@ -45,105 +48,50 @@ or on Windows:
activate numbatutorial
```

### Option b) Install the required packages
### Option b) Install the required packages

```console
conda install jupyter ipython numpy numba line_profiler matplotlib
```

```console
pip install line_profiler
```

**Note**: Do not use `conda` to install `line_profiler`; the version available in `conda` default channels is out of date.



## Installing with `pip`

To install (specifically) Numba using `pip`, you need to have LLVM 3.7 installed on your machine with both libraries and header files.

### Prerequisites

#### Ubuntu / Debian

You should be able to do a

```console
sudo apt-get install llvm-3.7-dev
```

You may also need to install `libedit-dev`

#### Windows
You can follow instructions here for getting LLVM installed on Windows.

http://llvm.org/docs/GettingStartedVS.html

#### OSX

Install XCode which includes LLVM

### Install `llvmlite`

If your `llvm-config` (or `llvm-config.exe`) file is in a non-standard location, set the `LLVM_CONFIG` environment variable to point at the `llvm-config` binary.

Then

```console
pip install llvmlite
```

If that installed successfully then you can continue to install the rest of the dependencies (which are must less fussy)

### Install everything else

```console
pip install numpy matplotlib jupyter ipython numba line_profiler
```

or

```console
pip install -r requirements.txt
```

# Optional extras

No hands-on work requires these, but if you want to play with some of the examples. If you installed using either `environments.yml` or `requirements.txt` these are already installed.
No hands-on work requires these, but if you want to play with some of the
examples. If you installed using either `environments.yml` or `requirements.txt`
these are already installed.

```console
conda install cython dask
conda install cython
```

```console
pip install cython dask
pip install cython
```

We recommend you also install the Jupyter notebook extensions.
We recommend you also install the Jupyter notebook extensions.

```console
pip install https://github.com/ipython-contrib/IPython-notebook-extensions/archive/master.zip --user
```

Once they are installed, start a notebook server
Once they are installed, start a notebook server

```console
jupyter notebook
```

and (assuming port 8888) navigate to `http://localhost:8888/nbextensions` where you can choose which extensions to enable. One that is helpful (for us!) when using Numba in the notebook is the `Skip-Traceback` extension. You're welcome to enable whichever extensions you like (we're also fans of `Codefolding` and the `Comment/Uncomment Hotkey`).
and (assuming port 8888) navigate to `http://localhost:8888/nbextensions` where
you can choose which extensions to enable. One that is helpful (for us!) when
using Numba in the notebook is the `Skip-Traceback` extension. You're welcome to
enable whichever extensions you like (we're also fans of `Codefolding` and the
`Comment/Uncomment Hotkey`).

# Check Installation

Once you have downloaded all of the requires libraries/packages, you can run the `check_install.py` script to confirm that everything is working as expected. Either download the file directly or clone this repository and then run
Once you have downloaded all of the requires libraries/packages, you can run the
`check_install.py` script to confirm that everything is working as expected.
Either download the file directly or clone this repository and then run

```console
python check_install.py
```

# Video of the live tutorial

Check out the video of the live tutorial at SciPy 2016 (filmed Monday 11 July).

[![vid](./slides/tutorial-vid.png)](https://youtu.be/SzBi3xdEF2Y)
8 changes: 4 additions & 4 deletions check_install.py
Expand Up @@ -18,14 +18,14 @@ def check_versions():
version_trouble=False
numba = importlib.import_module('numba')
numba_version = tuple_version(numba.__version__)
if numba_version < (0, 26, 0):
print('Please update Numba to version 0.26.0')
if numba_version < (0, 33, 0):
print('Please update Numba to version 0.33.0')
version_trouble=True

mpl = importlib.import_module('matplotlib')
mpl_version = tuple_version(mpl.__version__)
if mpl_version < (1, 5, 0):
print('Please update matplotlib to version 1.5.0 or higher')
if mpl_version < (2, 0, 0):
print('Please update matplotlib to version 2.0.0 or higher')
version_trouble=True

return version_trouble
Expand Down
8 changes: 4 additions & 4 deletions environment.yml
@@ -1,10 +1,10 @@
name: numbatutorial
dependencies:
- python=3.5
- python=3.6
- numpy
- matplotlib
- numba=0.26.0
- numba
- jupyter
- ipython
- pip:
- line-profiler==2.0
- line-profiler
- cython

0 comments on commit c5c3b54

Please sign in to comment.