Saving a state
Warning
The Serverlesss mode will be discontinued on March 1, 2024.
The interpreter state is the cell code, output, and variable values at a specific point in time.
Note
Some variables are not serialized and, therefore, cannot be saved. For example, let's assume we have a variable with a file open for writing: f = open("file.txt", "w")
.
Such variables will get this warning during the assignment: The following variables cannot be serialized:
.
Note
You cannot save a state in Dedicated mode.
States are saved as checkpoints. For more information about working with checkpoints, see Working with checkpoints.
There are two save state modes: standard and automatic. Save modes only apply to regular cells. Cells with background operations create a checkpoint automatically once the execution is complete or prompt the user to create one by running %apply_state
.
Standard save
In standard save mode, saving occurs after a cell or a group of cells is executed, or after the execution throws an error.
If a group contains cells with background operations, the state will be saved before the background operations are completed.
Auto-save
In auto-save mode, the state is saved in the following situations:
- If there are no computations for a while, DataSphere checks if the state of a notebook has changed, and saves the changes, if required.
- If computing resources were switched to a different type.
- If you force a state save.
The auto save state mode is enabled by default for any new project.
You can change the save state mode in the project settings.
Forcing a state save
To force a state save in auto-save mode , press Cmd + K or Ctrl + K.