JupyterLab first impressions

I’m not new to the Python evolution from the c Python shell, to IPython, to IPython notebooks, to Jupyter, and now keeping a close eye on JupyterLab, an IDE currently is approaching Beta. I ran into Fernando Perez in San Francisco after BDFL Guido talk and told Fernando stories how a mentor of mine (RIP John Hunter) had shown me the IPython shell many years ago and I failed to notice the significance. I did end up using IPython shell. Soon after, I said the similar so-what thing to a Web Journalist Adrian Holovaty when he said he had created a web frame which later became Django Web Framework. I ended up using Django. I’ve learned my lesson and taken note this time and will pay better attention. All eyes are on JupyterLab. I hope to be an early adopter of JupyterLab and here is my first look!

wow Jupyter is hot

Installing

Fernando asked me if I had looked at the project. I embarrassedly mumbled something regarding watching commits on github. He rebutted, “just conda install it.” It’s no surprise many of the JupyterHub Creators like Chris Colbert are in fact Anaconda folks. So I did:

source activate py3k # my 'safe' conda environment
conda install -c conda-forge jupyterlab

So installed almost instantaneously:

jupyterlab: 0.29.1-py35_0 conda-forge
jupyterlab_launcher: 0.5.5-py35_0 conda-forge

To Run

jupyter lab

It’s alive, it’s alive, <insert evil laugh here>:

The startup looks pretty much the same as jupyter on the shell but now it is LabApp instead of NotebookApp.

PROS:

  • It already picked up all my installed kernels! Thank you!
  • Super clean interface with things where I expect them. Reminds me almost what Google would have done if you asked them to build an IDE
  • It’s a similar feel to jupyter notebooks.
  • I like the side bar. I always thought the top navigation on Jupyter notebooks left a lot of room for improvement.

CONS/ADVICE/FEATURE REQUESTS:

  • On the Launcher, I can’t read the labels for the different notebooks unless I mouse over. I see the names of the kernels are truncated. I would much prefer the names and some of the information about each display better. Since we inherently love conda environments, when used it would make sense to list the kernels under a sub-header for each environment.
  • This would have been a perfect time for a guided tour.

Observations

The Ghost of Jupyter Past

Of course, I want to ensure all the things I could do in Jupyter notebooks I can still do. A couple things changed on how to interact with the notebooks. Also note: the team intentionally made zero changes to the IPython notebook format or the notebook server. Both remain unchanged.

Short story: I love the changes. Long Story: I had to start thinking differently about how I work with the notebooks.

Let start with a notebook..

The OLD way File->NEW:

Full screen one notebook

The NEW way, hit the icon in the Launcher:

Notebook opens in Tab

The big differences are the notebooks are more Command Centric and Interactive.

Command Centric: Some of the shortcuts icons have gone, the file menu has removed context specific. JupyterLab seems to be encouraging using keyboard shortcut commands to get around.

TIP: Try (Accelerator key + Shift + C) to get to the command menu.

More of an artifact of being in a browser and having some of the commonly used key combinations already take, the key mappings are bit different from other text editors and IDEs. It’s awkward at first but may be customized and certainly quicker than using the mouse.

Interactive: Now you have them. They take space. Advantages include doing side by side editing or splitting in ways to allow WYSIWYG functionality. Having a clever layout where, for example, all at once you can view: your notebook, data, a command console, data browser and some graphical display(s) like a chart or plot.

The Ghost of JupyterLab Present

New and exciting

  • Mulit-tab in-browser environment
  • Collapse Cells
  • Drag and drop cells
  • Side by side editing (like markdown viewer below)
  • Console Editor
  • Single Document Mode
  • New File browser
  • File Grids + CSV viewer on Big Data
  • Image file viewing
Side by side markdown.

Extensions

jupyter labextension install <extension name>

Some notable extensions (please note: none of these are stable quite yet):

I never really tried any of these out. The Google-Drive one did not work (see github issue #103)

Phosphor JS
The JupyterLab [2] tutorial shows how to create extensions like those above. It reads:

The Phosphor library is used as the underlying architecture of JupyterLab and provides many of the low level primitives and widget structure used in the application. Phosphor provides a rich set of widgets for developing desktop-like applications in the browser, as well as patterns and objects for writing clean, well-abstracted code.

The Ghost of JupyterLab Future

The future is bright! Given the huge success of anything the Jupyter team touches and the huge community already surrounding, this will be a very active and very useful project. There are some potential pain points that will not go away soon like:

  • The comparison between other desired already complex IDE(s). See “How IDE is it?”
  • The team already accomplished loading CSV files faster than excel. See “How DataCentric is it?”
  • There will always be complexity between interacting with so many things in a web browser. See “How interactive is it?”
  • The group-ware or collaboration trend seen with github and google docs is clearly being addressed with the extensions, but will it work? See “How Interactive is it?”

How IDE is it?

There has been a joke forever regarding emacs being a good IDE lacking a text editor. Likewise VIM (I have been using for over a 2 decades) I saw one of the Jupyter developers post:

VIM Humor

Likewise the cult like level of sophistications in EMACs vs VIM has lasted about as long.

The reality of the matter is that there is some happy medium between text editor, IDE, and Data Science Workbenches is blurred. JupyterLab is one project that does the best at doing the largest range of things between: Text Editor, IDE, Visualizer, and Notebook.

How Data Centric is it?

Quickly load just CSV files

The Data Browser functionality is very slick and fast. I see some questions regarding interactivity with other data sources next. Some spin offs of Jupyter like Apache Zeppelin serve a specific purpose. Where to draw the line?

How Interactive is it?

Ref https://github.com/jovyan/pythreejs

Interacting with things in the browser is possible to some extent. We saw this notably with things like TensorBoard. There is a limit to how many data points can be displayed. Jupyter was able to do their databrowser without a pager. Can things like this be done with other types of data display?

How Collaborative is it?

There are two things that seem frontmost on making the Jupyter Lab collaborative: Google Drive and Github extensions. It’s undeniably a hard task. Let’s collaborating about collaborating about collaborating on JupyterLab!

There is no backend file for JupyterLab (See feature request “Save my workspace”).

Feature requests for the future

Save my workspace

There seems to be a couple interesting layout potentials here without a way to save them. This comes in useful when you want to share not just the notebooks but the way they are displayed in JupyterLab. Would there be a file format like ipynb for saved workspaces?

Debugging Code

Interactive direct and remote Debugging. I think back to the komodo IDE and adding the ability to remotely insert a breakpoint into code. I also recall using ipdb set_trace() vs plain bdb. Whenever I used an IDE, I expect breakpoints and a debugging panel to be built into the workspace. Is it possible to use the extensions to build such a thing? Has someone already done this?

I did see a ticket of visual debugger in github.

Shipping Code

I recall the troubles I ran into when trying to switch back and forth between writing .py files and calling those into my IPython notebook (At the time). There still is nothing as slick as it should be. For example how can I:

  • use the existing autoreload (or perhaps a better version)
  • keep a running log of what was changed and where (auto diff?)
  • package final versions of things up and commit/push to git
  • Should there be CI/CD system integration. For example automatic unit test result integration that calls out to Jenkins, goCD, or something internal?

Enhancements

Today (Nov 15, 2017) I checked and there are already over 240 enhancement requests on Github. A lot of them (most?) are things regarding the UI and how to interact (key bindings).

Summary

I’m extremely excited the potential of JupyterLab. I have a high level of confidence in the team who is making this possible. Thank you Jupyter steering council, Anaconda, NumFocus, UC Berkeley, CalPoly, the Python Community!

Appendix

Survey on Jupyter Usage

[2] JupyterLab Tutorial https://media.readthedocs.org/pdf/jlab/rtd-fix/jlab.pdf

Find more about Jupyter http://jupyter.org/about.html


Like what you read? Give Brian Ray a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.