<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Jupyter Blog - Giulio Girardi</title><link href="https://jasongrout.github.io/medium-archive/pelican/" rel="alternate"/><link href="https://jasongrout.github.io/medium-archive/pelican/feeds/author-giulio-girardi.atom.xml" rel="self"/><id>https://jasongrout.github.io/medium-archive/pelican/</id><updated>2023-01-11T17:33:00+00:00</updated><subtitle>The Project Jupyter blog: news, releases, and community stories, archived from blog.jupyter.org.</subtitle><entry><title>A Jupyter kernel for GNU Octave</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/" rel="alternate"/><published>2023-01-11T17:33:00+00:00</published><updated>2023-01-11T17:33:00+00:00</updated><author><name>Giulio Girardi</name></author><id>tag:jasongrout.github.io,2023-01-11:/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/</id><summary type="html">&lt;p&gt;Today, we are happy to announce the xeus-octave project, a Jupyter kernel for GNU Octave.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/001-0__HZJpXD-awr4mPDG.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;GNU Octave is a long-standing member of the scientific computing ecosystem, featuring a mathematics-oriented syntax with built-in 2D/3D plotting and visualization tools, and compatible with the Matlab syntax. It is a natural candidate for high-quality integration in the Jupyter ecosystem.&lt;/p&gt;
&lt;p&gt;Jupyter has been devised with language agnosticism in mind since it was spun off from the IPython project. The Kernel (the part of the infrastructure responsible for executing the code input by the user) is a key extension point to Jupyter, and dozens of language kernels exist in the ecosystem.&lt;/p&gt;
&lt;p&gt;Prior art on Jupyter / GNU Octave integration includes the &lt;a href="https://github.com/Calysto/octave_kernel"&gt;Calysto/Octave_kernel&lt;/a&gt; project by Steven Silvester (who is also a core Jupyter maintainer and the co-creator of JupyterLab). This existing kernel is part of the family of kernels built on top of the &lt;a href="https://github.com/ipython/ipykernel"&gt;ipykernel&lt;/a&gt; reference implementation of the Jupyter protocol, in Python.&lt;/p&gt;
&lt;p&gt;Today, we are happy to announce the &lt;a href="https://github.com/jupyter-xeus/xeus-octave/"&gt;xeus-octave&lt;/a&gt; project, a Jupyter kernel for GNU Octave. Xeus-octave was created by &lt;a href="http://rapgenic.it/"&gt;Giulio Girardi&lt;/a&gt;, recently joined by &lt;a href="https://twitter.com/AntoineProuvost"&gt;Antoine Prouvost&lt;/a&gt; — and has been incorporated into the Project Jupyter governance.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/002-0__YEF9gl4rxnapBiz.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;Xeus-octave is built upon the &lt;a href="https://github.com/jupyter-xeus/xeus"&gt;Xeus&lt;/a&gt; library, a C++ implementation of the Jupyter kernel protocol that enables fast development of new kernels using programming languages’ native APIs, unlocking new possibilities without parsing standard outputs or requiring a Python interpreter at runtime. After all, a Jupyter kernel is merely an executable providing a well-defined communication protocol. It is not bound to Python APIs.&lt;/p&gt;
&lt;h2 id="a-fully-featured-kernel"&gt;A fully-featured kernel&lt;/h2&gt;
&lt;p&gt;We strove to make the xeus-octave kernel as complete as possible for this first iteration.&lt;/p&gt;
&lt;h2 id="multiple-graphical-toolkits"&gt;Multiple graphical toolkits&lt;/h2&gt;
&lt;h3 id="notebook"&gt;Notebook&lt;/h3&gt;
&lt;p&gt;A &lt;code&gt;notebook&lt;/code&gt; Octave graphical toolkit can be used to render plots natively, and present the figure as an image in the notebook.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Screenshot of GNU Octave in action in Jupyter with the native Octave plots" src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/003-0_0tfvTOYDrjvK6SyO.jpg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The classic Octave sombrero plot rendered as an image inside the notebook&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id="plotly"&gt;Plotly&lt;/h3&gt;
&lt;p&gt;An experimental &lt;code&gt;plotly&lt;/code&gt; Octave graphical toolkit can also use &lt;a href="https://plotly.com/"&gt;Plotly&lt;/a&gt; to render code in the browser, with dynamic views, zooms, and hover tooltips.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Screenshot of GNU Octave in action in Jupyter with the Plotly plots" src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/004-0_ZT86_erLnKUyRvP4.jpg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Multiple plots rendered in a single plotly figure&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="rich-display"&gt;Rich display&lt;/h2&gt;
&lt;p&gt;The kernel binds with the C++ interface of GNU Octave to provide a complete Octave experience. Having access to the exact internal type of the objects, xeus-octave can present data with rich output.&lt;/p&gt;
&lt;p&gt;Matrices can be presented as HTML or LaTeX tables.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/005-0_015CLZOO-yfxSRSe.webp" alt="Screenshot of GNU Octave in action in Jupyter with the rich rendering of matrices" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;Symbolic expressions can be presented as LaTeX formulas.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/006-0_U-Nxc_9FqhxARiGF.webp" alt="Screenshot of GNU Octave in action in Jupyter with the rich rendering of equations" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;Structured data can be visualized as interactive tree views&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/007-0_oshl__rdb1-OtfCM.webp" alt="Screenshot of GNU Octave in action in Jupyter with the rich rendering of Octave structured data as interactive tree views." loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;h2 id="interactive-help"&gt;Interactive help&lt;/h2&gt;
&lt;p&gt;Formatted help, extracted from the GNU Octave reference manual, can be queried using the &lt;code&gt;?&lt;/code&gt; syntax.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/008-0_zQcXBUjgbwqY0IHG.webp" alt="Screenshot of GNU Octave in action in Jupyter with the interactive help displayed in an output cell" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;h2 id="trying-it-online"&gt;Trying it online&lt;/h2&gt;
&lt;p&gt;You can try the new Jupyter kernel for GNU Octave by clicking on the link below:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://mybinder.org/v2/gh/jupyter-xeus/xeus-octave/stable?urlpath=/lab/tree/notebooks/xeus-octave.ipynb"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/009-0_SDB4IuVwEGuk2yz1.webp" alt="Logo of Binder" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Binder linked above includes examples of notebooks in the fields of Electronics, demonstrating the usability of xeus-octave in real-life complex scenarios.&lt;/p&gt;
&lt;p&gt;This interactive demo is also featured on the Jupyter website at &lt;a href="https://jupyter.org/try#kernels"&gt;https://jupyter.org/try#kernels&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="installing-xeus-octave"&gt;Installing xeus-octave&lt;/h2&gt;
&lt;p&gt;Xeus-octave has been packaged on conda-forge and can be installed with mamba or conda.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;mamba&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;xeus-octave&lt;span class="w"&gt; &lt;/span&gt;-c&lt;span class="w"&gt; &lt;/span&gt;conda-forge
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="future-work"&gt;Future Work&lt;/h2&gt;
&lt;p&gt;In future iterations, we will work towards consolidating the xeus-octave experience, by adding cell magics and improving the Plotly integration.&lt;/p&gt;
&lt;p&gt;A major ongoing development is the implementation of an Octave backend for Jupyter interactive widgets, based on the &lt;a href="https://github.com/jupyter-xeus/xwidgets"&gt;xwidgets&lt;/a&gt; project. Combined with &lt;a href="https://github.com/voila-dashboards/voila"&gt;Voilà&lt;/a&gt;, it will be possible to use GNU Octave to create standalone web dashboards.&lt;/p&gt;
&lt;p&gt;Another ongoing endeavor is to port a growing portion of the scientific computing stack to WebAssembly (using the emscripten-forge project). Producing a Wasm build of GNU Octave will enable its use with &lt;a href="https://github.com/jupyterlite/jupyterlite"&gt;Jupyterlite&lt;/a&gt;, enabling large-scale deployments on websites, blogs, and arbitrary web pages without any need for scalable cloud infrastructure.&lt;/p&gt;
&lt;h2 id="about-the-authors"&gt;&lt;strong&gt;About the authors&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/010-1_h3ZtdyQicGecxGFPkc3tYQ.jpeg" alt="Headshot of Antoine Prouvost" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/AntoineProuvost"&gt;Antoine Prouvost&lt;/a&gt; is a Scientific Software Engineer at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt; and a xeus-octave maintainer. Previously, Antoine was researching Machine Learning and Combinatorial Optimization at the &lt;a href="https://twitter.com/DS4DM"&gt;DS4DM&lt;/a&gt; research chair and &lt;a href="https://twitter.com/MILAMontreal"&gt;Mila&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2023/a-jupyter-kernel-for-gnu-octave/images/011-1_vUpNORkYEpszm-vTZoSXwg.jpeg" alt="Headshot of Giulio Girardi" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://rapgenic.it/"&gt;Giulio Girardi&lt;/a&gt; is a Master’s degree student in Electronic Engineering at the &lt;a href="https://twitter.com/UniPadova"&gt;UNIPD&lt;/a&gt;, currently working as an Electronic Engineer at &lt;a href="http://protechgroup.it/"&gt;Protech Engineering&lt;/a&gt;. Giulio is the creator and a maintainer of the xeus-octave project.&lt;/p&gt;
</content><category term="kernels"/></entry></feed>