• Stars
    star
    140
  • Rank 261,473 (Top 6 %)
  • Language
    Jupyter Notebook
  • License
    Other
  • Created over 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Numba tutorial materials for Scipy 2016

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.

  1. Installation
  2. Optional extras
  3. Check your installation

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.

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.

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.

Installing with conda

Option a) Create a new environment

Download the environment.yml file in the root of this repository, e.g.

wget https://raw.githubusercontent.com/barbagroup/numba_tutorial_scipy2016/master/environment.yml

and then create the environment with

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

source activate numbatutorial

or on Windows:

activate numbatutorial

Option b) Install the required packages

conda install jupyter ipython numpy numba line_profiler matplotlib
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

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

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

pip install numpy matplotlib jupyter ipython numba line_profiler 

or

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.

conda install cython dask
pip install cython dask

We recommend you also install the Jupyter notebook extensions.

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

Once they are installed, start a notebook server

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).

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

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

More Repositories

1

CFDPython

A sequence of Jupyter notebooks featuring the "12 Steps to Navier-Stokes" http://lorenabarba.com/
Jupyter Notebook
3,404
star
2

AeroPython

Classical Aerodynamics of potential flow using Python and Jupyter Notebooks
Jupyter Notebook
925
star
3

PetIBM

PetIBM - toolbox and applications of the immersed-boundary method on distributed-memory architectures
C++
103
star
4

cuIBM

cuIBM: a GPU-based immersed boundary method code.
Cuda
88
star
5

FMM_tutorial

A step-by-step introduction to treecode.
Jupyter Notebook
55
star
6

AmgXWrapper

AmgXWrapper: An interface between PETSc and the NVIDIA AmgX library
C++
42
star
7

essential_skills_RRC

Essential skills for reproducible research computing
Jupyter Notebook
39
star
8

snake-repro

An article reporting the travails of reproducibility in unsteady CFD studies
Jupyter Notebook
26
star
9

jupyter-tutorial

"The world of Jupyter"โ€”a tutorial
Jupyter Notebook
21
star
10

teaching-materials

Jupyter Notebook
21
star
11

petrbf

Automatically exported from code.google.com/p/petrbf
Makefile
21
star
12

pyrbf

Automatically exported from code.google.com/p/pyrbf
C
10
star
13

fmm-bem-relaxed

Source code for the paper on inexact Krylov iterations with FMM BEM
C++
10
star
14

pyfmm

Automatically exported from code.google.com/p/pyfmm
Python
9
star
15

AeroPython-studentprojects2015

Student projects for the Spring 2015 MAE 6226 class at GW
Jupyter Notebook
9
star
16

gemsfmm

Automatically exported from code.google.com/p/gemsfmm
Cuda
9
star
17

MG_tutorial

Multigrid Tutorial (based on W.L. Briggs, V.E. Henson and S.F. McCormick, A Multigrid Tutorial, 2nd. ed., SIAM, Philadelphia, 2000)
Python
9
star
18

cloud-repro

Reproducible workflow on a public cloud for computational fluid dynamics
Jupyter Notebook
9
star
19

jcs_paper_pinn

PINN paper that will be submitted to Journal of Computational Science
TeX
8
star
20

pipe_verification

OpenFoam example of pipe flow and result comparison with analytical solution of Hagen-Poiseuille flow
Jupyter Notebook
8
star
21

inexact-gmres

Paper: inexact GMRES with fast multipole method and low-p relaxation
TeX
8
star
22

JITcode-MechE

Online learning modules to learn computing in a problem-based context within Mechanical Engineering
Jupyter Notebook
7
star
23

geoclaw-landspill

An oil land-spill and overland flow simulator for pipeline rupture events
Fortran
7
star
24

bibtex

TeX
6
star
25

bempp_exafmm_paper

Manuscript repository for our research paper, including reproducibility packages for all results, and latex source files.
Jupyter Notebook
6
star
26

AeroPython-studentprojects2017

Jupyter Notebook
5
star
27

petibm-rollingpitching

3D rolling and pitching flat plate with PetIBM
Python
3
star
28

land-spill

TeX
3
star
29

geoclaw-azure-launcher

Helpers for launching GeoClaw land-spill simulations on Azure.
Python
3
star
30

AeroPython-studentprojects2018

Jupyter Notebook
3
star
31

pygbe_lspr_paper

GLSL
3
star
32

legate-evaluation

Legate evaluation reports
2
star
33

pygbe_lspr

GLSL
2
star
34

DirectForcingMethod

Python
2
star
35

petibm-examples

Collection of the PetIBM examples
Python
2
star
36

scipy-2022-repro-pack

Reproducibility package for SciPy 2022
Python
2
star
37

chuang-dissertation-repro-pack

Python
2
star
38

snake-lips-2d

2d cfd study (PetIBM on Azure) on the lateral lips of a gliding snake
Python
1
star
39

snake-lips

Numerical study of the effect of the lips on the aerodynamics of the gliding snake
Python
1
star
40

petibm-recipes

Collection of Dockerfiles and Singularity recipes for PetIBM
Dockerfile
1
star
41

JITcode-MechE-Workbook

CSS
1
star
42

geoclaw-landspill-paper

Python
1
star
43

pygbe_lspr_proposal

Porposal on using PyGBe to develop LSPR (Localized Surface Plasmon Resonance) applications.
1
star
44

pygbe_validation_paper

Paper on Validation for PyGBe and replication studies.
Jupyter Notebook
1
star
45

conferences

TeX
1
star
46

rescience-rollingpitching

Manuscript for ReScience C about the replication study on the pitching and rolling wing
TeX
1
star
47

PASI2013

Lessons based on a Pan-American Advanced Studies Institute "The science of predicting and understanding tsunamis, storm surges and tidal phenomena"
CSS
1
star
48

Caminos

"Data Science for a Better World"โ€”A tutorial for the GW Caminos al Futuro Summer program
Jupyter Notebook
1
star