• Stars
    star
    157
  • Rank 230,471 (Top 5 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created about 8 years ago
  • Updated over 5 years ago

Reviews

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

Repository Details

A tool that supports one-button reproducible workflows with the Jupyter Notebook and Scons.

NBFlow

Build Status Binder

A tool that supports one-button reproducible workflows with the Jupyter Notebook and Scons. Note: this currently only supports Python kernels.

UPDATE: Scons >= 3.0.0 now supports Python 3 so Python 2 isn't needed anymore! Now Nbflow and Scons are both Python 2 and 3 compatible so you can choose whichever you want.

The actual version of Scons (3.0.1) currently supports Python >= 3.5, which is the default in Ubuntu 16.04

Installation

To install, run:

Linux:

pip3 install git+git://github.com/jhamrick/nbflow.git

Windows:

pip install git+git://github.com/jhamrick/nbflow.git

Usage

For a complete example of how to use nbflow, check out the example in this repository.

You can now you Binder to check the example online:

  1. Entre in Binder here or through the badge above
  2. Open a terminal
  3. Run cd nbflow/example
  4. Run scons
  5. Check the results in the results directory

Optionally you can modify the notebook in this online environment and check how the results change.

Analysis notebooks

For each notebook that you want executed, you MUST include two special variables in the first code cell:

  • __depends__ -- a list of relative paths to files that the notebook depends on
  • __dest__ -- either a relative path, or list of relative paths, to files that the notebook produces

For example, the first cell in one of the example notebooks is:

__depends__ = ["../results/data.json"]
__dest__ = "../results/stats.json"

SConstruct file

You need a SConstruct file in the root of you analysis directory. In this SConstruct file you will need to import nbflow and use it to setup your scons environment, e.g.:

import os
from nbflow.scons import setup

env = Environment(ENV=os.environ)
setup(env, ["analyses"])

The second argument of the setup command takes a list of folder names that contain analysis notebooks.

Running nbflow

Once you have setup your analysis notebooks and your SConstruct file, you can run your notebooks by just running the scons command from the root of your analysis directory.

More Repositories

1

emacs

Emacs configuration files
Emacs Lisp
248
star
2

gutenbach

A networked music jukebox implementing the Internet Printing Protocol (IPP)
CSS
40
star
3

dbtools

Tools for interfacing with SQLite databases
Python
34
star
4

plotchecker

A set of utilities for checking and grading matplotlib plots
Python
33
star
5

nbgrader-demo

Short demo of nbgrader
Jupyter Notebook
24
star
6

original-nbgrader

IPython nbconvert preprocessor for grading notebooks
Python
18
star
7

git-annex-tutorial

15
star
8

python-snippets

Useful python code snippets.
Python
14
star
9

dodona

Technical question answering NLP bot
JavaScript
14
star
10

gaussian_processes

Python library for working with gaussian processes
Python
13
star
11

bayesian-quadrature

Bayesian quadrature
Python
13
star
12

python-course

Python tutorials for scientific computing
Python
11
star
13

blog

Source code for http://www.jesshamrick.com/
Jupyter Notebook
10
star
14

pystoch

Stochastic Python
Python
10
star
15

nbflow-example

Toy example of using nbflow with a complex dependency chain
Jupyter Notebook
9
star
16

quals

Reading lists and notes for my qualifying exam
Jupyter Notebook
9
star
17

pycon-2014-talk

Slides for "Games for Science: Creating interactive psychology experiments in Python with Panda3D"
JavaScript
8
star
18

mental-rotation-experiment-cogsci2014

Code to run the mental rotation experiment from Hamrick & Griffiths (2014).
JavaScript
5
star
19

docker-oauthenticator

Uses a combination of local users and GitHub OAuth to authenticate users. Users can be created on the host system from within the docker container.
Python
3
star
20

shepard-metzler-stimuli

Scripts for generating and rendering stimuli like those from Shepard & Metzler (1971)
Python
3
star
21

block-towers

Python
2
star
22

script-snippets

Small, useful scripts.
Python
2
star
23

scipy-2015-slides

Slides for my talk on JupyterHub and education at SciPy 2015
HTML
2
star
24

optimal-mental-rotation

A project looking at optimal experiment design for mental rotation tasks.
Jupyter Notebook
2
star
25

sigcse-2016-slides

Slides for my SIGCSE 2016 Demo on nbgrader
HTML
1
star
26

one-and-done-physics-cogsci-2015

TeX
1
star
27

2015-07-17-jupyterday

JupyterHub presentation for the 07/17/2015 JupyterDay
JavaScript
1
star
28

mental-rotation-slides-cogsci2014

Slides from the CogSci 2014 talk on the paper "What to simulate? Inferring the right direction for mental rotation"
JavaScript
1
star