Поиск по блогу

среда, 28 сентября 2016 г.

Jupyter и IPython - заметки при первом беглом чтении документации

Заинтересовался темой Making kernels for IPython. Нашел описание This section focuses on IPython and Jupyter notebook and how they interact. Однако времени на изучение нет. Здесь фрагменты и ссылки, для будущих упражнений.
И видео (немного не оп теме) "Real time Collaborative Jupyter Notebook in Escherpad"

IPython and Jupyter notebook This section focuses on IPython and Jupyter notebook and how they interact. This model is often called a REPL, or Read-Eval-Print-Loop.
IPython/Jupyter kernels IPython kernels for other languages Suvarchal Kumar Cheedela edited this page 2 hours ago · 115 revisions
IJavascript is a javascript kernel for the Jupyter notebook
kernel github search We’ve found 716 repository results

Making kernels for IPython

video Real time Collaborative Jupyter Notebook in Escherpad
Plotly CLOUD 1 GB of Storage free
escherpad.com We are developing a new way to write math and code collaboratively. Sign up here to get the first invites to the private beta!

When we discuss IPython, we talk about two fundamental roles - "terminal" and "kernel"

Terminal IPython as the familiar REPL
The IPython kernel that provides computation and communication with the frontend interfaces, like the notebook...

In [1]:
from IPython.display import Image
In [2]:
Image('http://jupyter.readthedocs.io/en/latest/_images/ipy_kernel_and_terminal.png')
Out[2]:

Terminal... But the model is like code example: prompt the user for some code, and when they’ve entered it, execute it in the same process. This model is often called a REPL, or Read-Eval-Print-Loop.

...kernel... All the other interfaces —- the Notebook, the Qt console, ipython console in the terminal, and third party interfaces —- use the IPython Kernel.

The IPython Kernel is a separate process which is responsible for running user code, and things like computing possible completions.
Frontends, like the notebook or the Qt console, communicate with the IPython Kernel using JSON messages sent over ZeroMQ sockets;

the protocol used between the frontends and the IPython Kernel is described in Messaging in Jupyter.

Notebook

The Notebook frontend does something extra. In addition to running your code, it stores code and output, together with markdown notes, in an editable document called a notebook. When you save it, this is sent from your browser to the notebook server, which saves it on disk as a JSON file with a .ipyhnb extension.

In [3]:
Image('http://jupyter.readthedocs.io/en/latest/_images/notebook_components.png')
Out[3]:

The notebook server, not the kernel, is responsible for saving and loading notebooks, so you can edit notebooks even if you don’t have the kernel for that language—you just won’t be able to run code. The kernel doesn’t know anything about the notebook document: it just gets sent cells of code to execute when the user runs them.

The following Jupyter kernels are widely used in data science:

python
IPython (GitHub Repo)
R
IRkernel (Documentation, GitHub Repo)
IRdisplay (GitHub Repo)
repr (GitHub Repo)
Julia
IJulia Kernel (GitHub Repo)
br/>Interactive Widgets (GitHub Repo)
Bash (GitHub Repo)

In [ ]:
Configuration
The jupyter Command
Common Directories and File Locations
Jupyters Common Configuration Approach

Usage and Projects
Jupyter Projects
IPython Projects
Incubator Projects
Kernels (Programming Languages)
Project Documentation
In [ ]:
[py35] C:\Users\alter_000\jupyter-nodejs>jupyter --config-dir
C:\Users\alter_000\.jupyter

[py35] C:\Users\alter_000\jupyter-nodejs>jupyter --data-dir
C:\Users\alter_000\AppData\Roaming\jupyter

[py35] C:\Users\alter_000\jupyter-nodejs>jupyter --paths
config:
    C:\Users\alter_000\.jupyter
    C:\Users\alter_000\Anaconda\envs\py35\etc\jupyter
    C:\ProgramData\jupyter
data:
    C:\Users\alter_000\AppData\Roaming\jupyter
    C:\Users\alter_000\Anaconda\envs\py35\share\jupyter
    C:\ProgramData\jupyter
runtime:
    C:\Users\alter_000\AppData\Roaming\jupyter\runtime

[py35] C:\Users\alter_000\jupyter-nodejs>jupyter --runtime-dir
C:\Users\alter_000\AppData\Roaming\jupyter\runtime

[py35] C:\Users\alter_000\jupyter-nodejs>


Посты чуть ниже также могут вас заинтересовать

Комментариев нет:

Отправить комментарий