ipython: a modern vision of interactive computing (pydata sv 2013)

38
IPython Open Source Academia Wrapup IPython A modern vision of interactive computing Fernando Pérez http://fperez.org, @fperez_org [email protected] Henry H. Wheeler Jr. Brain Imaging Center, UC Berkeley PyData 2013, Silicon Valley March 20, 2013

Upload: pydata

Post on 26-Jan-2015

116 views

Category:

Technology


1 download

DESCRIPTION

Slides for a talk given by Fernando Pérez at PyData Silicon Valley 2013

TRANSCRIPT

Page 1: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython Open Source Academia Wrapup

IPythonA modern vision of interactive computing

Fernando Pérezhttp://fperez.org, @fperez_org

[email protected]

Henry H. Wheeler Jr. Brain Imaging Center, UC Berkeley

PyData 2013, Silicon ValleyMarch 20, 2013

Page 2: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython Open Source Academia Wrapup

Outline

1 IPython: Interactive Python

2 The Life of an Open Source Project

3 Academia vs Open Source

4 Wrapup

FP (UC Berkeley) IPython 3/20/13 2 / 34

Page 3: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

In the beginning, IBM said...

Let there be FORTRAN

Page 4: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

In the beginning, IBM said...

Let there be FORTRAN

Page 5: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Beyond (Floating Point) Number Crunching

Hardwarefloating point

Arbitrary precisionintegers

Rationals

Interval arithmetic

Symbolic manipulation

FORTRAN

Extended precisionfloating point

Text processing

Databases

Graphical userinterfaces

Web interfacesHardwarecontrol

Multi-languageintegration

Data formats: HDF5, XML, ...

Page 6: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

The purpose of computing is insight, not numbers.

Richard Hamming, 1962

Page 7: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython Open Source Academia Wrapup

The computer as microscope

Exploratory: Problem’s definition evolves as we understand it.No ‘requirements’ to build an application against.Mathematica, Maple, Matlab, IDL, etc.

All have an interactive environment.

Applications Languages

FP (UC Berkeley) IPython 3/20/13 6 / 34

Page 8: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython: part of a Rich Ecosystem

IPython

NetworkX

Page 9: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython Open Source Academia Wrapup

The Lifecycle of a Scientific Idea (schematically)

1 Individual exploratory work2 Collaborative development3 Parallel production runs (HPC, cloud, ...)4 Publication (with reproducible results!)5 Education6 Goto 1.

The Problem with most toolsBarriers and discontinuities in workflow in between all the steps

FP (UC Berkeley) IPython 3/20/13 8 / 34

Page 10: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython Open Source Academia Wrapup

The Lifecycle of a Scientific Idea (schematically)

1 Individual exploratory work2 Collaborative development3 Parallel production runs (HPC, cloud, ...)4 Publication (with reproducible results!)5 Education6 Goto 1.

The Problem with most toolsBarriers and discontinuities in workflow in between all the steps

FP (UC Berkeley) IPython 3/20/13 8 / 34

Page 11: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython’s goal:Fluid transitions in all these steps

Page 12: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Demo

Page 13: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython Open Source Academia Wrapup

Pillar #1: An architecture for interactive computing

FP (UC Berkeley) IPython 3/20/13 11 / 34

Page 14: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython Open Source Academia Wrapup

Pillar #2: the Notebook Format

JSON but version control-friendlyEasy for machine processing, fixable by hand if need be.Lots of hooks for metadataNot Python-specific (Ruby, JS notebooks exist, R, Julia planned)Produce Markdown, reST, LATEX, HTML, etc...

An open format for sharing, publishing andarchiving executable computational work

FP (UC Berkeley) IPython 3/20/13 12 / 34

Page 15: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython Open Source Academia Wrapup

Outline

1 IPython: Interactive Python

2 The Life of an Open Source Project

3 Academia vs Open Source

4 Wrapup

FP (UC Berkeley) IPython 3/20/13 13 / 34

Page 16: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Documented protocols and formats:a growing ecosystem around IPython

Page 17: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

An Emacs Notebook Client!Takafumi Arakaki

http://tkf.github.com/emacs-ipython-notebook

Page 18: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Microsoft Visual Studio 2010 integrated consoleDino Viehland and Shahrokh Mortazavi (Microsoft)

http://pytools.codeplex.com

Page 19: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

A vim client to control an IPython kernel/consolePaul Ivanov (Berkeley)

https://github.com/ivanov/vim-ipython

Page 20: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Notebooks on Windows Azure CloudShahrokh Mortazavi (Microsoft), B.G., F.P.

http://bit.ly/JQeojD

Page 21: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Star Cluster: IPython parallel+Notebook on Amazon EC2Justin Riley (MIT)

http://web.mit.edu/star/cluster

Page 22: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

NBViewer: easy notebook sharingMatthias Bussonnier

http://nbviewer.ipython.org

Page 23: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Other projects using IPython

ScientificEPD: Enthought Python Distribution.Anaconda: Continuum Python Distribution.Sage: open source mathematics.PyRAF: Space Telescope Science InstituteCASA: Nat. Radio Astronomy ObservatoryGanga: CERNPyMAD: neutron spectrom., Laue LangevinSardana: European Synchrotron RadiationASCEND: eng. modeling (Carnegie Mellon).JModelica: dynamical systems.DASH: Denver Aerosol Sources and Health.Trilinos: Sandia National Lab.DoD: baseline configuration.NiPype: computational pipelines, MIT.PyIMSL Studio, by Visual Numerics.

...

Web/OtherVisual Studio 2010: MS.Django.Turbo Gears.Pylons web frameworkZope and Plone CMS.Axon Shell, BBCKamaelia.Schevo database.Pitz: distributedtask/bug tracking.iVR (interactive VirtualReality).Movable Python(portable Pythonenvironment)....

Page 24: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

How did we get here?A brief history of IPython

October 2001: “just a little afternoon hack”My own $PYTHONSTARTUP:

ipython-0.0.1.py: 259 lines.In [N]: prompts and _N results cache.

IPP (Interactive Python Prompt) by Janko Hauser (Oceanography)LazyPython by Nathan Gray (CS Caltech)

2002: Ignore John Hunter’s Gnuplot support patches... let there be matplotlib(actually finish my PhD!)

2005: Brian Granger, Min Ragan-KelleyFirst parallel tools, Twisted-based

2005-2008: Ville Vainio, Gaël Varoquaux, Laurent DufréchouCore maintenance, Wx integration.

Page 25: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Summer 2009: NIH-funded cleanup by Brian.March 2010: prototype networked shell using ØMQ

2-day sprint with Brian

Enthought funds Qt console. Min ports parallel code to ØMQCore architecture ready, foundation for Notebook

Fall 2010James Gao at Berkeley builds (5th!) Notebook Prototype.

Summer 2011Brian rebuids James’ prototype into today’s Notebook.

Page 26: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

An important plot

http://www.ohloh.net/p/ipython

Page 27: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

(Incomplete) Cast of CharactersBrian Granger - Physics, Cal State San Luis ObispoMin Ragan-Kelley - Nuclear Engineering, UC BerkeleyMatthias Bussonnier - Physics, Institut Curie, ParisBrad Froehle - Mathematics, UC BerkeleyPaul Ivanov - Neuroscience, UC Berkeley.Robert Kern - EnthoughtThomas Kluyver - Biology, U. SheffieldJonathan March- EnthoughtEvan Patterson - Physics, Caltech/EnthoughtJörgen Stenarson - Elect. Engineering, Sweden.Stefan van der Walt - UC BerkeleyJohn Hunter - TradeLink Securities, Chicago.Prabhu Ramachandran - Aerospace Engineering, IIT Bombay.Satra Ghosh- MIT NeuroscienceGaël Varoquaux - Neurospin (Orsay, France)Ville Vainio - CS, Tampere University of Technology, FinlandBarry Wark - Neuroscience, U. Washington.Ondrej Certik - Physics, U Nevada RenoDarren Dale - CornellJustin Riley - MITMark Voorhies - UC San FranciscoNicholas Rougier - INRIA Nancy Grand EstThomas Spura - Fedora projectMany more! (~220 commit authors)

Page 28: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython Open Source Academia Wrapup

Outline

1 IPython: Interactive Python

2 The Life of an Open Source Project

3 Academia vs Open Source

4 Wrapup

FP (UC Berkeley) IPython 3/20/13 26 / 34

Page 29: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Support at the edges of academic funding

Enthought, Austin, TX: Lots!Microsoft: WinHPC support, Visual Studio integration, Azure(thanks to Shahrokh Mortazavi).DoD/DRC Inc: funding through Sept. 2012 (thanks to JoseUnpingco and Chris Keees).NIH: via NiPy grantNSF: via Sage compmath grantGoogle: summer of code 2005, 2010.Tech-X Corp., Boulder, CO: Parallel/notebook (previous versions)Recent stable funding (2 years, 7 people, J. Taylor):

Page 30: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Open Source:skills, tools and practices we need!

A culture where things get done.Wildly collaborativeReproducible by necessityVersion control, testing, documentation, public peer review, etc.

Page 31: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

Reward Structure in academia:we punish all of the above

Departmental boundaries: interdisciplinary work is a great buzzword,not such a great career path.

Computational heritage is built on codenot on citations

Continuous evolution vs publication milestonesAuthorship in collaborative works vs the first-author paper.Scholarship and intellectual effort embedded in the code.

Page 32: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

NumFOCUS: Open Code, Better Science

Promote the health of our open source scientific computingecosystem

Support the development of multiple projects.Community-created and driven.A neutral ground for industry, academia and government to supportscientific open source.501(c)3 - donations are tax-exempt in the USA

http://numfocus.org

Page 33: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

IPython Open Source Academia Wrapup

Outline

1 IPython: Interactive Python

2 The Life of an Open Source Project

3 Academia vs Open Source

4 Wrapup

FP (UC Berkeley) IPython 3/20/13 31 / 34

Page 34: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

The future of IPython: a 2-year roadmap

Spring/summer 2013: IPython 1.0Notebook document management (nbconvert)JavaScript internals cleanup

Fall 2013Interactive JavaScript APIWith callbacks to remote kernels.

2014Multiuser serverSimple to deployTrusted (shell OK) Unix users in a lab, group, class, etc.

https://github.com/ipython/ipython/wiki/Roadmap:-IPython

Page 35: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

In closing: our vision of scientific computing

Build on the right abstractionsThe kernel: unify interactive and parallel computing

→ you only have one brain!

A single protocol: many kernels, many clients.Communications and logging

the protocol is the notebook file format.

Insight and communication (Hamming)“Literate computing” vs “literate programming”.

Build a community and an ecosystem“How to Scale a Code in the Human Dimension”, M. Turk,http://arxiv.org/abs/1301.7064.

Page 36: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

In closing: our vision of scientific computing

Build on the right abstractionsThe kernel: unify interactive and parallel computing

→ you only have one brain!

A single protocol: many kernels, many clients.Communications and logging

the protocol is the notebook file format.

Insight and communication (Hamming)“Literate computing” vs “literate programming”.

Build a community and an ecosystem“How to Scale a Code in the Human Dimension”, M. Turk,http://arxiv.org/abs/1301.7064.

Page 37: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

In closing: our vision of scientific computing

Build on the right abstractionsThe kernel: unify interactive and parallel computing

→ you only have one brain!

A single protocol: many kernels, many clients.Communications and logging

the protocol is the notebook file format.

Insight and communication (Hamming)“Literate computing” vs “literate programming”.

Build a community and an ecosystem“How to Scale a Code in the Human Dimension”, M. Turk,http://arxiv.org/abs/1301.7064.

Page 38: IPython: A Modern Vision of Interactive Computing (PyData SV 2013)

John D. Hunter, 1968-2012: http://matplotlib.orgMemorial fund: http://numfocus.org/johnhunter