Use Reactive mode
Besides the standard Jupyter mode, Datalore offers Reactive mode, an alternative method for managing your notebook calculations.
Reactive mode is a reproducible mode that enforces a fixed top-down evaluation order and automatic recalculation of the cells below the modified one. It has the following key benefits:
Interactivity support: when combined with interactive controls, reactive mode allows you to turn notebooks into interactive reports.
Automatically restored notebook state: with Reactive mode enabled, notebook state is saved after each cell evaluation to ensure automatic recalculation of only those cells that are below the modified one. This can be particularly helpful when working on big projects.
Easy experimenting: Reactive mode keeps the notebook state consistent by automatically recalculating the cells below the modified one. This means you can edit any cell in your notebook and quickly have all affected cells updated.
Switching machines: switch between machines without losing the variables state. This allows you to start with writing code on a basic machine, switch to a more expensive GPU machine only to perform some computation-intensive task, and then switch back to a basic machine. With Jupyter mode selected, switching between machines clears the variables, which means that you would have to recalculate all the cells.
Preconditions
Consider the following when enabling Reactive mode:
The minimum kernel version required is 5.13.
To make sure Reactive mode works properly with SQL statements, use SQL cells when working with databases.
Procedures
Choose Reactive mode for a new notebook
You choose Reactive mode on the Kernel tab of the New notebook dialog.
![Kernel and mode selection Kernel and mode selection](https://resources.jetbrains.com.cn/help/img/datalore/2024.4/newnotebook_dialog.png)
Enable Reactive mode in the editor
You can enable Reactive mode at any time working in the editor. There are two interfaces that you can use: Kernel menu and Computation tool.
Go to
.Select the Reactive mode option.
Click the OK button in the Change computation mode confirmation window.
Open the Computation tab from the left-hand toolbar.
Under Kernel, click switch the Reactive mode toggle.
Click the OK button in the Change computation mode confirmation window.
Keywords
computation mode, running notebooks, calculation, execution, alternative mode