<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Jupyter Blog - Wolf Vollprecht</title><link href="https://jupyter.org/blog/" rel="alternate"/><link href="https://jupyter.org/blog/feeds/author-wolf-vollprecht.atom.xml" rel="self"/><id>https://jupyter.org/blog/</id><updated>2020-08-11T13:20:00+00:00</updated><subtitle>The Project Jupyter blog: news, releases, and community stories, archived from blog.jupyter.org.</subtitle><entry><title>JupyterLab, the Cloud Robotics Command Station</title><link href="https://jupyter.org/blog/posts/2020/jupyterlab-ros/" rel="alternate"/><published>2020-08-11T13:19:00+00:00</published><updated>2020-08-11T13:20:00+00:00</updated><author><name>Carlos Herrero</name></author><id>tag:jupyter.org,2020-08-11:/blog/posts/2020/jupyterlab-ros/</id><summary type="html">&lt;p&gt;Building a cloud robotics development platform using JupyterLab and ROS&lt;/p&gt;
</summary><content type="html">&lt;figure&gt;
&lt;img alt="JupyterLab-ROS with Voilà to quickly make a standalone web app" src="https://jupyter.org/blog/posts/2020/jupyterlab-ros/images/001-1_zfaBPxiCzlnoNoKrVpcrIA.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;JupyterLab-ROS with Voilà to quickly make a standalone web app&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The ROS open-source project (Robot Operating System) has become a &lt;em&gt;de-facto&lt;/em&gt; industry standard in the robotics community. Very much like with Project Jupyter, a large collection of software has been built upon well-specified communication protocols. ROS has become a rich ecosystem of standardized tools for building and distributing ROS-based software, exploratory robotics development, and much more.&lt;/p&gt;
&lt;p&gt;With &lt;em&gt;Industry 4.0&lt;/em&gt;, the number of robots and smart devices has been increasing exponentially. We are talking about fully automated factories with hundreds of robots and thousands of connected sensors, generating large amounts of raw data.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There is an opportunity in bridging the ROS and the open-source data science ecosystems and tools.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For this reason, we set ourselves to bring together these ecosystems,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;by producing a collection of JupyterLab extensions for ROS, turning JupyterLab into a &lt;em&gt;cloud robotics command station&lt;/em&gt;,&lt;/li&gt;
&lt;li&gt;by integrating ROS packages with conda / mamba package management system, to enable their installation alongside other open-source data-science packages.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="jupyterlab-the-cloud-robotics-command-station"&gt;JupyterLab, the cloud robotics command station&lt;/h2&gt;
&lt;p&gt;While the traditional developer tools from the ROS stack such as RViz are desktop-based, we think that a robotics development environment running in a web browser would provide a lot of flexibility. Also, the ideal robotics developer platform should be plugin-based, and easily extensible to account for the diversity of use cases to enable, from simple interactive scripting to visualization or large datasets. Finally, we should build this environment upon broadly adopted foundations, with open governance, and not let a single entity hold the keys to the ROS ecosystem.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Jupyter is a natural candidate to serve as the foundation for a web-based robotics development environment.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;JupyterLab is a web-based interactive development environment that has many of the much-needed features&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In JupyterLab, everything is a plugin, including the core components to the application. Anyone can produce a “remix” of core and third-party JupyterLab extensions to their needs.&lt;/li&gt;
&lt;li&gt;Very much in the spirit of ROS, one of the keys to Jupyter’s success is that the project was built upon well-documented and specified protocols and file formats that anyone could implement.&lt;/li&gt;
&lt;li&gt;Jupyter is a multi-stakeholder project, not backed by a single corporation, but by a community of developers at a variety of companies, universities, as well as individual contributors.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Today, we are announcing the first beta of JupyterLab-ROS, a collection of JupyterLab plugins to integrate ROS with the JupyterLab platform. We combine the best of the data-science and robotics worlds to help developers build custom solutions for the industry. ROS can run in a high-performance server while JupyterLab is accessed in a web-browser (on Windows, OS X or Linux).&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="JupyterLab-ROS" src="https://jupyter.org/blog/posts/2020/jupyterlab-ros/images/002-1_98A8hXDk_cgVqdoA6EPXAg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;JupyterLab-ROS&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;JupyterLab-ROS automatically starts a rosmaster and rosbridge_server making all the painful setup of WebSockets connections completely transparent to users. A status bar widget allows you to start and stop the rosmaster server with a simple click and displays its state in real-time. Internally this widget runs a launch file which can be changed from the JupyterLab settings UI to launch additional nodes.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Master status widget" src="https://jupyter.org/blog/posts/2020/jupyterlab-ros/images/003-1_TA29a27cM-21mdTkdBQQxA.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Master status widget&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Another important component of the ROS stack is RViz, a desktop-based 3-D visualization tool. It’s web-based counterpart in JupyterLab is Zethus, started by Rapyuta Robotics. This plugin supports most of the display types supported by RViz. It also provides an info panel that displays the raw messages in realtime, and a web-based version of rqt_graph for visualizing the ROS node graph.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Zethus" src="https://jupyter.org/blog/posts/2020/jupyterlab-ros/images/004-1_lzap6vG9lEBSQsg9rj7zog.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Zethus&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;A robotics station would be incomplete without a tool for debugging. For that purpose, ROS provides rosconsole, a package which allows developers to send messages to rosout and make them available on every node. The console gives access to these debugging messages in JupyterLab and provides additional features such as filtering by level and by node.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Log Console" src="https://jupyter.org/blog/posts/2020/jupyterlab-ros/images/005-1_OAsQ5PQoERlx2Tmex25aLg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Log Console&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="robotics-notebooks"&gt;Robotics Notebooks&lt;/h2&gt;
&lt;p&gt;A key component to the Jupyter stack is the Notebook, an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. It’s frequently used to do data cleaning and transformation, numerical simulation, statistical modelling, data visualization, machine learning etc.&lt;/p&gt;
&lt;p&gt;The notebook could be the perfect tool for robotics researchers and educators to make (and share) experiments in control algorithms, working in a dynamic and interactive development environment that allows quick prototyping and exploratory analysis while having access to the sophisticated mathematical libraries already well integrated with Jupyter. It can be tedious to have a different platform for interacting with robots and processing the data obtained from these, JupyterLab-ROS combines both toolsets and enables an integrated workflow.&lt;/p&gt;
&lt;p&gt;At the same time, many projects are becoming more and more interdisciplinary. Currently, it is common to see projects mixing topics like machine learning and robotics. JupyterLab-ROS opens a new world of possibilities for machine learning researchers that are interested in applying their models to robots: now they have the possibility of connecting a robot to a development environment that they are very familiar with.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/RoboStack/jupyter-ros"&gt;JupyROS&lt;/a&gt; is another powerful library that leverages &lt;a href="https://github.com/jupyter-widgets/ipywidgets/"&gt;ipywidgets&lt;/a&gt; and &lt;a href="https://github.com/bqplot/bqplot"&gt;bqplot&lt;/a&gt; to integrate ROS in Jupyter Notebooks, being able to show real time plots from ROS messages and create intuitive forms to control robots in minutes.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Interactive Robotics in the Jupyter Notebook, with live plotting" src="https://jupyter.org/blog/posts/2020/jupyterlab-ros/images/006-1_GN-BDT8ZT8GOcVZPKb44cg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Interactive Robotics in the Jupyter Notebook, with live plotting&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="ros-package-management"&gt;ROS Package management&lt;/h2&gt;
&lt;p&gt;Modern scientific computing applications typically depend on a large number of libraries. &lt;a href="https://conda-forge.org/"&gt;Conda-forge&lt;/a&gt; is a community initiative to package scientific libraries for the conda package manager, and has become a &lt;em&gt;de-facto&lt;/em&gt; standard source of packages for the scientific computing community, with tens of thousands of available packages, and thousands of contributors.&lt;/p&gt;
&lt;p&gt;During the last year, we have worked hard to package more and more of ROS as &lt;em&gt;conda packages&lt;/em&gt;. Conda-packages for ROS Melodic, including RViz are now available on all three operating systems! You can find the packages on the &lt;a href="https://anaconda.org/robostack"&gt;RoboStack channel&lt;/a&gt; (a more detailed blog post about this is going to follow soon).&lt;/p&gt;
&lt;p&gt;Conda can be used to create virtual environments for ROS projects, which makes it possible to install Melodic, Kinect and Dashing side-by-side on the same Linux system, and have exact control over package versions.&lt;/p&gt;
&lt;p&gt;We are also working on &lt;a href="https://github.com/TheSnakePit/mamba"&gt;Mamba&lt;/a&gt;, a conda-compatible package manager implemented in C++. Together with &lt;a href="https://github.com/TheSnakePit/boa"&gt;Boa&lt;/a&gt; this effort will help to continuously build and release ROS packages on conda.&lt;/p&gt;
&lt;h2 id="try-it-online"&gt;Try it online!&lt;/h2&gt;
&lt;p&gt;You can try the JupyterLab-ROS extension online without installing anything by just clicking on the following binder link:&lt;/p&gt;
&lt;p class="standalone-image"&gt;&lt;a href="https://mybinder.org/v2/gh/RoboStack/jupyterlab-ros/master?urlpath=lab/tree/examples"&gt;&lt;img src="https://jupyter.org/blog/posts/2020/jupyterlab-ros/images/007-1_PZkzz4bGGPEyHlx-bbNRHg.webp" alt="Launch Binder" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;JupyterLab-ROS is under active development. We are working on new features such as a rosbag widget to play and record bag files and improving existing ones like the roslaunch widget. If you are interested in contributing to JupyterLab-ROS you can find the code at &lt;a href="https://github.com/RoboStack/jupyterlab-ros"&gt;this repository&lt;/a&gt; in the RoboStack organization. Contributions are always welcome!&lt;/p&gt;
&lt;h2 id="installation"&gt;Installation&lt;/h2&gt;
&lt;p&gt;You can install JupyterLab-ROS using Mamba, the first step to create a new environment with JupyterLab and the ROS packages necessary, then you can install the extension.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mamba create -n test -c conda-forge -c robostack python=3.6 nodejs=12 jupyterlab ros-melodic-ros-core ros-melodic-rosauth ros-melodic-rospy ros-melodic-rosbridge-suite ros-melodic-rosbag ros-melodic-tf2-web-republisher

conda activate test

pip install jupyter-ros-server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you have any questions don’t hesitate to contact us on the &lt;a href="https://gitter.im/RoboStack/Lobby"&gt;RoboStack&lt;/a&gt; or &lt;a href="https://gitter.im/QuantStack/Lobby"&gt;QuantStack&lt;/a&gt; chats.&lt;/p&gt;
&lt;iframe src="https://www.youtube-nocookie.com/embed/vad9ZAUyw7k" title="JupyterLab ROS Demo" width="560" height="315" style="aspect-ratio: 560 / 315" loading="lazy" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen&gt;&lt;/iframe&gt;
&lt;p&gt;This work has many collaborators around the world, and we are especially grateful to &lt;a href="https://github.com/chaitanya-deep"&gt;Deep Chaitanya&lt;/a&gt; &amp;amp; &lt;a href="https://github.com/tocttou"&gt;Ashish Chaudhary&lt;/a&gt; from Rapyuta Robotics, &lt;a href="https://github.com/seanyen"&gt;Sean Yen&lt;/a&gt; from Microsoft for his amazing work on vinca that automagically generates the conda-recipes, &lt;a href="https://github.com/Tobias-Fischer"&gt;Tobias Fischer&lt;/a&gt; for many patches and pushing us to bring OS X support to the conda packages as well. Many thanks to &lt;a href="https://github.com/jtpio"&gt;Jeremy Tuloup&lt;/a&gt; for his help with the JupyterLab extension system.&lt;/p&gt;
&lt;h2 id="about-the-authors"&gt;About the authors&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://twitter.com/wuoulf"&gt;Wolf Vollprecht&lt;/a&gt; works as a scientific and robotics software developer for QuantStack in Paris and Berlin.&lt;/p&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2020/jupyterlab-ros/images/008-1_HnFdxHmGARUXhanv9pDCYg.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/CarlosHerreroB"&gt;Carlos Herrero&lt;/a&gt; is a Computer Engineer passionate about AI and his applications on robotics. Currently working at QuantStack helping to develop Open Source projects.&lt;/p&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2020/jupyterlab-ros/images/009-1_uyE3rS6qzPDbNAJE5Mfx1A.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
</content><category term="JupyterLab"/><category term="robotics"/></entry><entry><title>ROS @ Jupyter</title><link href="https://jupyter.org/blog/posts/2019/ros-jupyter/" rel="alternate"/><published>2019-04-07T21:15:00+00:00</published><updated>2019-04-07T21:15:00+00:00</updated><author><name>Wolf Vollprecht</name></author><id>tag:jupyter.org,2019-04-07:/blog/posts/2019/ros-jupyter/</id><summary type="html">&lt;p&gt;Project Jupyter is a huge hit in data science, but it has not yet found widespread adoption in robotics. Today, we are releasing the first version of jupyter-ros, a collection of Jupyter interactive widgets inspired by Qt and RViz, to bring their features to the Jupyter ecosystem.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Project Jupyter is a huge hit in data science, but it has not yet found widespread adoption in robotics. Today, we are releasing the first version of jupyter-ros, a collection of Jupyter interactive widgets inspired by Qt and RViz, to bring their features to the Jupyter ecosystem. This may be the right time for Jupyter-based developer tools, as cloud robotics is taking off.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="A PR2 robot in the browser, and making him dance through the traditional Qt interface" src="https://jupyter.org/blog/posts/2019/ros-jupyter/images/005-Ri327iDKuC4pnExM4L-giphy.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;A PR2 robot in the browser, and making him dance through the traditional Qt interface&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Historically, the &lt;a href="http://www.ros.org/"&gt;ROS (Robot Operating System)&lt;/a&gt; community has relied on Qt for building complex user interfaces. Nowadays, the Jupyter notebook and the ipywidgets framework offer a compelling alternative for several reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Code and interface are &lt;em&gt;not separated&lt;/em&gt; — both are in the same notebook.&lt;/li&gt;
&lt;li&gt;Complex widgets using browser technology are possible: from &lt;a href="https://github.com/jupyter-widgets/ipywidgets"&gt;JavaScript sliders&lt;/a&gt; to 3D with &lt;a href="https://github.com/maartenbreddels/ipyvolume"&gt;WebGL&lt;/a&gt;, &lt;a href="https://github.com/maartenbreddels/ipywebrtc"&gt;real time video streaming with WebRTC&lt;/a&gt;…&lt;/li&gt;
&lt;li&gt;Works with any web browser — not bound to Linux, and no Qt applications need to be compiled.&lt;/li&gt;
&lt;li&gt;Doesn’t need to run locally! Applications can run on a server far away, without any manual setup or installation procedure.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However, ROS does not play nicely with Jupyter. For example, rospy is inherently multi-threaded (every new ROS topic subscriber spawns a new thread). Debug printouts in callbacks result in Jupyter printing that content into the output area of the active notebook cell, quickly flooding the user interface — and there is no easy way to stop logging threads once started.&lt;/p&gt;
&lt;h2 id="ipywidgets-to-the-rescue-jupyter-ros"&gt;ipywidgets to the rescue: jupyter-ros&lt;/h2&gt;
&lt;p&gt;That is why &lt;a href="https://github.com/RoboStack/jupyter-ros"&gt;jupyter-ros&lt;/a&gt; was created. It is a suite of plugins to the Jupyter ecosystem to make working with ROS inside Jupyter a breeze.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Subscribing with jupyter-ros produces an interactive widget" src="https://jupyter.org/blog/posts/2019/ros-jupyter/images/001-1_35w3erSL2xz0mp9le6YNyg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Subscribing with jupyter-ros produces an interactive widget&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;First, when you subscribe using jupyter-ros, the function returns an ipywidget with a start/stop button and a dedicated output area for debug prints. Internally this re-routes all print outs from your subscriber thread to this Jupyter cell, and gives full control over the thread (by being able to stop and restart it at any time).&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="The jupyros publishing sugar" src="https://jupyter.org/blog/posts/2019/ros-jupyter/images/002-1_yBgrLtyCGlaZcUQnFV9Jpg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The jupyros publishing sugar&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;If you call the publish function in jupyter-ros, a widget is automatically generated from the message specification. For example, a ROS message String field automatically becomes a text input widget, a Float32 becomes a FloatSlider…&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Live plotting IMU data from a BBC micro:bit" src="https://jupyter.org/blog/posts/2019/ros-jupyter/images/006-fSqNQ06Ujnuu8juH2t-giphy.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Live plotting IMU data from a BBC micro:bit&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Another interesting functionality is the live plotting, similar to rqt_plot. For this we use &lt;a href="https://github.com/bloomberg/bqplot"&gt;bqplot&lt;/a&gt;, a “jupyter-native” solution to plotting. With jupyter-ros, you can select a couple of fields from your message, and they will be automatically plotted to a bqplot.&lt;/p&gt;
&lt;h2 id="going-3-d"&gt;Going 3-D&lt;/h2&gt;
&lt;p&gt;Most robots are three dimensional, and so should be the visualizations! The go-to tool in the ROS ecosystem at the moment is RViz, a very powerful 3-D visualization tool.&lt;/p&gt;
&lt;p&gt;Some of RViz’s functionality has already been ported over to the web browser as part of the &lt;a href="http://robotwebtools.org/"&gt;RobotWebTools&lt;/a&gt; effort. We’ve been able to piggy-back on their impressive work, and we’re releasing the first iteration of ROS3D Jupyter widgets. Currently, they allow you to programatically plug together RViz like visualizations for different data types, such as laser scans, robot trajectories, and 3D (URDF) models of the robot!&lt;/p&gt;
&lt;p&gt;Thanks to the ipywidgetification, you can now bring complex visualizations to the web, without writing any JavaScript, and arrange those visualizations freely in JupyterLab.&lt;/p&gt;
&lt;figure&gt;
&lt;iframe src="https://www.youtube-nocookie.com/embed/mPvYZango2E" title="ROS widgets in JupyterLab" width="560" height="315" style="aspect-ratio: 560 / 315" loading="lazy" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen&gt;&lt;/iframe&gt;
&lt;figcaption&gt;
&lt;p&gt;Interactive widgets showing ROS data inside JupyterLab&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="jupyter-widgets-and-cloud-robotics"&gt;Jupyter, Widgets, and Cloud Robotics&lt;/h2&gt;
&lt;p&gt;We hope that Jupyter, and the jupyter-ros widgets will play a big role in cloud robotics. In cloud robotics, some of the software powering one or multiple robots runs on powerful computers in data centers. For monitoring purposes, or development, Jupyter and JupyterLab are perfect candidates. Robot customers will be able to login to a single user-friendly interface, without having to install any custom software on their machine, or run a specialized operating system (ROS usually runs on Ubuntu). Exciting possibilities arise: it is already possible to run a Docker container running JupyterLab and jupyter-ros on the leading cloud robotics platforms, &lt;a href="https://rapyuta-robotics.com"&gt;Rapyuta Robotics&lt;/a&gt; and their freshly launched platform &lt;a href="http://rapyuta.io"&gt;rapyuta.io&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="installation-source"&gt;Installation &amp;amp; source&lt;/h2&gt;
&lt;p&gt;The jupyter-ros widgets can be installed from PyPI using&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;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;jupyros
$&lt;span class="w"&gt; &lt;/span&gt;jupyter&lt;span class="w"&gt; &lt;/span&gt;nbextension&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;enable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;--py&lt;span class="w"&gt; &lt;/span&gt;--sys-prefix&lt;span class="w"&gt; &lt;/span&gt;jupyros
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The examples and the source code can be found on github: &lt;a href="https://github.com/robostack/jupyter-ros"&gt;https://github.com/robostack/jupyter-ros&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This work is still early stages and you might find some rough edges. We look forward to collaborating with the community to polish these widgets to the highest standards!&lt;/p&gt;
&lt;h2 id="about-quantstack"&gt;About QuantStack&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt; is located in the center of Europe (Paris). We are core Jupyter developers, and love ROS, and the cloud. If you are interested in working with us on professional user interfaces for developers or clients in the cloud, do not hesitate to send us an email: &lt;a href="mailto:wolf.vollprecht@quantstack.net"&gt;wolf.vollprecht@quantstack.net&lt;/a&gt;&lt;/p&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2019/ros-jupyter/images/003-1_puvws-ulE4ShvCd9inzo0g.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2019/ros-jupyter/images/004-1_WqG2vz1hl2X0-Z2TZFFSAQ.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
</content><category term="robotics"/><category term="visualization"/></entry><entry><title>A Diagram Editor for JupyterLab</title><link href="https://jupyter.org/blog/posts/2018/a-diagram-editor-for-jupyterlab/" rel="alternate"/><published>2018-02-26T11:33:00+00:00</published><updated>2018-02-26T11:51:00+00:00</updated><author><name>Wolf Vollprecht</name></author><id>tag:jupyter.org,2018-02-26:/blog/posts/2018/a-diagram-editor-for-jupyterlab/</id><summary type="html">&lt;p&gt;With the success of the notebook file format as a medium for communicating scientific results, more than an interactive development environment, Jupyter is turning into an interactive scientific authoring environment.&lt;/p&gt;</summary><content type="html">&lt;p&gt;With the success of the notebook file format as a medium for communicating scientific results, more than an interactive &lt;strong&gt;development&lt;/strong&gt; environment, Jupyter is turning into an interactive scientific &lt;strong&gt;authoring&lt;/strong&gt; environment.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="JupyterLab viewing LaTeX source code and a PDF document" src="https://jupyter.org/blog/posts/2018/a-diagram-editor-for-jupyterlab/images/001-0_SQhbgeWA5hO5_nt7.jpg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;JupyterLab viewing LaTeX source code and a PDF document&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;a href="https://jupyter.org/blog/posts/2018/jupyterlab-is-ready-for-users/"&gt;The new JupyterLab interface&lt;/a&gt; is much more than a replacement for the classic notebook. It aims to bring together all the pieces required for a complete scientific workflow. The extension-based architecture of JupyterLab comes with a number of components already enabled:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a Jupyter notebook,&lt;/li&gt;
&lt;li&gt;a text editor,&lt;/li&gt;
&lt;li&gt;a file browser in the sidebar,&lt;/li&gt;
&lt;li&gt;a number of editors and viewers for &lt;a href="http://jupyterlab.readthedocs.io/en/stable/user/file_formats.html"&gt;various file formats&lt;/a&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;and much more. However, some pieces are still missing to complete the picture for a scientific authoring environment. One would be a featureful LaTeX editor. The &lt;a href="https://github.com/jupyterlab/jupyterlab-latex"&gt;first LaTeX editor for JupyterLab&lt;/a&gt; is a step in the right direction and offers an easy way to live-compile &lt;code&gt;tex&lt;/code&gt; documents. Another piece is — of course — a means to produce diagrams, flow charts and draw figures!&lt;/p&gt;
&lt;h2 id="drawing-charts-and-diagrams"&gt;Drawing charts and diagrams&lt;/h2&gt;
&lt;p&gt;On the occasion of the Paris Jupyter Widgets workshop, I started working on a feature to fill that gap and built a JupyterLab extension for the &lt;a href="http://draw.io"&gt;Draw.io&lt;/a&gt; diagram editor.&lt;/p&gt;
&lt;p&gt;Draw.io is a diagram editor that runs in the web browser and is Apache 2.0 licensed. It’s got a really mature code base, which has been around for many years. However, unlike the other components used by JupyterLab, Draw.io has not yet embraced the new JavaScript packaging tooling such as NPM, which complicated the integration with JupyterLab a little bit, but it all paid off eventually!&lt;/p&gt;
&lt;p&gt;Now, I am really pleased to announce the first release of the draw.io extension, a fully fledged integration for JupyterLab of the fully-fledged diagram editor!&lt;/p&gt;
&lt;iframe src="https://www.youtube-nocookie.com/embed/CJH34I01cKA" title="Screencast: JupyterLab with Drawio Plugin" width="560" height="315" style="aspect-ratio: 560 / 315" loading="lazy" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen&gt;&lt;/iframe&gt;
&lt;p&gt;The Draw.io JupyterLab extension takes advantages of the JupyterLab architecture: i.e. registering a new mime type (.dio) with the file explorer to open files, and adding a launcher button and menu items. Besides that, multiple synchronized views of the same diagrams can be displayed at the same time, allowing a user to visualize the same content with different zoom levels, or with a bare text editor.&lt;/p&gt;
&lt;h2 id="installation"&gt;Installation&lt;/h2&gt;
&lt;p&gt;You can install the jupyterlab-drawio extension with the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;jupyter labextension install jupyterlab-drawio
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This should set up the extension inside your JupyterLab environment. I hope this will be a useful extension for the larger community. All the code is available on GitHub: &lt;a href="https://github.com/QuantStack/jupyterlab-drawio"&gt;https://github.com/QuantStack/jupyterlab-drawio&lt;/a&gt;. Don’t hesitate to open issues and come contribute to jupyterlab-drawio.&lt;/p&gt;
&lt;h2 id="the-future"&gt;The future&lt;/h2&gt;
&lt;p&gt;There are other projects just waiting to be packaged for use inside of JupyterLab: one great &lt;em&gt;webapp&lt;/em&gt; for JupyterLab would probably be the &lt;a href="https://github.com/sharelatex/sharelatex"&gt;ShareLaTeX&lt;/a&gt; application, which is Open Source as well and provides a very nicely integrated editing experience for LaTeX documents, with autocomplete of LaTeX commands and reference search. Eventually, we might be able to integrate with the official ShareLaTeX server for a collaborative, hosted, editing experience for LaTeX documents from inside JupyterLab.&lt;/p&gt;
&lt;p&gt;Maybe we as a community can come together and start building integrations for these amazing free tools into JupyterLab!&lt;/p&gt;
&lt;p&gt;To conclude, thanks to all who’ve organized and participated in the workshop (especially &lt;a href="https://twitter.com/SylvainCorlay"&gt;Sylvain&lt;/a&gt; for the organization). I’ve used the opportunity to chat with the core developers and get their helpful input: &lt;a href="https://twitter.com/steve_silvester"&gt;Steven&lt;/a&gt;, &lt;a href="https://medium.com/@micronova"&gt;Afshin&lt;/a&gt;, and &lt;a href="https://twitter.com/jason_grout"&gt;Jason&lt;/a&gt;, thanks for helping me out in getting this off the ground and making JupyterLab! And honestly, the biggest shoutout has to go to the people who’ve worked on improving draw.io and thankfully open sourced this &lt;a href="https://github.com/jgraph/mxgraph"&gt;amazing code base&lt;/a&gt;: the entire draw.io team.&lt;/p&gt;
&lt;h2 id="about-the-author"&gt;About the Author&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://twitter.com/wuoulf"&gt;Wolf Vollprecht&lt;/a&gt; is a scientific software developer at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt;, passionate about High-Performance Computing and Robotics. He is one of the core developers of &lt;a href="https://github.com/QuantStack/xtensor/"&gt;xtensor&lt;/a&gt;.&lt;/p&gt;
</content><category term="JupyterLab"/><category term="visualization"/></entry><entry><title>Interactive Workflows for C++ with Jupyter</title><link href="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/" rel="alternate"/><published>2017-11-29T16:33:00+00:00</published><updated>2019-12-25T09:42:00+00:00</updated><author><name>Sylvain Corlay</name></author><id>tag:jupyter.org,2017-11-29:/blog/posts/2017/interactive-workflows-for-c-with-jupyter/</id><summary type="html">&lt;p&gt;Scientists, educators and engineers not only use programming languages to build software systems, but also in interactive workflows, using the tools available to explore a problem and reason about it.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Scientists, educators and engineers not only use programming languages to build software systems, but also in interactive workflows, using the tools available to &lt;em&gt;explore&lt;/em&gt; a problem and &lt;em&gt;reason&lt;/em&gt; about it.&lt;/p&gt;
&lt;p&gt;Running some code, looking at a visualization, loading data, and running more code. Quick iteration is especially important during the exploratory phase of a project.&lt;/p&gt;
&lt;p&gt;For this kind of workflow, users of the C++ programming language currently have no choice but to use a heterogeneous set of tools that don’t play well with each other, making the whole process cumbersome, and difficult to reproduce.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;We currently lack a good story for interactive computing in C++&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;In our opinion, this hurts the productivity of C++ developers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Most of the progress made in software projects comes from incrementalism. Obstacles to fast iteration hinder progress.&lt;/li&gt;
&lt;li&gt;This also makes C++ more difficult to teach. The first hours of a C++ class are rarely rewarding as the students must learn how to set up a small project before writing any code. And then, a lot more time is required before their work can result in any visual outcome.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="project-jupyter-and-interactive-computing"&gt;Project Jupyter and Interactive Computing&lt;/h2&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/001-1_wOHyKy6fl3ltcBMNpCvC6Q.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;The goal of Project Jupyter is to provide a consistent set of tools for scientific computing and data science workflows, from the exploratory phase of the analysis to the presentation and the sharing of the results. The Jupyter stack was designed to be agnostic of the programming language, and also to allow alternative implementations of any component of the layered architecture (back-ends for programming languages, custom renderers for file types associated with Jupyter). The stack consists of&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a low-level specification for messaging protocols, standardized file formats,&lt;/li&gt;
&lt;li&gt;a reference implementation of these standards,&lt;/li&gt;
&lt;li&gt;applications built on top of these libraries: the Notebook, JupyterLab, Binder, JupyterHub&lt;/li&gt;
&lt;li&gt;and visualization libraries integrated into the Notebook and JupyterLab.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Adoption of the Jupyter ecosystem has skyrocketed in the past years, with millions of users worldwide, over a million Jupyter notebooks shared on GitHub and large-scale deployments of Jupyter in universities, companies and high-performance computing centers.&lt;/p&gt;
&lt;h2 id="jupyter-and-c"&gt;Jupyter and C++&lt;/h2&gt;
&lt;p&gt;One of the main extension points of the Jupyter stack is the &lt;em&gt;kernel&lt;/em&gt;, the part of the infrastructure responsible for executing the user’s code. Jupyter kernels exist for &lt;a href="https://github.com/jupyter/jupyter/wiki/Jupyter-kernels"&gt;numerous programming languages&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Most Jupyter kernels are implemented in the target programming language: the reference implementation &lt;a href="https://github.com/ipython/ipykernel"&gt;ipykernel&lt;/a&gt; in Python, &lt;a href="https://github.com/JuliaLang/IJulia.jl"&gt;IJulia&lt;/a&gt; in Julia, leading to a duplication of effort for the implementation of the protocol. A common denominator to a lot of these interpreted languages is that the interpreter generally exposes a C API, allowing the embedding into a native application. In an effort to consolidate these commonalities and save work for future kernel builders, we developed &lt;em&gt;xeus&lt;/em&gt;.&lt;/p&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/002-1_TKrPv5AvFM3NJ6a7VMu8Tw.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/QuantStack/xeus"&gt;Xeus&lt;/a&gt; is a C++ implementation of the Jupyter kernel protocol. It is not a kernel itself but a library that facilitates the authoring of kernels, and other applications making use of the Jupyter kernel protocol.&lt;/p&gt;
&lt;p&gt;A typical kernel implementation using xeus would in fact make use of the target interpreter &lt;em&gt;as a library.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;There are a number of benefits of using xeus over implementing your kernel in the target language:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Xeus provides a complete implementation of the protocol, enabling a lot of features from the start for kernel authors, who only need to deal with the language bindings.&lt;/li&gt;
&lt;li&gt;Xeus-based kernels can very easily provide a back-end for Jupyter interactive widgets.&lt;/li&gt;
&lt;li&gt;Finally, xeus can be used to implement kernels for domain-specific languages such as SQL flavors. Existing approaches use a Python wrapper. With xeus, the resulting kernel won’t require Python at run-time, leading to large performance benefits.&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/003-1_Cr_cfHdrgFXHlO15qdNK7w.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Interpreted C++&lt;/strong&gt; is already a reality at CERN with the &lt;a href="https://root.cern.ch/cling"&gt;Cling&lt;/a&gt; C++ interpreter in the context of the &lt;a href="https://root.cern.ch/"&gt;ROOT&lt;/a&gt; data analysis environment.&lt;/p&gt;
&lt;p&gt;As a first example for a kernel based on xeus, we have implemented &lt;a href="https://github.com/QuantStack/xeus-cling"&gt;xeus-cling&lt;/a&gt;, a pure C++ kernel.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Redirection of outputs to the Jupyter front-end, with different styling in the front-end." src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/004-1_NnjISpzZtpy5TOurg0S89A.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Redirection of outputs to the Jupyter front-end, with different styling in the front-end.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Complex features of the C++ programming language such as, polymorphism, templates, lambdas, are supported by the cling interpreter, making the C++ Jupyter notebook a great prototyping and learning platform for the C++ users. See the image below for a demonstration:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Features of the C++ programming language supported by the cling interpreter" src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/005-1_lGVLY4fL1ytMfT-eWtoXkw.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Features of the C++ programming language supported by the cling interpreter&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Finally, xeus-cling supports live quick-help, fetching the content on &lt;a href="http://en.cppreference.com/w/"&gt;cppreference&lt;/a&gt; in the case of the standard library.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Live help for the C++standard library in the Jupyter notebook" src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/006-1_Igegq0xBebuJV8hy0TGpfg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Live help for the C++standard library in the Jupyter notebook&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;We realized that we started using the C++ kernel ourselves very early in the development of the project. For quick experimentation, or reproducing bugs. No need to set up a project with a cpp file and complicated project settings for finding the dependencies… Just write some code and hit &lt;strong&gt;Shift+Enter&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Visual output can also be displayed using the rich display mechanism of the Jupyter protocol.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Using Jupyter's rich display mechanism to display an image inline in the notebook" src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/007-1_t_9qAXtdkSXr-0tO9VvOzQ.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Using Jupyter’s rich display mechanism to display an image inline in the notebook&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/008-1_OVfmXFAbfjUtGFXYS9fKRA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;Another important feature of the Jupyter ecosystem are the &lt;a href="http://jupyter.org/widgets"&gt;Jupyter Interactive Widgets&lt;/a&gt;. They allow the user to build graphical interfaces and interactive data visualization inline in the Jupyter notebook. Moreover it is not just a collection of widgets, but a framework that can be built upon, to create arbitrary visual components. Popular interactive widget libraries include&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bloomberg/bqplot"&gt;bqplot&lt;/a&gt; (2-D plotting with d3.js)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jovyan/pythreejs"&gt;pythreejs&lt;/a&gt; (3-D scene visualization with three.js)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ellisonbg/ipyleaflet"&gt;ipyleaflet&lt;/a&gt; (maps visualization with leaflet.js)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/maartenbreddels/ipyvolume"&gt;ipyvolume&lt;/a&gt; (3-D plotting and volume rendering with three.js)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/arose/nglview"&gt;nglview&lt;/a&gt; (molecular visualization)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Just like the rest of the Jupyter ecosystem, Jupyter interactive widgets were designed as a language-agnostic framework. Other language back-ends can be created reusing the front-end component, which can be installed separately.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/QUantStack/xwidgets"&gt;xwidgets&lt;/a&gt;, which is still at an early stage of development, is a native C++ implementation of the Jupyter widgets protocol. It already provides an implementation for most of the widget types available in the core Jupyter widgets package.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="C++ back-end to the Jupyter interactive widgets" src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/009-1_ro5Ggdstnf0DoqhTUWGq3A.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;C++ back-end to the Jupyter interactive widgets&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Just like with ipywidgets, one can build upon xwidgets and implement C++ back-ends for the Jupyter widget libraries listed earlier, effectively enabling them for the C++ programming language and other xeus-based kernels: xplot, xvolume, xthreejs…&lt;/p&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/010-1_yCRYoJFnbtxYkYMRc9AioA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/QuantStack/xplot"&gt;xplot&lt;/a&gt; is an experimental C++ back-end for the &lt;a href="https://github.com/bloomberg/bqplot"&gt;bqplot&lt;/a&gt; 2-D plotting library. It enables an API following the constructs of the &lt;a href="https://dl.acm.org/citation.cfm?id=1088896"&gt;&lt;em&gt;Grammar of Graphics&lt;/em&gt;&lt;/a&gt; in C++.&lt;/p&gt;
&lt;p&gt;In xplot, every item in a chart is a separate object that can be modified from the back-end, &lt;em&gt;dynamically&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Changing a property of a plot item, a scale, an axis or the figure canvas itself results in the communication of an update message to the front-end, which reflects the new state of the widget visually.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Changing the data of a scatter plot dynamically to update the chart" src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/011-1_Mx2g3JuTG1Cfvkkv0kqtLA.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Changing the data of a scatter plot dynamically to update the chart&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; the xplot and xwidgets projects are still at an early stage of development and are changing drastically at each release.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Interactive computing environments like Jupyter are not the only missing tool in the C++ world. Two key ingredients to the success of Python as the &lt;em&gt;lingua franca&lt;/em&gt; of data science is the existence of libraries like &lt;a href="http://www.numpy.org/"&gt;NumPy&lt;/a&gt; and &lt;a href="https://pandas.pydata.org/"&gt;Pandas&lt;/a&gt; at the foundation of the ecosystem.&lt;/p&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/012-1_HsU43Jzp1vJZpX2g8XPJsg.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/QuantStack/xtensor/"&gt;xtensor&lt;/a&gt; is a C++ library meant for numerical analysis with multi-dimensional array expressions.&lt;/p&gt;
&lt;p&gt;xtensor provides&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;an extensible expression system enabling lazy NumPy-style broadcasting.&lt;/li&gt;
&lt;li&gt;an API following the &lt;em&gt;idioms&lt;/em&gt; of the C++ standard library.&lt;/li&gt;
&lt;li&gt;tools to manipulate array expressions and build upon xtensor.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;xtensor exposes an API similar to that of NumPy covering a growing portion of the functionalities. A cheat sheet can be &lt;a href="http://xtensor.readthedocs.io/en/latest/numpy.html"&gt;found in the documentation&lt;/a&gt;:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Scrolling the NumPy to xtensor cheat sheet" src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/013-1_PBrf5vWYC8VTq_7VUOZCpA.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Scrolling the NumPy to xtensor cheat sheet&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;However, xtensor internals are very different from NumPy. Using modern C++ techniques (template expressions, closure semantics) xtensor is a lazily evaluated library, avoiding the creation of temporary variables and unnecessary memory allocations, even in the case complex expressions involving broadcasting and language bindings.&lt;/p&gt;
&lt;p&gt;Still, from a user perspective, the combination of xtensor with the C++ notebook provides an experience very similar to that of NumPy in a Python notebook.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Using the xtensor array expression library in a C++ notebook" src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/014-1_ULFpg-ePkdUbqqDLJ9VrDw.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Using the xtensor array expression library in a C++ notebook&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;In addition to the core library, the xtensor ecosystem has a number of other components&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/QuantStack/xtensor-blas"&gt;&lt;strong&gt;xtensor-blas&lt;/strong&gt;&lt;/a&gt;: the counterpart to the numpy.linalg module.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/egpbos/xtensor-fftw"&gt;&lt;strong&gt;xtensor-fftw&lt;/strong&gt;&lt;/a&gt;: bindings to the &lt;a href="http://www.fftw.org/"&gt;fftw&lt;/a&gt; library.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/QuantStack/xtensor-io"&gt;&lt;strong&gt;xtensor-io&lt;/strong&gt;&lt;/a&gt;: APIs to read and write various file formats (images, audio, NumPy’s NPZ format).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/wolfv/xtensor_ros"&gt;&lt;strong&gt;xtensor-ros&lt;/strong&gt;&lt;/a&gt;: bindings for ROS, the robot operating system.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/QuantStack/xtensor-python"&gt;&lt;strong&gt;xtensor-python&lt;/strong&gt;&lt;/a&gt;: bindings for the Python programming language, allowing the use of NumPy arrays in-place, using the NumPy C API and the pybind11 library.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/QuantStack/Xtensor.jl"&gt;&lt;strong&gt;xtensor-julia&lt;/strong&gt;&lt;/a&gt;: bindings for the Julia programming language, allowing the use of Julia arrays in-place, using the C API of the Julia interpreter, and the CxxWrap library.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/QuantStack/xtensor-r"&gt;&lt;strong&gt;xtensor-r&lt;/strong&gt;&lt;/a&gt;: bindings for the R programming language, allowing the use of R arrays in-place.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Detailing further the features of the xtensor framework would be beyond the scope of this post.&lt;/p&gt;
&lt;p&gt;If you are interested in trying the various notebooks presented in this post, there is no need to install anything. You can just use &lt;em&gt;binder&lt;/em&gt;:&lt;/p&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/015-1_9cy5Mns_I0eScsmDBjvxDQ.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://mybinder.org/"&gt;The Binder project&lt;/a&gt;, which is part of Project Jupyter, enables the deployment of containerized Jupyter notebooks, from a GitHub repository together with a manifest listing the dependencies (as conda packages).&lt;/p&gt;
&lt;p&gt;All the notebooks in the screenshots above can be run online, by just clicking on one of the following links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://mybinder.org/v2/gh/QuantStack/xeus-cling/stable?filepath=notebooks/xcpp.ipynb"&gt;&lt;strong&gt;xeus-cling&lt;/strong&gt;&lt;/a&gt;: the main xeus-cling example notebook,&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mybinder.org/v2/gh/QuantStack/xtensor/stable?filepath=notebooks/xtensor.ipynb"&gt;&lt;strong&gt;xtensor&lt;/strong&gt;&lt;/a&gt;: the C++ N-D array expression library in a C++ notebook,&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mybinder.org/v2/gh/QuantStack/xwidgets/0.11.1?filepath=notebooks/xwidgets.ipynb"&gt;&lt;strong&gt;xwidgets&lt;/strong&gt;&lt;/a&gt;: the C++ back-end for Jupyter interactive widgets,&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mybinder.org/v2/gh/QuantStack/xplot/0.5.0?filepath=notebooks"&gt;&lt;strong&gt;xplot&lt;/strong&gt;&lt;/a&gt;: the C++ back-end to the bqplot 2-D plotting library for Jupyter.&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="standalone-image"&gt;&lt;img src="https://jupyter.org/blog/posts/2017/interactive-workflows-for-c-with-jupyter/images/016-1_JwqhpMxMJppEepj7U4fV-g.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/jupyterhub/jupyterhub"&gt;JupyterHub&lt;/a&gt; is the multi-user infrastructure underlying open wide deployments of Jupyter like Binder but also smaller deployments for authenticated users.&lt;/p&gt;
&lt;p&gt;The modular architecture of JupyterHub enables a great variety of scenarios on how users are authenticated, and what service is made available to them. JupyterHub deployment for several hundreds of users have been done in various universities and institutions, including the Paris-Sud University, where the C++ kernel was also installed for the students to use.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In September 2017, the 350 first-year students at Paris-Sud University who took the “&lt;a href="http://nicolas.thiery.name/Enseignement/Info111/"&gt;Info 111: Introduction to Computer
Science&lt;/a&gt;” class wrote their first lines of C++ in a Jupyter notebook.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The use of Jupyter notebooks in the context of teaching C++ proved especially useful for the first classes, where students can focus on the syntax of the language without distractions such as compiling and linking.&lt;/p&gt;
&lt;h2 id="acknowledgements"&gt;Acknowledgements&lt;/h2&gt;
&lt;p&gt;The software presented in this post was built upon the work of a large number of people including the &lt;strong&gt;Jupyter&lt;/strong&gt; team and the &lt;strong&gt;Cling&lt;/strong&gt; developers.&lt;/p&gt;
&lt;p&gt;We are especially grateful to &lt;a href="https://twitter.com/egpbos"&gt;Patrick Bos&lt;/a&gt; (who authored xtensor-fftw), Nicolas Thiéry, Min Ragan Kelley, Thomas Kluyver, Yuvi Panda, Kyle Cranmer, Axel Naumann and Vassil Vassilev.&lt;/p&gt;
&lt;p&gt;We thank the &lt;a href="http://diana-hep.org"&gt;DIANA/HEP&lt;/a&gt; organization for supporting travel to CERN and encouraging the collaboration between Project Jupyter and the ROOT team.&lt;/p&gt;
&lt;p&gt;We are also grateful to the team at &lt;strong&gt;Paris-Sud University&lt;/strong&gt; who worked on the JupyterHub deployment and the class materials, notably &lt;a href="https://twitter.com/pyviv"&gt;Viviane Pons&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The development of xeus, xtensor, xwidgets and related packages at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt; is sponsored by &lt;a href="http://www.techatbloomberg.com"&gt;&lt;strong&gt;Bloomberg&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="about-the-authors-alphabetical-order"&gt;About the Authors (alphabetical order)&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://twitter.com/SylvainCorlay"&gt;&lt;em&gt;Sylvain Corlay&lt;/em&gt;&lt;/a&gt;, Scientific Software Developer at &lt;a href="https://github.com/QuantStack/"&gt;QuantStack&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/lgouarin"&gt;&lt;em&gt;Loic Gouarin&lt;/em&gt;&lt;/a&gt;, Research Engineer at &lt;a href="https://www.math.u-psud.fr"&gt;Laboratoire de Mathématiques at Orsay&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/johanmabille?lang=en"&gt;&lt;em&gt;Johan Mabille&lt;/em&gt;&lt;/a&gt;, Scientific Software Developer at &lt;a href="https://github.com/QuantStack/"&gt;QuantStack&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/wuoulf"&gt;&lt;em&gt;Wolf Vollprecht&lt;/em&gt;&lt;/a&gt;, Scientific Software Developer at &lt;a href="https://github.com/QuantStack/"&gt;QuantStack&lt;/a&gt;&lt;/p&gt;
</content><category term="C++"/><category term="science"/></entry></feed>