Using SoS interactively

There are a number of ways to use SoS interactively. Unless you are familiar with iPython console, Jupyter, or Spyder and already have a preferred method of working, the differences between these working environments can be confusing. The following table tries to list the characteristics of these methods to make it easier for you to get started.

ipython kernel + sos magic qtconsole editor + qtconsole jupyter notebook Spyder
Description Native ipython environments with SoS magic Console with sos kernel External editor with help from a console window Web interface with mixed scripts and results IDE with integrated editor and console
Good for ipython with separate sos environment Test small pieces of code Writing of serious SoS workflows with occasional need for testing Interactive data analysis with mixed scripts and results (notebook style) Interactive data analysis resulting in a complete script
Command line ipython, jupyter qtconsole, jupyter notebook with Python kernel, or spyder jupyter qtconsole --kernel sos jupyter qtconsole --kernel sos jupyter notebook with sos kernel spyder --kernel sos
kernel ipython with sos magic sos sos sos sos
Script editor Depends None Editor of your choice (e.g. vim) jupyter (web) Spyder (editor)
Enter commands via ipython command line qtconsole (enter command) qtconsole (copy/paste or %paste from editor) jupyter (web) Spyder (console)
Subkernel support No, but can use other iPython magic such as %%R Yes Yes Yes Yes
Preview support No Yes Yes Yes Yes
Variable Inspection No No No Yes (Alt-Tab) Yes (Variable Explorer)
Shell command Yes (through iPython) Yes (through sos) Yes Yes Yes
remote access If using Jupyter No No Yes through remote Jupyter server Yes if connects to remote Jupyter server
Magics Magics %sos, %sosdict, %sospaste, %sosget, %sosput, %sosset with ipython magics %with, %use, %paste, %set, %get, %preview, %run, %set, %restart, %dict, %cd, %sandbox, ... the same the same additional %edit magic

Basically, you can use

  • ipython + sos magic is not recommended unless you are a diehard iPython user and make extensive use of its other features. learn more
  • An editor + qtconsole if you strongly prefer a certain editor (vim) learn more.
  • qtconsole if you just want to play with sos for a bit learn more.

but most of you would prefer

  • Jupyter if you like its web interface and how it integrates input and results. learn more
  • Spyder if you like an IDE with separate editor and console windows learn more

In [ ]: