Skip to content

Short talk demonstrating some functionality of ob-ipython.

License

Notifications You must be signed in to change notification settings

ebarcikowski/ob-ipython-intro

Repository files navigation

ob-ipython Introduction

Synopsis

This project generates a talk that I gave to the Salt Lake City Python Meetup group on January 10th, 2018 to show off the functionality of ob-ipython and org-mode. The vision was to generate the actual presentation with ob-ipython and org-mode that does a minimal analysis and transition between the source and the slides to show how ob-ipython works.

Honestly, I’m not sure how well it worked and was certainly too much for a 10 minute talk. But, it does demonstrate a lot of functionality of ob-ipython and its ability to maintain notes and documentation without the need to context switch from your day to day software development.

If you want to get an idea of what a workflow with ob-ipython and Org could look like, this could be interesting. Also, if you’re looking for examples of running ob-ipython, there could be some good stuff here as well.

To make use of this talk, it will probably be most useful to look at the generated PDF and the Org document in separate windows and try to feel for how Org mode, combined with ob-ipython, could be useful for note taking.

In my opinion, ob-ipython is an excellent way to maintain notes and figures of an on-going analysis. I personally prefer it to Jupyter notebooks as Org documents feel more natural to write and fit better into source control.

Getting Started

Emacs Setup

I have included an emacs directory that should setup a minimal emacs environment to generate this talk. To use it, simply back up your current .emacs.d directory and link the included emacs directory to that location. On startup, Emacs should run an init script and download all the packages that are needed to generate the talk.

Python Setup

For ob-ipython, you’ll need jupyter, ipython, jupyter_console, and jupyter_client. To reproduce the analysis in the talk, you’ll need matplotlib, numpy, pandas, scipy, statsmodels, and the pykalman module. All of these can be installed using the included requirements.txt.

Simply run,

pip3 install -r requirements.txt

This will work fine in a virtual environment, just make sure you load it before launching Emacs, or use Emacs tools (to load the virtual environment.

This was done with Python 3.6. I have don’t know if you’ll have any luck with Python 2.

Tips for non-Emacs Users

If you have everything installed correctly, you can generate the talk by by executing the emacs function, org-beamer-export-to-pdf. Emacs functions can be found by typing M-x and typing the start of the command.

An ipython block can be executed with C-c C-c. Try to to edit a block and regenerate a figure or piece of analysis.

ob-ipython (and Org) can use a lot of boiler-plate, this can be remedied with Emacs snippets. I’ve include on for ipython blocks. Simply type py followed with a Tab. You can then tab through options for figures and other parameters.

Resources

If you are interested in using Org or ob-ipython, you’ll need to look this documentation.

Org

All of the ob-ipython stuff in here is built on Org mode. I have found Org to be extremely useful and use it everyday.

Babel

Babel is a system of running source code inside Org. ob-ipython is effectively a Babel extension.

ob-ipython

Here’s the ob-ipython documentation.

Beamer

I personally have never used Beamer until this talk. This Beamer example was critical!

Kalman Analysis

The analysis method presented in this presentation was taken from the following page.

About

Short talk demonstrating some functionality of ob-ipython.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published