Defining the uses of checkpoints
Unlike many application saves, a checkpoint is an individual entry. Every time you create a checkpoint, you also create a hidden file. This file resides in a special folder of your project folder. You can go back to this specific checkpoint later, if necessary, to turn back the clock of your development efforts. Checkpoint-type saves occur at these times:- Automatic: Notebook automatically creates a save for you every 120 seconds by default unless you change this interval using the
%autosave
magic function. - Manual checkpoint save: Generates a separate manually created save file.
The manual checkpoint save helps you create a special kind of save. For example, you might get your application to a stable point at which everything runs, even if the application isn't feature complete. Consequently, you want to create a manual save, a checkpoint, to ensure that you can get back to this point should future edits cause application damage.
Checkpoints can also come in handy at other times. For example, you might add a risky feature to your application and want to protect the application against damage should the addition prove fatal. You use checkpoints whenever you want to be able to go back to a specific point in time during application development. It’s a kind of insurance that works in addition to automatic saves.
Even though Notebook won’t display multiple checkpoints, you can keep multiple checkpoints if desired. Simply rename the existing checkpoint and then create a new one. For example, if you name the existing checkpoint BPPD_04_Comments-checkpoint.ipynb
, you might rename it to BPPD_04_Comments-checkpoint1.ipynb
before you create a new save. To use an older checkpoint, you must rename it back to the original name of checkpoint.ipynb
.
Saving a checkpoint
To save a checkpoint, you choose File → Save and Checkpoint. Notebook automatically saves a copy of the existing notebook in the.ipynb_checkpoints
folder using the same name with -checkpoint
added. Unless you specifically rename the existing checkpoint, the manual or automatic save will overwrite the existing file. Consequently, all you ever see is a single checkpoint file unless you rename older files manually.