Difference: IPython (1 vs. 47)

Revision 472020-02-13 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter notebook server at Nevis

Line: 239 to 239
 
  • The software on notebook was compiled under CentOS 7, but the software loaded by the environment modules was compiled under Scientific Linux 6. Also, some physics software is a “chimera”, a blend of software compiled in two languages; for example, the Neutrino Deep Learning group uses Python to call pre-compiled C++ routines. If you need libraries that were compiled for your workgroup server, you'll probably have to use them on your workgroup server. You'll know if this is the case if you get library errors when trying to use your own compiled libraries via notebook.
Changed:
<
<
The solution to most of these issues is to run Jupyter on your workgroup server.
>
>
The solution to most of these issues is to run Jupyter on your workgroup server, or consider a container-based distribution.
 

Jupyter on your workgroup server

Line: 308 to 308
 

Jupyter on your laptop

Changed:
<
<
You can install Python, ROOT, and Jupyter on your laptop. In fact, Jupyter is meant to be a laptop tool; the server installations I've prepared are to save you time, and to give you access to the Nevis cluster resources without copying files to and from your laptop. If you want to try your own installation:

  • These are not applications that you can just double-click to install. The process requires some knowledge of the UNIX shell.
  • You'll need to read the documentation for the package installations and use some thought and initiative. The links in the previous paragraph point to the installation documentation.
>
>
See the Jupyter/ROOT containers page.

Revision 462020-02-13 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"
Changed:
<
<

Jupyter/IPython at Nevis

>
>

Jupyter notebook server at Nevis

 
Line: 8 to 8
  Jupyter (formerly IPython) has become a popular tool for interactive physics analysis. Here are some examples of what you can do with notebooks. There is a dedicated Jupyter server, notebook, available for the users of the Nevis Linux cluster. To use it, visit https://notebook.nevis.columbia.edu and enter your Nevis cluster account name and password.
Added:
>
>
This page focuses on the capabilities of the Nevis Jupyter notebook server. If you'd like have your own Jupyter/ROOT installation (e.g., for a laptop), see the Jupyter/ROOT Containers page.
 

The basics

When you visit notebook for the first time, you'll see your home directory. You can perform some elementary file operations from this screen: check the box next to a filename, and you'll see an option near the top of the screen to rename or delete the file. The "Upload" button near the top left allows you to copy files from the computer you're using to the Nevis cluster.

Revision 452020-01-02 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 147 to 147
 

Python 2

Changed:
<
<
Python 2 is also available as a kernel. Python 3 is the future of the Python language, but not all Python packages have Python 3 versions yet. As with Python 3, if there's some standard package you'd like available to run Python 2 scripts on notebook, let WilliamSeligman know.
>
>
Python 2 is also available as a kernel. Python 3 is the future of the Python language, and Python 2 is no longer officially supported. I haven't deleted the Python 2 kernel yet, and I strongly advise you to move away from it and into Python 3.
 

R

Revision 442019-07-24 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 66 to 66
  c.NotebookApp.default_url = '/lab'
Deleted:
<
<
As of Aug-2018, neither jsroot (see below) nor any other Javacript extensions work in JupyterLab. This will be fixed by the CERN SWAN project in 2019.
 

Handy Jupyter links

Revision 432018-09-25 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 86 to 86
  The Python 3 set up on notebook includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
Changed:
<
<
You can copy-n-paste the following example directly from this web page into a Python 2 notebook cell:
>
>
You can copy-n-paste the following example directly from this web page into a Python notebook cell:
 
import ROOT

Revision 422018-08-14 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 290 to 290
 

After all that...

Changed:
<
<
You'll hopefully see a Jupyter home window similar to the one you see when using the notebook server. The chief difference is that you won't have the full range of exotic kernels available on that server, just Python 2 and ROOT C++. As long as your jupyter command keeps running, you can login again without the token by making sure the ssh port forwarding is running on your laptop, then visiting http://localhost:YYYY in your browser.
>
>
You'll hopefully see a Jupyter home window similar to the one you see when using the notebook server. The chief difference is that you won't have the full range of exotic kernels available on that server, just Python and ROOT C++. As long as your jupyter command keeps running, you can login again without the token by making sure the ssh port forwarding is running on your laptop, then visiting http://localhost:YYYY in your browser.
  If you want to keep your Jupyter process running even after you've closed the terminal window on your workgroup server, you may want to use the UNIX tmux command. The commands would look something like this:

Revision 412018-08-10 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 66 to 66
  c.NotebookApp.default_url = '/lab'
Changed:
<
<
Comment out this line (with #) or delete it if you want to revert this change.
>
>
As of Aug-2018, neither jsroot (see below) nor any other Javacript extensions work in JupyterLab. This will be fixed by the CERN SWAN project in 2019.
 

Handy Jupyter links

Revision 402018-08-09 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 50 to 50
  That last magic command, %jsroot on, is only available in ROOT notebooks (the first two kernels listed below). JSROOT adds some interactivity to ROOT plots.
Added:
>
>

JupyterLab

JupyterLab is an alternative way of managing files and notebooks. It will eventually become the standard interface for Jupyter.

To see what JupyterLab can do, look at your Jupyter URL and replace the final 'tree' with 'lab'. For example, if you see the URL

https://jsmith.notebook.nevis.columbia.edu/user/jsmith/tree

change it to

https://jsmith.notebook.nevis.columbia.edu/user/jsmith/lab

If you like JupyterLab and want it to be the default when you start Jupyter, edit/create the file ~/.jupyter/jupyter_notebook_config.py and add the line:

c.NotebookApp.default_url = '/lab'

Comment out this line (with #) or delete it if you want to revert this change.

 

Handy Jupyter links

Added:
>
>
 

Kernels

Revision 392018-07-28 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 24 to 24
  Go to the next cell and continue your work. The variables and functions you defined in the first cell are still available to you. Again, you can iteratively execute and debug that new set of code until it does what you want.
Changed:
<
<
In the File menu, select "Rename..." (otherwise your notebook will have the name "Untitled"). Again from the File menu, select "Close and Halt". On your main Jupyter page, you'll see your new notebook in your home directory, with the suffix .ipynb. Click on it to start up the notebook again.
>
>
In the File menu, select "Rename..." (otherwise your notebook will have the name "Untitled"). On your main Jupyter page, you'll see your new notebook in your home directory, with the suffix .ipynb. Click on it to start up the notebook again.
  Explore the menus. Note how you can save, rename, checkpoint, switch kernels, execute some or all of the cells.
Line: 60 to 60
  The kernels inherit the environment variables that you set in your shell initialization scripts. This can be convenient, but be sure to read the Limitations section below.
Changed:
<
<

Python 2

>
>

Python 3

  Python is a interpretive scripting language. It's becoming more widely used in physics for both scripting and analysis. Here's a Python tutorial. You'll probably also be interested in the commonly-used scientific packages NumPy (which implements arrays), SciPy, and mathplotlib. If there's some standard Python package that's not included on the notebook server, let WilliamSeligman know.
Changed:
<
<
The Python 2 set up on notebook includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
>
>
The Python 3 set up on notebook includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
  You can copy-n-paste the following example directly from this web page into a Python 2 notebook cell:
Line: 128 to 128
  Octave is a scientific programming language, with nice features for handling vectors and matrices, and good visualization tools. It's an open-source equivalent of Matlab. Here's an Octave tutorial.
Changed:
<
<

Python 3

Python 3 is also available as a kernel. Python 3 is the future of the Python language, but not all Python packages have Python 3 versions yet. Most of the critical scientific packages (e.g., NumPy, SciPy, mathplotlib, ROOT) are available in Python 3.

>
>

Python 2

 
Changed:
<
<
As with Python 2, if there's some standard package you'd like available to run Python 3 scripts on notebook, let WilliamSeligman know.
>
>
Python 2 is also available as a kernel. Python 3 is the future of the Python language, but not all Python packages have Python 3 versions yet. As with Python 3, if there's some standard package you'd like available to run Python 2 scripts on notebook, let WilliamSeligman know.
 

R

Revision 382018-07-18 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 28 to 28
  Explore the menus. Note how you can save, rename, checkpoint, switch kernels, execute some or all of the cells.
Changed:
<
<
Click in an empty cell. Go to the pop-up menu near the top of the page that reads "Code". Select "Markdown" from that menu. Now you can type plain text in that cell. You can also include HTML and LaTeX commands to format the text. When you're done, hit SHIFT-ENTER to see the formatted result.
>
>
Click in an empty cell. Go to the pop-up menu near the top of the page that reads "Code". Select "Markdown" from that menu. Now you can type plain text in that cell. You can also include Markdown, LaTeX, and HTML commands to format the text. When you're done, hit SHIFT-ENTER to see the formatted result.
  So notebooks:
  • let you quickly prototype, save, and update code;

Revision 372018-07-06 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 12 to 12
  When you visit notebook for the first time, you'll see your home directory. You can perform some elementary file operations from this screen: check the box next to a filename, and you'll see an option near the top of the screen to rename or delete the file. The "Upload" button near the top left allows you to copy files from the computer you're using to the Nevis cluster.
Changed:
<
<
To start a notebook, click on the "New" button near the top left and select one of the "kernels". (Underneath the kernel list: selecting "Text File" will give you a basic text editor and "Terminal" will give you a bash shell on notebook; please read the text you'll see for more information.)
>
>
To start a notebook, click on the "New" button near the top left and select one of the "kernels". (Underneath the kernel list: selecting "Text File" will give you a basic text editor and "Terminal" will give you a terminal emulator; see this page for more information.)
  To "execute" the contents of a given cell within the notebook, hit SHIFT-ENTER with your cursor in that cell. I strongly suggest that you look at the Help menu. The User Interface Tour only takes a minute, and the Keyboard Shortcuts will be handy.

Revision 362018-07-05 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 12 to 12
  When you visit notebook for the first time, you'll see your home directory. You can perform some elementary file operations from this screen: check the box next to a filename, and you'll see an option near the top of the screen to rename or delete the file. The "Upload" button near the top left allows you to copy files from the computer you're using to the Nevis cluster.
Changed:
<
<
To start a notebook, click on the "New" button near the top left and select one of the "kernels". Selecting "Text File" will give you a basic text editor. "Terminal" will give you a bash shell on notebook; please read the text you'll see for more information.
>
>
To start a notebook, click on the "New" button near the top left and select one of the "kernels". (Underneath the kernel list: selecting "Text File" will give you a basic text editor and "Terminal" will give you a bash shell on notebook; please read the text you'll see for more information.)
  To "execute" the contents of a given cell within the notebook, hit SHIFT-ENTER with your cursor in that cell. I strongly suggest that you look at the Help menu. The User Interface Tour only takes a minute, and the Keyboard Shortcuts will be handy.

Revision 352018-07-05 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 12 to 12
  When you visit notebook for the first time, you'll see your home directory. You can perform some elementary file operations from this screen: check the box next to a filename, and you'll see an option near the top of the screen to rename or delete the file. The "Upload" button near the top left allows you to copy files from the computer you're using to the Nevis cluster.
Changed:
<
<
To start a notebook, click on the "New" button near the top left and select one of the "kernels". Selecting "Text File" will give you a basic text editor. "Terminal" will give you a "login not available" screen, since users are not allowed to login directly to notebook; for a shell, login to your workgroup's server.
>
>
To start a notebook, click on the "New" button near the top left and select one of the "kernels". Selecting "Text File" will give you a basic text editor. "Terminal" will give you a bash shell on notebook; please read the text you'll see for more information.
  To "execute" the contents of a given cell within the notebook, hit SHIFT-ENTER with your cursor in that cell. I strongly suggest that you look at the Help menu. The User Interface Tour only takes a minute, and the Keyboard Shortcuts will be handy.

Revision 342018-05-02 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 62 to 62
 

Python 2

Changed:
<
<
Python is a interpretive scripting language. It's becoming more widely used in physics for both scripting and analysis. Here's a Python tutorial. You'll probably also be interested in the commonly-used scientific packages NumPy (which implement arrays), SciPy, and mathplotlib. If there's some standard Python package that's not included on the notebook server, let WilliamSeligman know.
>
>
Python is a interpretive scripting language. It's becoming more widely used in physics for both scripting and analysis. Here's a Python tutorial. You'll probably also be interested in the commonly-used scientific packages NumPy (which implements arrays), SciPy, and mathplotlib. If there's some standard Python package that's not included on the notebook server, let WilliamSeligman know.
  The Python 2 set up on notebook includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
Line: 130 to 130
 

Python 3

Changed:
<
<
For completeness, the current version of Python 3 is available as a kernel. Although Python 3 is the future of the Python language, ROOT is not yet fully compatible with it. At this point, you can't import ROOT in the notebook Python 3 set up. It may also be missing some standard Python packages.
>
>
Python 3 is also available as a kernel. Python 3 is the future of the Python language, but not all Python packages have Python 3 versions yet. Most of the critical scientific packages (e.g., NumPy, SciPy, mathplotlib, ROOT) are available in Python 3.
 
Changed:
<
<
If there's some additional feature you'd like available to run Python 3 scripts on notebook, let WilliamSeligman know. However, I'm not likely to put much emphasis on Python 3 until ROOT has reached full Python 3 compatibility.
>
>
As with Python 2, if there's some standard package you'd like available to run Python 3 scripts on notebook, let WilliamSeligman know.
 

R

Line: 226 to 226
 

Jupyter on your workgroup server

Changed:
<
<
Jupyter has been made part of the Python 2.7 distribution at Nevis, which is automatically set up when you type the environment modules command at the terminal:
>
>
Jupyter has been made part of the Python 3.6 distribution at Nevis, which is automatically set up when you type the environment modules command at the terminal:
 
module load root
Changed:
<
<
This will load ROOT 06.08 or later. See the environment modules page for more information, including how to look up available ROOT versions.
>
>
This will load ROOT 06.12 or later. See the environment modules page for more information, including how to look up available ROOT versions.
  Once you set up ROOT, in theory you'll be able to run Jupyter:

Revision 332017-10-30 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 274 to 274
  You'll hopefully see a Jupyter home window similar to the one you see when using the notebook server. The chief difference is that you won't have the full range of exotic kernels available on that server, just Python 2 and ROOT C++. As long as your jupyter command keeps running, you can login again without the token by making sure the ssh port forwarding is running on your laptop, then visiting http://localhost:YYYY in your browser.
Changed:
<
<
If you want to keep your Jupyter process running even after you've closed the terminal window on your workgroup server, you may want to use the UNIX screen command. The commands would look something like this:
>
>
If you want to keep your Jupyter process running even after you've closed the terminal window on your workgroup server, you may want to use the UNIX tmux command. The commands would look something like this:
 
Changed:
<
<
screen
>
>
tmux
 module load root jupyter notebook --no-browser --port=XXXX # Copy the URL # Switch to a different screen to work
Changed:
<
<
<Ctrl-a c>
>
>
<Ctrl-b c>
  You can close the terminal window whenever you wish; your processes (including jupyter) will continue to run. When you login to your workgroup server again, the command
Changed:
<
<
screen -r
>
>
tmux attach
 will reconnect you with the screen(s) you created before, including the jupyter screen.

Jupyter on your laptop

Revision 322017-08-30 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 216 to 216
 

Limitations and workarounds

Changed:
<
<
The notebook server is a shared resource for use by anyone in the Nevis particle-physics groups and/or the REU students to do light development tasks. If you need to run long, CPU-intensive, or multi-threaded parallel process via Jupyter, notebook is not a good choice. You'll potentially interfere with everyone else trying to use it at the same time. For these high-resource tasks, you can run Jupyter on your workgroup's server instead. (You may interfere with everyone else in your workgroup, but that's between you and them, not you and everyone else with a Nevis Linux cluster account.)
>
>
  • The notebook server is a shared resource for use by anyone in the Nevis particle-physics groups and/or the REU students to do light development tasks. If you need to run long, CPU-intensive, or multi-threaded parallel process via Jupyter, notebook is not a good choice. You'll potentially interfere with everyone else trying to use it at the same time. For these high-resource tasks, you can run Jupyter on your workgroup's server instead. (You may interfere with everyone else in your workgroup, but that's between you and them, not you and everyone else with a Nevis Linux cluster account.)
 
Changed:
<
<
The Jupyter notebooks inherit your user environment, that is, the variables that you define in your shell startup scripts. However, if you modify certain variables such as $LD_LIBRARY_PATH or run customization programs (such as module load root) in your initialization, it can affect the execution of the notebook server. The typical symptoms are a notebook kernel that refuses to start or you get library load errors.
>
>
  • The Jupyter notebooks inherit your user environment, that is, the variables that you define in your shell startup scripts. However, if you modify certain variables such as $LD_LIBRARY_PATH or run customization programs (such as module load root) in your initialization, it can affect the execution of the notebook server. The typical symptoms are a notebook kernel that refuses to start or you get library load errors.
 
Changed:
<
<
Another issue: The software on notebook was compiled under CentOS 7, but the software loaded by the environment modules was compiled under Scientific Linux 6. Also, some physics software is a “chimera”, a blend of software compiled in two languages; for example, the Neutrino Deep Learning group uses Python to call pre-compiled C++ routines. If you need libraries that were compiled for your workgroup server, you'll probably have to use them on your workgroup server. You'll know if this is the case if you get library errors when trying to use your own compiled libraries via notebook.
>
>
  • The software on notebook was compiled under CentOS 7, but the software loaded by the environment modules was compiled under Scientific Linux 6. Also, some physics software is a “chimera”, a blend of software compiled in two languages; for example, the Neutrino Deep Learning group uses Python to call pre-compiled C++ routines. If you need libraries that were compiled for your workgroup server, you'll probably have to use them on your workgroup server. You'll know if this is the case if you get library errors when trying to use your own compiled libraries via notebook.
  The solution to most of these issues is to run Jupyter on your workgroup server.

Revision 312017-08-16 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 142 to 142
  Ruby is a dynamic, open source programming language with a focus on simplicity. Many prefer it to Python as a first programming language. The SciRuby packages are part of this installation, so that Ruby can be used for scientific computation. Unfortunately, there is no current working link between ROOT and Ruby (though one used to exist and might exist again someday). Here's a link to tutorials.
Changed:
<
<
Plotting in Ruby notebooks is limited. The GnuplotRB package is available for plots; you'll have to search through the examples for x-y plots and histograms. Use the svg format for your plots; for some reason GnuplotRB won't display in png or jpeg within a Ruby kernel.
>
>
Plotting in Ruby notebooks is limited. The GnuplotRB package is available for plots; you'll have to search through the examples for x-y plots and histograms. Use the svg format for your plots; for some reason GnuplotRB won't display in png or jpeg within a Ruby kernel.
  No, Ruby on Rails is not installed. We do not want you building web applications on the notebook server.
Line: 220 to 220
  The Jupyter notebooks inherit your user environment, that is, the variables that you define in your shell startup scripts. However, if you modify certain variables such as $LD_LIBRARY_PATH or run customization programs (such as module load root) in your initialization, it can affect the execution of the notebook server. The typical symptoms are a notebook kernel that refuses to start or you get library load errors.
Changed:
<
<
Another issue: The software on notebook was compiled under CentOS 7, but the software loaded by the environment modules was compiled under Scientific Linux 6. Also, some physics software is a “chimera”, a blend of software compiled in two languages; for example, the Neutrino Deep Learning group uses Python to call pre-compiled C++ routines. If you need libraries that were compiled for your workgroup server, you'll probably have to use them on your workgroup server. You'll know if this is the case if you get library errors when trying to use your own compiled libraries via notebook.
>
>
Another issue: The software on notebook was compiled under CentOS 7, but the software loaded by the environment modules was compiled under Scientific Linux 6. Also, some physics software is a “chimera”, a blend of software compiled in two languages; for example, the Neutrino Deep Learning group uses Python to call pre-compiled C++ routines. If you need libraries that were compiled for your workgroup server, you'll probably have to use them on your workgroup server. You'll know if this is the case if you get library errors when trying to use your own compiled libraries via notebook.
  The solution to most of these issues is to run Jupyter on your workgroup server.

Revision 302017-06-22 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 112 to 112
 

Gnuplot

Changed:
<
<
Gnuplot is a graphing utility for visualizing mathematical functions and data interactively. There are Gnuplot cell magics that all you to use Gnuplot graphics to create plots within some of the other kernels on this page, such as Julia and Octave.
>
>
Gnuplot is a graphing utility for visualizing mathematical functions and data interactively. There are Gnuplot cell magics that let you use Gnuplot graphics to create plots within some of the other kernels on this page, such as Julia and Octave.
 

Julia

Julia is a high-level, high-performance dynamic programming language developed at MIT for technical computing. It combines the ease-of-use of Python with the speed of Fortran. Here's a Julia tutorial, though the plotting examples won't work in Jupyter unless you use PyPlot); e.g.:
Line: 142 to 142
  Ruby is a dynamic, open source programming language with a focus on simplicity. Many prefer it to Python as a first programming language. The SciRuby packages are part of this installation, so that Ruby can be used for scientific computation. Unfortunately, there is no current working link between ROOT and Ruby (though one used to exist and might exist again someday). Here's a link to tutorials.
Changed:
<
<
Plotting in Ruby notebooks is limited. The GnuplotRB package is available for plots; you'll have to search through the examples for x-y plots and histograms. Use the svg format for your plots; for some reason Gnuplot won't display in png or jpeg.
>
>
Plotting in Ruby notebooks is limited. The GnuplotRB package is available for plots; you'll have to search through the examples for x-y plots and histograms. Use the svg format for your plots; for some reason GnuplotRB won't display in png or jpeg within a Ruby kernel.
  No, Ruby on Rails is not installed. We do not want you building web applications on the notebook server.

Revision 292017-06-19 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 110 to 110
 
  • The Fortran compiler provided within the notebook server does not include CERNLIB.
  • You can also create Fortran functions that can be called by Python routines using Fortran magic.
Added:
>
>

Gnuplot

Gnuplot is a graphing utility for visualizing mathematical functions and data interactively. There are Gnuplot cell magics that all you to use Gnuplot graphics to create plots within some of the other kernels on this page, such as Julia and Octave.

 

Julia

Julia is a high-level, high-performance dynamic programming language developed at MIT for technical computing. It combines the ease-of-use of Python with the speed of Fortran. Here's a Julia tutorial, though the plotting examples won't work in Jupyter unless you use PyPlot); e.g.:
Line: 138 to 142
  Ruby is a dynamic, open source programming language with a focus on simplicity. Many prefer it to Python as a first programming language. The SciRuby packages are part of this installation, so that Ruby can be used for scientific computation. Unfortunately, there is no current working link between ROOT and Ruby (though one used to exist and might exist again someday). Here's a link to tutorials.
Added:
>
>
Plotting in Ruby notebooks is limited. The GnuplotRB package is available for plots; you'll have to search through the examples for x-y plots and histograms. Use the svg format for your plots; for some reason Gnuplot won't display in png or jpeg.
 No, Ruby on Rails is not installed. We do not want you building web applications on the notebook server.

SageMath

Line: 206 to 212
  It is my intention to include every available Jupyter kernel that might have an application in physics, as long as there's a clear installation method for adding it to Jupyter. If you have a request for an additional kernel, or for a library or extension to be added to an existing language, please let WilliamSeligman know.
Changed:
<
<
Before you ask: I've already tried to install Jupyter kernels for Forth, Gnuplot, Haskell, and Perl. Each presented a technical issue, ranging from "simply doesn't work" to "not compatible with being invoked from Jupyter".
>
>
Before you ask: I've already tried to install Jupyter kernels for Forth, Haskell, and Perl. Each presented a technical issue, ranging from "simply doesn't work" to "not compatible with being invoked from Jupyter".
 

Limitations and workarounds

Revision 282017-06-13 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 136 to 136
 

Ruby

Changed:
<
<
Ruby is a dynamic, open source programming language with a focus on simplicity. Many prefer it to Python as a first programming language. Unfortunately, there is no current working link between ROOT and Ruby (though one used to exist and might exist again someday). Here's a link to tutorials.
>
>
Ruby is a dynamic, open source programming language with a focus on simplicity. Many prefer it to Python as a first programming language. The SciRuby packages are part of this installation, so that Ruby can be used for scientific computation. Unfortunately, there is no current working link between ROOT and Ruby (though one used to exist and might exist again someday). Here's a link to tutorials.
  No, Ruby on Rails is not installed. We do not want you building web applications on the notebook server.

Revision 272017-06-12 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 134 to 134
  R is a language for statistical computing and graphics; it's the open-source version of S+. R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques. Here is an R tutorial.
Added:
>
>

Ruby

Ruby is a dynamic, open source programming language with a focus on simplicity. Many prefer it to Python as a first programming language. Unfortunately, there is no current working link between ROOT and Ruby (though one used to exist and might exist again someday). Here's a link to tutorials.

No, Ruby on Rails is not installed. We do not want you building web applications on the notebook server.

 

SageMath

SageMath is an open-source mathematics software system. It's a wrapper around different symbolic math and statistical packages. It's intended as a open-source replacement for Maple, Mathematica, and Matlab. Here's a SageMath tutorial.

Line: 200 to 206
  It is my intention to include every available Jupyter kernel that might have an application in physics, as long as there's a clear installation method for adding it to Jupyter. If you have a request for an additional kernel, or for a library or extension to be added to an existing language, please let WilliamSeligman know.
Changed:
<
<
Before you ask: I've already tried to install Jupyter kernels for Forth, Gnuplot, Haskell, Perl, and Ruby. Each presented a technical issue, ranging from "simply doesn't work" to "not compatible with being invoked from Jupyter".
>
>
Before you ask: I've already tried to install Jupyter kernels for Forth, Gnuplot, Haskell, and Perl. Each presented a technical issue, ranging from "simply doesn't work" to "not compatible with being invoked from Jupyter".
 

Limitations and workarounds

Revision 262017-05-19 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 58 to 58
  These are the "kernels" (active interpreters/compilers) available on the notebook server. The first two listed are the ones mostly likely to be used; the rest are listed in alphabetical order.
Added:
>
>
The kernels inherit the environment variables that you set in your shell initialization scripts. This can be convenient, but be sure to read the Limitations section below.
 

Python 2

Python is a interpretive scripting language. It's becoming more widely used in physics for both scripting and analysis. Here's a Python tutorial. You'll probably also be interested in the commonly-used scientific packages NumPy (which implement arrays), SciPy, and mathplotlib. If there's some standard Python package that's not included on the notebook server, let WilliamSeligman know.

Line: 202 to 204
 

Limitations and workarounds

Changed:
<
<
The notebook server is a shared resource for use by anyone in the Nevis particle-physics groups and/or the REU students to do light development tasks. If you need to run long, CPU-intensive, or multi-threaded parallel process via Jupyter, notebook is not a good choice, since you'll potentially interfere with everyone else trying to use it at the same time. For these high-resource tasks, you can run Jupyter on your workgroup's server instead. (You may interfere with everyone else in your workgroup, but that's between you and them, not you and everyone else with a Nevis Linux cluster account.)
>
>
The notebook server is a shared resource for use by anyone in the Nevis particle-physics groups and/or the REU students to do light development tasks. If you need to run long, CPU-intensive, or multi-threaded parallel process via Jupyter, notebook is not a good choice. You'll potentially interfere with everyone else trying to use it at the same time. For these high-resource tasks, you can run Jupyter on your workgroup's server instead. (You may interfere with everyone else in your workgroup, but that's between you and them, not you and everyone else with a Nevis Linux cluster account.)

The Jupyter notebooks inherit your user environment, that is, the variables that you define in your shell startup scripts. However, if you modify certain variables such as $LD_LIBRARY_PATH or run customization programs (such as module load root) in your initialization, it can affect the execution of the notebook server. The typical symptoms are a notebook kernel that refuses to start or you get library load errors.

 
Changed:
<
<
There's another limitation: The Jupyter notebooks don't inherit your user environment. If your task depends on variables that you define in your login shell, you'll have to start your own session on your workgroup server.
>
>
Another issue: The software on notebook was compiled under CentOS 7, but the software loaded by the environment modules was compiled under Scientific Linux 6. Also, some physics software is a “chimera”, a blend of software compiled in two languages; for example, the Neutrino Deep Learning group uses Python to call pre-compiled C++ routines. If you need libraries that were compiled for your workgroup server, you'll probably have to use them on your workgroup server. You'll know if this is the case if you get library errors when trying to use your own compiled libraries via notebook.
 
Changed:
<
<
Another issue: The software on the notebook server was compiled under CentOS 7, but the software loaded by the environment modules was compiled under Scientific Linux 6. If you have libraries that you compiled on your workgroup server, you'll probably have to use them on your workgroup server. You'll know if this is the case if you get library errors when trying to use your own compiled libraries via the notebook server.
>
>
The solution to most of these issues is to run Jupyter on your workgroup server.
 

Jupyter on your workgroup server

Revision 252017-05-18 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 204 to 204
  The notebook server is a shared resource for use by anyone in the Nevis particle-physics groups and/or the REU students to do light development tasks. If you need to run long, CPU-intensive, or multi-threaded parallel process via Jupyter, notebook is not a good choice, since you'll potentially interfere with everyone else trying to use it at the same time. For these high-resource tasks, you can run Jupyter on your workgroup's server instead. (You may interfere with everyone else in your workgroup, but that's between you and them, not you and everyone else with a Nevis Linux cluster account.)
Added:
>
>
There's another limitation: The Jupyter notebooks don't inherit your user environment. If your task depends on variables that you define in your login shell, you'll have to start your own session on your workgroup server.

Another issue: The software on the notebook server was compiled under CentOS 7, but the software loaded by the environment modules was compiled under Scientific Linux 6. If you have libraries that you compiled on your workgroup server, you'll probably have to use them on your workgroup server. You'll know if this is the case if you get library errors when trying to use your own compiled libraries via the notebook server.

 

Jupyter on your workgroup server

Jupyter has been made part of the Python 2.7 distribution at Nevis, which is automatically set up when you type the environment modules command at the terminal:

Revision 242017-05-12 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 208 to 208
  Jupyter has been made part of the Python 2.7 distribution at Nevis, which is automatically set up when you type the environment modules command at the terminal:
Changed:
<
<
module load root/06.08.00
>
>
module load root
 
Changed:
<
<
Make sure you're running ROOT 06.08 or later. See the environment modules page for more information, including how to look up available ROOT versions.
>
>
This will load ROOT 06.08 or later. See the environment modules page for more information, including how to look up available ROOT versions.
  Once you set up ROOT, in theory you'll be able to run Jupyter:
Line: 258 to 258
 
screen
Changed:
<
<
module load root/06.08.00
>
>
module load root
 jupyter notebook --no-browser --port=XXXX # Copy the URL # Switch to a different screen to work

Revision 232017-04-27 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 50 to 50
  That last magic command, %jsroot on, is only available in ROOT notebooks (the first two kernels listed below). JSROOT adds some interactivity to ROOT plots.
Added:
>
>

Handy Jupyter links

 

Kernels

These are the "kernels" (active interpreters/compilers) available on the notebook server. The first two listed are the ones mostly likely to be used; the rest are listed in alphabetical order.

Revision 222017-04-27 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 14 to 14
  To start a notebook, click on the "New" button near the top left and select one of the "kernels". Selecting "Text File" will give you a basic text editor. "Terminal" will give you a "login not available" screen, since users are not allowed to login directly to notebook; for a shell, login to your workgroup's server.
Changed:
<
<
To "execute" the contents of a given cell, hit SHIFT-ENTER with your cursor in that cell.
>
>
To "execute" the contents of a given cell within the notebook, hit SHIFT-ENTER with your cursor in that cell. I strongly suggest that you look at the Help menu. The User Interface Tour only takes a minute, and the Keyboard Shortcuts will be handy.
 

Why notebooks?

Revision 212017-03-23 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 192 to 192
 

Want even more?

Changed:
<
<
It is my intention to include every available Jupyter kernel that might have application in physics, as long as there's a clear installation method for adding it to Jupyter. If you have a request for additional kernel, or for a library or extension to be added to an existing language, please let WilliamSeligman know.
>
>
It is my intention to include every available Jupyter kernel that might have an application in physics, as long as there's a clear installation method for adding it to Jupyter. If you have a request for an additional kernel, or for a library or extension to be added to an existing language, please let WilliamSeligman know.
  Before you ask: I've already tried to install Jupyter kernels for Forth, Gnuplot, Haskell, Perl, and Ruby. Each presented a technical issue, ranging from "simply doesn't work" to "not compatible with being invoked from Jupyter".
Line: 214 to 214
 jupyter notebook
Changed:
<
<
That this will start up a web browser on the system on which you execute the command (not your laptop!), with the web page open to localhost:8888. This is not what you'll want to do normally.
>
>
This will start up a web browser on the system on which you execute the command (not your laptop!), with the web page open to localhost:8888. This is not what you'll want to do normally.
 

Remote access

You probably want to see Jupyter via a web browser on your laptop. To do this, you must port-forward a connection via ssh. The complete instructions are here. What follows is a brief summary.

Revision 202017-03-15 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 229 to 229
 
    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
Changed:
<
<
http://localhost:XXXX/?token=<random-string-of-hex-digits&gt;
>
>
http://localhost:XXXX/?token=<string-of-hex-digits&gt;
 

...where XXXX is your argument to the --port option. Copy that entire URL string.

Line: 242 to 242
  ...where <username@server.nevis.columbia.edu> is your Nevis account and server on which you ran the jupyter command. YYYY can be any unused port on your laptop; often users pick YYYY=XXXX, but you don't have to.
Changed:
<
<
Then to access the notebook, go to the web browser on your laptop and visit http://localhost:YYYY/?token=<random-string-of-hex-digits>. Note that this is almost the same as the URL you copied above, except that you'll have to substitute the laptop port YYYY for the XXXX in the message.
>
>
Then to access the notebook, go to the web browser on your laptop and visit http://localhost:YYYY/?token=<string-of-hex-digits>. Note that this is almost the same as the URL you copied above, except that you'll have to substitute the laptop port YYYY for the XXXX in the message.
  There's a potential problem with just using any value for YYYY: Most current web browsers won't let you visit random ports anymore. In Firefox, there is a workaround; in Safari there isn't. The simplest solution is to let YYYY be a generally-recognized port for internet access; e.g., 8080.
Line: 264 to 264
 
screen -r
will reconnect you with the screen(s) you created before, including the jupyter screen.
Added:
>
>

Jupyter on your laptop

You can install Python, ROOT, and Jupyter on your laptop. In fact, Jupyter is meant to be a laptop tool; the server installations I've prepared are to save you time, and to give you access to the Nevis cluster resources without copying files to and from your laptop. If you want to try your own installation:

  • These are not applications that you can just double-click to install. The process requires some knowledge of the UNIX shell.
  • You'll need to read the documentation for the package installations and use some thought and initiative. The links in the previous paragraph point to the installation documentation.

Revision 192017-03-13 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 60 to 60
  The Python 2 set up on notebook includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
Changed:
<
<
You'll probably want the rootnotes package, which enables ROOT plots to appear within your notebook. You can copy-n-paste the following example directly from this web page into a Python 2 notebook cell:
>
>
You can copy-n-paste the following example directly from this web page into a Python 2 notebook cell:
 
import ROOT
Deleted:
<
<
import rootnotes
  # You may want this if you'd like your ROOT plots to be interactive in the notebook. %jsroot on
Line: 196 to 195
 It is my intention to include every available Jupyter kernel that might have application in physics, as long as there's a clear installation method for adding it to Jupyter. If you have a request for additional kernel, or for a library or extension to be added to an existing language, please let WilliamSeligman know.

Before you ask: I've already tried to install Jupyter kernels for Forth, Gnuplot, Haskell, Perl, and Ruby. Each presented a technical issue, ranging from "simply doesn't work" to "not compatible with being invoked from Jupyter".

Added:
>
>

Limitations and workarounds

The notebook server is a shared resource for use by anyone in the Nevis particle-physics groups and/or the REU students to do light development tasks. If you need to run long, CPU-intensive, or multi-threaded parallel process via Jupyter, notebook is not a good choice, since you'll potentially interfere with everyone else trying to use it at the same time. For these high-resource tasks, you can run Jupyter on your workgroup's server instead. (You may interfere with everyone else in your workgroup, but that's between you and them, not you and everyone else with a Nevis Linux cluster account.)

Jupyter on your workgroup server

Jupyter has been made part of the Python 2.7 distribution at Nevis, which is automatically set up when you type the environment modules command at the terminal:

module load root/06.08.00

Make sure you're running ROOT 06.08 or later. See the environment modules page for more information, including how to look up available ROOT versions.

Once you set up ROOT, in theory you'll be able to run Jupyter:

jupyter notebook

That this will start up a web browser on the system on which you execute the command (not your laptop!), with the web page open to localhost:8888. This is not what you'll want to do normally.

Remote access

You probably want to see Jupyter via a web browser on your laptop. To do this, you must port-forward a connection via ssh. The complete instructions are here. What follows is a brief summary.

On the workgroup server, this command will start up Jupyter for you:

jupyter notebook --no-browser --port=XXXX

... where XXXX is an unused port on the server; e.g., 7000. If multiple users want to run Jupyter on your server, you'll have to coordinate with them so that you don't use the same port. You will see a message on your terminal that includes something like this:

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:XXXX/?token=<random-string-of-hex-digits>

...where XXXX is your argument to the --port option. Copy that entire URL string.

On your laptop, forward that port XXXX to you:

ssh -N -f -L localhost:YYYY:localhost:XXXX <username@server.nevis.columbia.edu>

...where <username@server.nevis.columbia.edu> is your Nevis account and server on which you ran the jupyter command. YYYY can be any unused port on your laptop; often users pick YYYY=XXXX, but you don't have to.

Then to access the notebook, go to the web browser on your laptop and visit http://localhost:YYYY/?token=<random-string-of-hex-digits>. Note that this is almost the same as the URL you copied above, except that you'll have to substitute the laptop port YYYY for the XXXX in the message.

There's a potential problem with just using any value for YYYY: Most current web browsers won't let you visit random ports anymore. In Firefox, there is a workaround; in Safari there isn't. The simplest solution is to let YYYY be a generally-recognized port for internet access; e.g., 8080.

After all that...

You'll hopefully see a Jupyter home window similar to the one you see when using the notebook server. The chief difference is that you won't have the full range of exotic kernels available on that server, just Python 2 and ROOT C++. As long as your jupyter command keeps running, you can login again without the token by making sure the ssh port forwarding is running on your laptop, then visiting http://localhost:YYYY in your browser.

If you want to keep your Jupyter process running even after you've closed the terminal window on your workgroup server, you may want to use the UNIX screen command. The commands would look something like this:

screen
module load root/06.08.00
jupyter notebook --no-browser --port=XXXX
# Copy the URL
# Switch to a different screen to work
<Ctrl-a c>

You can close the terminal window whenever you wish; your processes (including jupyter) will continue to run. When you login to your workgroup server again, the command

screen -r
will reconnect you with the screen(s) you created before, including the jupyter screen.

Revision 182017-03-03 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 125 to 125
  If there's some additional feature you'd like available to run Python 3 scripts on notebook, let WilliamSeligman know. However, I'm not likely to put much emphasis on Python 3 until ROOT has reached full Python 3 compatibility.
Added:
>
>

R

R is a language for statistical computing and graphics; it's the open-source version of S+. R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques. Here is an R tutorial.

 

SageMath

SageMath is an open-source mathematics software system. It's a wrapper around different symbolic math and statistical packages. It's intended as a open-source replacement for Maple, Mathematica, and Matlab. Here's a SageMath tutorial.

Line: 186 to 190
  return sum # Test in next cell: geo_prog_cython(4.0,5)
Added:
>
>

Want even more?

It is my intention to include every available Jupyter kernel that might have application in physics, as long as there's a clear installation method for adding it to Jupyter. If you have a request for additional kernel, or for a library or extension to be added to an existing language, please let WilliamSeligman know.

Before you ask: I've already tried to install Jupyter kernels for Forth, Gnuplot, Haskell, Perl, and Ruby. Each presented a technical issue, ranging from "simply doesn't work" to "not compatible with being invoked from Jupyter".

Revision 172017-03-02 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 140 to 140
 You don't necessarily need an explicit kernel to develop scripts. Jupyter has "cell magics" that let you redefine the language being used within a given cell. If you execute
%lsmagic
Changed:
<
<
you'll see a list of available cell magic commands.
>
>
you'll see a list of available cell magic commands. Among the commands are those that switch between different languages within a single notebook.

Perl

  For example, if you want to work on a Perl script, you can put lines like this in a cell in any kernel:
Line: 166 to 168
  # Print out the file name and path print $filename . "\n"; } \ No newline at end of file
Added:
>
>

Cython

Cython is a superset of python in which the commands are compiled into C. For example:

%load_ext Cython
# Next cell:
%%cython -a
def geo_prog_cython(double alpha, int n):
    cdef double current = 1.0
    cdef double sum = current
    cdef int i
    for i in range(n):
        current = current * alpha
        sum = sum + current
    return sum
# Test in next cell:
geo_prog_cython(4.0,5)

Revision 162017-02-28 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 133 to 133
 

Tcl

Changed:
<
<
Tcl is another scripting language, frequently used with a cross-platform graphic user interface package Tk. The latter is included with Python, but it might not function properly in the web-browser environment of Jupyter. Here's a Tcl tutorial.
>
>
Tcl is another scripting language, frequently used with a cross-platform graphic user interface package Tk. The latter is included with Python, but it will not function properly in the web-browser environment of Jupyter (there's no X-windows environment inside a web browser). Here's a Tcl tutorial.
 

...and more

Revision 152017-02-27 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 40 to 40
 

Magic commands

Changed:
<
<
In addition to the kernel languages listed below, in any notebook cell you can type "magic" commands that have effects on your system beyond what kernel's language normally provides. The magic commands I use most often are:
>
>
In addition to the kernel languages listed below, in any notebook cell you can type "magic" commands that have effects on your system beyond what the kernel's language normally provides. The magic commands I use most often are:
 
!ls
%cd <directory>
%cp <file> <new-file-loc>
Added:
>
>
%lsmagic
 %jsroot on

That last magic command, %jsroot on, is only available in ROOT notebooks (the first two kernels listed below). JSROOT adds some interactivity to ROOT plots.

Line: 105 to 106
 
  • You can also create Fortran functions that can be called by Python routines using Fortran magic.

Julia

Changed:
<
<
Julia is a high-level, high-performance dynamic programming language for technical computing. It combines the ease-of-use of Python with the speed of Fortran. Here's a Julia tutorial, though the plotting examples won't work in Jupyter unless you use PyPlot); e.g.:
>
>
Julia is a high-level, high-performance dynamic programming language developed at MIT for technical computing. It combines the ease-of-use of Python with the speed of Fortran. Here's a Julia tutorial, though the plotting examples won't work in Jupyter unless you use PyPlot); e.g.:
 
using PyPlot
x=linspace(0,2*pi,1000)

Revision 142017-02-24 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 105 to 105
 
  • You can also create Fortran functions that can be called by Python routines using Fortran magic.

Julia

Changed:
<
<
Julia is a high-level, high-performance dynamic programming language for technical computing. It combines the ease-of-use of Python with the speed of Fortran. Here's a quick example of plotting (Julia uses matplotlib):
>
>
Julia is a high-level, high-performance dynamic programming language for technical computing. It combines the ease-of-use of Python with the speed of Fortran. Here's a Julia tutorial, though the plotting examples won't work in Jupyter unless you use PyPlot); e.g.:
 
using PyPlot
x=linspace(0,2*pi,1000)

Revision 132017-02-24 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 104 to 104
 
  • The Fortran compiler provided within the notebook server does not include CERNLIB.
  • You can also create Fortran functions that can be called by Python routines using Fortran magic.
Added:
>
>

Julia

Julia is a high-level, high-performance dynamic programming language for technical computing. It combines the ease-of-use of Python with the speed of Fortran. Here's a quick example of plotting (Julia uses matplotlib):
using PyPlot
x=linspace(0,2*pi,1000)
y=sin(3x + 3cos(2x))
plot(x,y,color="red",linewidth=2.0,linestyle="--")
title("plot of oscillatory function")
xlabel("the x axis")
 

Octave

Octave is a scientific programming language, with nice features for handling vectors and matrices, and good visualization tools. It's an open-source equivalent of Matlab. Here's an Octave tutorial.

Revision 122017-02-23 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 6 to 6
 
Changed:
<
<
Jupyter (formerly IPython) has become a popular tool for interactive physics analysis. Here are some examples of what you can do with notebooks. There is a dedicated Jupyter server, notebook, available for the users of the Nevis Linux cluster. To use it, visit https://notebook.nevis.columbia.edu and enter your Nevis cluster account name and password.
>
>
Jupyter (formerly IPython) has become a popular tool for interactive physics analysis. Here are some examples of what you can do with notebooks. There is a dedicated Jupyter server, notebook, available for the users of the Nevis Linux cluster. To use it, visit https://notebook.nevis.columbia.edu and enter your Nevis cluster account name and password.
 

The basics

Line: 123 to 123
 

Tcl

Tcl is another scripting language, frequently used with a cross-platform graphic user interface package Tk. The latter is included with Python, but it might not function properly in the web-browser environment of Jupyter. Here's a Tcl tutorial.

Added:
>
>

...and more

You don't necessarily need an explicit kernel to develop scripts. Jupyter has "cell magics" that let you redefine the language being used within a given cell. If you execute

%lsmagic
you'll see a list of available cell magic commands.

For example, if you want to work on a Perl script, you can put lines like this in a cell in any kernel:

%%perl
# An uninteresting example: display all the regular files in my home directory
use strict;
use warnings;

use Path::Class;

my $dir = dir($ENV{'HOME'});

# Iterate over the content of my home directory
while (my $file = $dir->next) {
    
    # Skip if it is a directory
    next if $file->is_dir();
    
    # Skip if the filename ends a ~ (emacs work file)
    my $filename = $file->stringify;
    next if $filename =~ /~$/;
   
    # Print out the file name and path
    print $filename . "\n";
}

Revision 112017-02-23 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Line: 12 to 12
  When you visit notebook for the first time, you'll see your home directory. You can perform some elementary file operations from this screen: check the box next to a filename, and you'll see an option near the top of the screen to rename or delete the file. The "Upload" button near the top left allows you to copy files from the computer you're using to the Nevis cluster.
Changed:
<
<
To start a notebook, click on the "New" button near the top left and select one of the "kernels". Selecting "Text File" will give you a basic text editor. "Terminal" will give you a "login not available" screen, since users are not allowed to login directly to notebook; for a shell, login directly to your workgroup's server.
>
>
To start a notebook, click on the "New" button near the top left and select one of the "kernels". Selecting "Text File" will give you a basic text editor. "Terminal" will give you a "login not available" screen, since users are not allowed to login directly to notebook; for a shell, login to your workgroup's server.
  To "execute" the contents of a given cell, hit SHIFT-ENTER with your cursor in that cell.
Line: 55 to 55
 

Python 2

Changed:
<
<
Python is a interpretive scripting language. It's becoming more widely used in physics for both scripting and analysis. Here's a tutorial. You'll probably also be interested in the commonly-used scientific packages NumPy (which implement arrays), SciPy, and mathplotlib. If there's some standard Python package that's not included on the notebook server, let WilliamSeligman know.
>
>
Python is a interpretive scripting language. It's becoming more widely used in physics for both scripting and analysis. Here's a Python tutorial. You'll probably also be interested in the commonly-used scientific packages NumPy (which implement arrays), SciPy, and mathplotlib. If there's some standard Python package that's not included on the notebook server, let WilliamSeligman know.
  The Python 2 set up on notebook includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
Changed:
<
<
You'll probably want the rootnotes package, which enables ROOT plots to appear within your notebook. A typical example:
>
>
You'll probably want the rootnotes package, which enables ROOT plots to appear within your notebook. You can copy-n-paste the following example directly from this web page into a Python 2 notebook cell:
 
import ROOT
import rootnotes
Line: 81 to 81
  This kernel is the ROOT C++ interpreter, cling. In addition to working with ROOT, it also provides the C++ language within a notebook. Here's an example of using ROOT within a notebook (the C++ example is near the bottom).
Changed:
<
<
A simple test:
>
>
A simple test, which you can copy-n-paste directly from this web page into a ROOT C++ notebook cell:
 
%jsroot on
TCanvas mycanvas("name","title",800,600);
Line: 122 to 122
 

Tcl

Deleted:
<
<
Tcl is another scripting language, frequently used with a graphical component Tk. The latter is included with Python, but it might not function properly in the web-browser environment of Jupyter. Here's a Tcl tutorial.
 \ No newline at end of file
Added:
>
>
Tcl is another scripting language, frequently used with a cross-platform graphic user interface package Tk. The latter is included with Python, but it might not function properly in the web-browser environment of Jupyter. Here's a Tcl tutorial.

Revision 102017-02-22 - JoseIgnacioCrespoAnadon

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter/IPython at Nevis

Changed:
<
<
>
>
 
Line: 45 to 45
 ls %cd %cp <new-file-loc>
Changed:
<
<
%jsroot on
>
>
%jsroot on
  That last magic command, %jsroot on, is only available in ROOT notebooks (the first two kernels listed below). JSROOT adds some interactivity to ROOT plots.
Line: 58 to 57
  Python is a interpretive scripting language. It's becoming more widely used in physics for both scripting and analysis. Here's a tutorial. You'll probably also be interested in the commonly-used scientific packages NumPy (which implement arrays), SciPy, and mathplotlib. If there's some standard Python package that's not included on the notebook server, let WilliamSeligman know.
Changed:
<
<
The Python 2 set up on notebook includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
>
>
The Python 2 set up on notebook includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
  You'll probably want the rootnotes package, which enables ROOT plots to appear within your notebook. A typical example:

Revision 92017-02-22 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"
Changed:
<
<

iPython/Jupyter at Nevis

>
>

Jupyter/IPython at Nevis

 
Changed:
<
<
Jupyter (formerly iPython) has become a popular tool for interactive physics analysis. Here some examples of what you can do with notebooks. There is a dedicated Jupyter server, notebook, available for the users of the Nevis Linux cluster. To use it, visit https://notebook.nevis.columbia.edu and enter your Nevis cluster account name and password.
>
>
Jupyter (formerly IPython) has become a popular tool for interactive physics analysis. Here are some examples of what you can do with notebooks. There is a dedicated Jupyter server, notebook, available for the users of the Nevis Linux cluster. To use it, visit https://notebook.nevis.columbia.edu and enter your Nevis cluster account name and password.
 

The basics

When you visit notebook for the first time, you'll see your home directory. You can perform some elementary file operations from this screen: check the box next to a filename, and you'll see an option near the top of the screen to rename or delete the file. The "Upload" button near the top left allows you to copy files from the computer you're using to the Nevis cluster.

Changed:
<
<
To start a notebook, click on the "New" button near the top left and select one of the "kernels". (Selecting "Text File" will take you a basic text editor. "Terminal" will you give you a "login not available" screen, since users are not allowed to login directly to notebook; for a shell, login directly to your workgroup's server.)
>
>
To start a notebook, click on the "New" button near the top left and select one of the "kernels". Selecting "Text File" will give you a basic text editor. "Terminal" will give you a "login not available" screen, since users are not allowed to login directly to notebook; for a shell, login directly to your workgroup's server.
  To "execute" the contents of a given cell, hit SHIFT-ENTER with your cursor in that cell.
Line: 20 to 20
  Type some commands in the language of the kernel you chose in the first cell. Hit SHIFT-ENTER to execute them. If there's an error, make an appropriate fix and hit SHIFT-ENTER again.
Changed:
<
<
Continue editing lines in that first cell until you have finished some small task (e.g., creating a histogram). Execute the cell (SHIFT-ENTER) to demonstrate to yourself and you've got it right.
>
>
Continue editing lines in that first cell until you have finished some small task (e.g., creating a histogram). Execute the cell (SHIFT-ENTER) to demonstrate to yourself that you've got it right.
  Go to the next cell and continue your work. The variables and functions you defined in the first cell are still available to you. Again, you can iteratively execute and debug that new set of code until it does what you want.
Line: 28 to 28
  Explore the menus. Note how you can save, rename, checkpoint, switch kernels, execute some or all of the cells.
Added:
>
>
Click in an empty cell. Go to the pop-up menu near the top of the page that reads "Code". Select "Markdown" from that menu. Now you can type plain text in that cell. You can also include HTML and LaTeX commands to format the text. When you're done, hit SHIFT-ENTER to see the formatted result.

So notebooks:

  • let you quickly prototype, save, and update code;
  • make plots, then fiddle with the code that created the plots and quickly refresh them;
  • easily document your work, and update the documentation as quickly as you update your code and plots;
  • you can do all of this from within your web browser.

That's the answer to "why notebooks".

 

Magic commands

Changed:
<
<
In addition to the kernel languages listed below, in any notebook cell you can type "magic" commands that have affects on your system beyond what kernel's language normally provides. The magic commands I use most often are:
>
>
In addition to the kernel languages listed below, in any notebook cell you can type "magic" commands that have effects on your system beyond what kernel's language normally provides. The magic commands I use most often are:
 
!ls
%cd <directory>
Line: 46 to 56
 

Python 2

Changed:
<
<
Python is a interpretive scripting language. It's becoming more widely used in physics as both a scripting and analysis language. Here's a tutorial. You'll probably also be interested in the commonly-used scientific packages NumPy (which implement arrays), SciPy, and mathplotlib. If there's some standard Python package that's not included on the notebook server, let WilliamSeligman know.
>
>
Python is a interpretive scripting language. It's becoming more widely used in physics for both scripting and analysis. Here's a tutorial. You'll probably also be interested in the commonly-used scientific packages NumPy (which implement arrays), SciPy, and mathplotlib. If there's some standard Python package that's not included on the notebook server, let WilliamSeligman know.
 
Changed:
<
<
package includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
>
>
The Python 2 set up on notebook includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
  You'll probably want the rootnotes package, which enables ROOT plots to appear within your notebook. A typical example:
Changed:
<
<
# This also imports ROOT.
>
>
import ROOT
 import rootnotes

# You may want this if you'd like your ROOT plots to be interactive in the notebook. %jsroot on

# Define a canvas

Changed:
<
<
my_canvas = rootnotes.default_canvas()
>
>
my_canvas = ROOT.TCanvas("my_canvas","my_canvas",800,600)
  hist=ROOT.TH1F("hist","example histogram",100,-3,3) hist.FillRandom("gaus",100000) hist.Draw()
Changed:
<
<
# You have to type the name of the canvas to see anything my_canvas
>
>
# You have to draw the canvas to see it in the web page. my_canvas.Draw()
 

ROOT C++

This kernel is the ROOT C++ interpreter, cling. In addition to working with ROOT, it also provides the C++ language within a notebook. Here's an example of using ROOT within a notebook (the C++ example is near the bottom).

Added:
>
>
A simple test:
%jsroot on
TCanvas mycanvas("name","title",800,600);
TH1D test("test","example title",200,-3,3);
test.FillRandom("gaus",10000);
test.Draw();
// Unlike interactive ROOT, once you've drawn on a canvas,
// you must draw the canvas explicitly to see it in the notebook. 
mycanvas.Draw();
 

Bash

Bash (from "Bourne-Again SHell") is a shell language for UNIX systems. There's a good chance it's the shell you use when you login to the Nevis Linux cluster. With this kernel, you can develop shell scripts.

Fortran

Changed:
<
<
FORTRAN (from "FORmula TRANslation") is a mathematical computer language. For decades it was the backbone of computer programming in physics, and many say that it's still the most efficient language for implementing mathematical tasks. This kernel provides an interface to the GNU gfortran compiler, which is is fully compliant with the Fortran 95 Standard and includes some Fortran 2003 and Fortran 2008 features.
>
>
Fortran (from "FORmula TRANslation") is a mathematical computer language. For decades it was the backbone of computer programming in physics, and many say that it's still the most efficient language for implementing mathematical tasks. This kernel provides an interface to the GNU gfortran compiler, which is fully compliant with the Fortran 95 Standard and includes some Fortran 2003 and Fortran 2008 features.
  Note:
  • The Fortran compiler provided within the notebook server does not include CERNLIB.
Line: 86 to 107
 

Octave

Changed:
<
<
Octave is a scientific programming language, with nice features for handling vectors and matrices, and with good visualization tools. It's an open-source equivalent of Matlab. Here's a tutorial.
>
>
Octave is a scientific programming language, with nice features for handling vectors and matrices, and good visualization tools. It's an open-source equivalent of Matlab. Here's an Octave tutorial.
 

Python 3

Line: 96 to 117
 

SageMath

Changed:
<
<
SageMath is an open-source mathematics software system. It's a wrapper around different symbolic math and statistical packages. It's intended as a open-source replacement for Maple, Mathematica, and Matlab. Here's a tutorial.
>
>
SageMath is an open-source mathematics software system. It's a wrapper around different symbolic math and statistical packages. It's intended as a open-source replacement for Maple, Mathematica, and Matlab. Here's a SageMath tutorial.
  If you ask me if we have Mathematica at Nevis, this is where I'll send you.

Tcl

Changed:
<
<
Tcl is another scripting language, frequently used with a graphical component Tk. The latter is included with Python, but it might not function properly in the web-browser environment of Jupyter. Here's a tutorial.
>
>
Tcl is another scripting language, frequently used with a graphical component Tk. The latter is included with Python, but it might not function properly in the web-browser environment of Jupyter. Here's a Tcl tutorial.

Revision 82017-02-22 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

iPython/Jupyter at Nevis

Line: 16 to 16
  To "execute" the contents of a given cell, hit SHIFT-ENTER with your cursor in that cell.
Added:
>
>

Why notebooks?

Type some commands in the language of the kernel you chose in the first cell. Hit SHIFT-ENTER to execute them. If there's an error, make an appropriate fix and hit SHIFT-ENTER again.

Continue editing lines in that first cell until you have finished some small task (e.g., creating a histogram). Execute the cell (SHIFT-ENTER) to demonstrate to yourself and you've got it right.

Go to the next cell and continue your work. The variables and functions you defined in the first cell are still available to you. Again, you can iteratively execute and debug that new set of code until it does what you want.

In the File menu, select "Rename..." (otherwise your notebook will have the name "Untitled"). Again from the File menu, select "Close and Halt". On your main Jupyter page, you'll see your new notebook in your home directory, with the suffix .ipynb. Click on it to start up the notebook again.

Explore the menus. Note how you can save, rename, checkpoint, switch kernels, execute some or all of the cells.

Magic commands

 In addition to the kernel languages listed below, in any notebook cell you can type "magic" commands that have affects on your system beyond what kernel's language normally provides. The magic commands I use most often are:
!ls
Line: 72 to 86
 

Octave

Changed:
<
<
Octave is a scientific programming language, with nice features for handling vectors and matrices, and with good visualization features. It's an open-source equivalent of Matlab. Here's a tutorial.
>
>
Octave is a scientific programming language, with nice features for handling vectors and matrices, and with good visualization tools. It's an open-source equivalent of Matlab. Here's a tutorial.
 

Python 3

For completeness, the current version of Python 3 is available as a kernel. Although Python 3 is the future of the Python language, ROOT is not yet fully compatible with it. At this point, you can't import ROOT in the notebook Python 3 set up. It may also be missing some standard Python packages.

If there's some additional feature you'd like available to run Python 3 scripts on notebook, let WilliamSeligman know. However, I'm not likely to put much emphasis on Python 3 until ROOT has reached full Python 3 compatibility.

Added:
>
>

SageMath

SageMath is an open-source mathematics software system. It's a wrapper around different symbolic math and statistical packages. It's intended as a open-source replacement for Maple, Mathematica, and Matlab. Here's a tutorial.

If you ask me if we have Mathematica at Nevis, this is where I'll send you.

Tcl

Tcl is another scripting language, frequently used with a graphical component Tk. The latter is included with Python, but it might not function properly in the web-browser environment of Jupyter. Here's a tutorial.

Revision 72017-02-22 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"
Changed:
<
<

iPython/Jupyter at Nevis

>
>

iPython/Jupyter at Nevis

 
Changed:
<
<
Jupyter (formerly iPython) has become a popular tool for interactive physics analysis. Here's what you have to know to use Jupyter at Nevis.
>
>
 
Changed:
<
<

Setup

>
>
Jupyter (formerly iPython) has become a popular tool for interactive physics analysis. Here some examples of what you can do with notebooks. There is a dedicated Jupyter server, notebook, available for the users of the Nevis Linux cluster. To use it, visit https://notebook.nevis.columbia.edu and enter your Nevis cluster account name and password.
 
Changed:
<
<
Jupyter/iPython has been made part of the Python 2.7 distribution at Nevis. This is not available by default. You have to activate it with the environment modules command:
module load python/2.7
>
>

The basics

 
Changed:
<
<
Note that if you use environment modules to load ROOT 6.02 or greater, this above command is executed automatically.
>
>
When you visit notebook for the first time, you'll see your home directory. You can perform some elementary file operations from this screen: check the box next to a filename, and you'll see an option near the top of the screen to rename or delete the file. The "Upload" button near the top left allows you to copy files from the computer you're using to the Nevis cluster.
 
Changed:
<
<
Once you do this, you'll be able to run Jupyter normally:
jupyter notebook
>
>
To start a notebook, click on the "New" button near the top left and select one of the "kernels". (Selecting "Text File" will take you a basic text editor. "Terminal" will you give you a "login not available" screen, since users are not allowed to login directly to notebook; for a shell, login directly to your workgroup's server.)
 
Changed:
<
<
Note that this will start up a web browser on the system on which you execute the command (not your laptop!), with the web page open to localhost:8888.
>
>
To "execute" the contents of a given cell, hit SHIFT-ENTER with your cursor in that cell.
 
Changed:
<
<

Remote access

Almost certainly, the above command is not what you want. Most users want to run Jupyter via a web browser on their laptops. To do this, you must port-forward a connection via ssh. The complete instructions are here. What follows is a brief summary.

On the Nevis server, this command will start up Jupyter for you:

>
>
In addition to the kernel languages listed below, in any notebook cell you can type "magic" commands that have affects on your system beyond what kernel's language normally provides. The magic commands I use most often are:
 
Changed:
<
<
jupyter notebook --no-browser --port=XXXX
>
>
ls %cd %cp <new-file-loc> %jsroot on
 
Changed:
<
<
... where XXXX is an unused port on the server; e.g., 7000. Then on your laptop you can forward that port to you:
>
>
That last magic command, %jsroot on, is only available in ROOT notebooks (the first two kernels listed below). JSROOT adds some interactivity to ROOT plots.
 
Changed:
<
<
ssh -N -f -L localhost:YYYY:localhost:XXXX <username@server.nevis.columbia.edu>

...where <username@server.nevis.columbia.edu> is your Nevis account on the server on which you ran the jupyter command. YYYY can be any unused port on your laptop; often users pick YYYY=XXXX, but you don't have to.

Then to access the notebook, go to the web browser on your laptop and visit http://localhost:YYYY

>
>

Kernels

 
Changed:
<
<

Browser configuration

>
>
These are the "kernels" (active interpreters/compilers) available on the notebook server. The first two listed are the ones mostly likely to be used; the rest are listed in alphabetical order.
 
Changed:
<
<
There's a potential problem with that last step: Most current web browsers won't let you visit random ports anymore. In Firefox, there is a workaround; in Safari there isn't. The simplest solution is to let YYYY be a generally-recognized port for internet access; e.g., 8080.
>
>

Python 2

 
Changed:
<
<

Using ROOT within Jupyter

>
>
Python is a interpretive scripting language. It's becoming more widely used in physics as both a scripting and analysis language. Here's a tutorial. You'll probably also be interested in the commonly-used scientific packages NumPy (which implement arrays), SciPy, and mathplotlib. If there's some standard Python package that's not included on the notebook server, let WilliamSeligman know.
 
Changed:
<
<
You'll need the rootnotes package. There's a version (not necessarily the latest) in WilliamSeligman's area:
cp ~seligman/root-class/rootnotes.py <your working directory>
>
>
package includes PyROOT, a Python-based interface to ROOT. Here's an example of how to use it.
 
Changed:
<
<
You can then see ROOT graphics integrated in the browser window; e.g.,
>
>
You'll probably want the rootnotes package, which enables ROOT plots to appear within your notebook. A typical example:
 
# This also imports ROOT.
import rootnotes
Added:
>
>
# You may want this if you'd like your ROOT plots to be interactive in the notebook. %jsroot on
 # Define a canvas my_canvas = rootnotes.default_canvas()
Line: 64 to 53
  # You have to type the name of the canvas to see anything my_canvas \ No newline at end of file
Added:
>
>

ROOT C++

This kernel is the ROOT C++ interpreter, cling. In addition to working with ROOT, it also provides the C++ language within a notebook. Here's an example of using ROOT within a notebook (the C++ example is near the bottom).

Bash

Bash (from "Bourne-Again SHell") is a shell language for UNIX systems. There's a good chance it's the shell you use when you login to the Nevis Linux cluster. With this kernel, you can develop shell scripts.

Fortran

FORTRAN (from "FORmula TRANslation") is a mathematical computer language. For decades it was the backbone of computer programming in physics, and many say that it's still the most efficient language for implementing mathematical tasks. This kernel provides an interface to the GNU gfortran compiler, which is is fully compliant with the Fortran 95 Standard and includes some Fortran 2003 and Fortran 2008 features.

Note:

  • The Fortran compiler provided within the notebook server does not include CERNLIB.
  • You can also create Fortran functions that can be called by Python routines using Fortran magic.

Octave

Octave is a scientific programming language, with nice features for handling vectors and matrices, and with good visualization features. It's an open-source equivalent of Matlab. Here's a tutorial.

Python 3

For completeness, the current version of Python 3 is available as a kernel. Although Python 3 is the future of the Python language, ROOT is not yet fully compatible with it. At this point, you can't import ROOT in the notebook Python 3 set up. It may also be missing some standard Python packages.

If there's some additional feature you'd like available to run Python 3 scripts on notebook, let WilliamSeligman know. However, I'm not likely to put much emphasis on Python 3 until ROOT has reached full Python 3 compatibility.

Revision 62017-02-15 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

iPython/Jupyter at Nevis

Line: 52 to 52
  You can then see ROOT graphics integrated in the browser window; e.g.,
Changed:
<
<
import ROOT
>
>
# This also imports ROOT.
 import rootnotes

# Define a canvas

Revision 52016-05-23 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

iPython/Jupyter at Nevis

Line: 59 to 59
 my_canvas = rootnotes.default_canvas()

hist=ROOT.TH1F("hist","example histogram",100,-3,3)

Deleted:
<
<
hist
 hist.FillRandom("gaus",100000) hist.Draw()

Revision 42016-05-20 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

iPython/Jupyter at Nevis

Line: 11 to 11
 module load python/2.7
Added:
>
>
Note that if you use environment modules to load ROOT 6.02 or greater, this above command is executed automatically.
 Once you do this, you'll be able to run Jupyter normally:
jupyter notebook
Line: 40 to 42
 

Browser configuration

There's a potential problem with that last step: Most current web browsers won't let you visit random ports anymore. In Firefox, there is a workaround; in Safari there isn't. The simplest solution is to let YYYY be a generally-recognized port for internet access; e.g., 8080.

Added:
>
>

Using ROOT within Jupyter

You'll need the rootnotes package. There's a version (not necessarily the latest) in WilliamSeligman's area:

cp ~seligman/root-class/rootnotes.py <your working directory>

You can then see ROOT graphics integrated in the browser window; e.g.,

import ROOT
import rootnotes

# Define a canvas
my_canvas = rootnotes.default_canvas()

hist=ROOT.TH1F("hist","example histogram",100,-3,3)
hist
hist.FillRandom("gaus",100000)
hist.Draw()

# You have to type the name of the canvas to see anything
my_canvas

Revision 32016-05-20 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

iPython/Jupyter at Nevis

Line: 16 to 16
 jupyter notebook
Added:
>
>
Note that this will start up a web browser on the system on which you execute the command (not your laptop!), with the web page open to localhost:8888.
 

Remote access

Almost certainly, the above command is not what you want. Most users want to run Jupyter via a web browser on their laptops. To do this, you must port-forward a connection via ssh. The complete instructions are here. What follows is a brief summary.

Line: 31 to 33
 ssh -N -f -L localhost:YYYY:localhost:XXXX <username@server.nevis.columbia.edu>
Changed:
<
<
...where <username@server.nevis.columbia.edu> is your Nevis account on the server on which you ran the jupyter command. YYYY can be any unused port on your laptop; typically users pick YYYY=XXXX, but you don't have to.
>
>
...where <username@server.nevis.columbia.edu> is your Nevis account on the server on which you ran the jupyter command. YYYY can be any unused port on your laptop; often users pick YYYY=XXXX, but you don't have to.
 
Changed:
<
<
Then to access the notebook, go to your web browser and visit http://localhost:YYYY
>
>
Then to access the notebook, go to the web browser on your laptop and visit http://localhost:YYYY
 

Browser configuration

Revision 22016-01-29 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

iPython/Jupyter at Nevis

Line: 37 to 37
 

Browser configuration

Changed:
<
<
There's a potential problem with that last step: Most current web browsers won't let you visit random ports anymore. In Firefox, there is a workaround; in Safari there isn't.
>
>
There's a potential problem with that last step: Most current web browsers won't let you visit random ports anymore. In Firefox, there is a workaround; in Safari there isn't. The simplest solution is to let YYYY be a generally-recognized port for internet access; e.g., 8080.
 \ No newline at end of file

Revision 12015-12-07 - WilliamSeligman

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="Computing"

iPython/Jupyter at Nevis

Jupyter (formerly iPython) has become a popular tool for interactive physics analysis. Here's what you have to know to use Jupyter at Nevis.

Setup

Jupyter/iPython has been made part of the Python 2.7 distribution at Nevis. This is not available by default. You have to activate it with the environment modules command:

module load python/2.7

Once you do this, you'll be able to run Jupyter normally:

jupyter notebook

Remote access

Almost certainly, the above command is not what you want. Most users want to run Jupyter via a web browser on their laptops. To do this, you must port-forward a connection via ssh. The complete instructions are here. What follows is a brief summary.

On the Nevis server, this command will start up Jupyter for you:

jupyter notebook --no-browser --port=XXXX

... where XXXX is an unused port on the server; e.g., 7000. Then on your laptop you can forward that port to you:

ssh -N -f -L localhost:YYYY:localhost:XXXX <username@server.nevis.columbia.edu>

...where <username@server.nevis.columbia.edu> is your Nevis account on the server on which you ran the jupyter command. YYYY can be any unused port on your laptop; typically users pick YYYY=XXXX, but you don't have to.

Then to access the notebook, go to your web browser and visit http://localhost:YYYY

Browser configuration

There's a potential problem with that last step: Most current web browsers won't let you visit random ports anymore. In Firefox, there is a workaround; in Safari there isn't.

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback