Skip to main content

Notebooks reference


How a notebook is saved​

A notebook is an ODSL script in the script service:

NotebookScript
My notebooksPrivate scripts with the category notebook
ExamplesPublic scripts with the category notebook, ids starting #notebook-
DescriptionThe script's description
Each versionA version of the script, with the reason Notebook saved (N cells)

The script starts with a header comment that gives the description and category, and each cell is a top level region:

/**
* Clean spark spread for German base power over the last six weeks
* @category notebook
*/

//#region markdown
/*
# German clean spark spread
*/
//#endregion

//#region code
efficiency = 0.55
spread = cleanSpark(power, gas, carbon)
//= spread
//#endregion
PartWhat it is
//#region markdownA markdown cell: its text is the block comment inside the region
//#region codeA code cell (any other region name is a code cell too, shown as the cell's title)
//= spreadThe cell's value line. A value on its own is not an ODSL statement, so it is kept as a comment: the script stays valid and the line does nothing when the script runs outside a notebook.

Any ODSL script can be opened as a notebook: its regions become cells, and code outside regions becomes code cells. Avoid lines starting //# other than the region markers in a cell (ODSL cannot read them) and regions inside a cell.


What is kept in your browser​

KeptFor
The last outputs of each notebookShown the next time you open it, marked from an earlier session. Matched to cells by their text.
Unsaved changesOffered when you open the notebook again
The input variableGiven to the kernel when it starts
The tab you last usedMy notebooks or Examples

They are kept in this browser only: a colleague, or you on another computer, does not see them. Clearing the browser's site data removes them.


The notebook kernel​

The kernel is the platform's script debug service (the one the Script Manager uses to debug scripts), started for a notebook. It runs in its own service, not in the platform's API, and reaches the platform through its REST API with your own sign-in, so your security policies apply exactly as they do to you.

Setting (service)DefaultWhat it does
KERNEL_IDLE_MINUTES30A kernel with no cell running and no message from the screen for this long ends
KERNEL_MAX_MINUTES480The longest a kernel can last

Before a kernel starts, the service checks with the platform that you have the run (or update) right on the notebook's script. A kernel does not count as your debug session in the Script Manager: you can debug a script and have notebooks open at the same time.


Extension contents​

ItemId
Extensionodsl.notebooks
ViewNotebooks, Manage menu (odsl.notebooks.manage)
Featureodsl.notebooks.manage, in the feature policy extension.odsl.notebooks
Scriptsodsl.notebooks.common, and the Script Manager's odsl.script_manager.common (the editor and the ODSL language)
Example notebooks50 public scripts with ids starting #notebook-, listed in Example notebooks

Troubleshooting​

What you seeWhy, and what to do
Replay modeThe kernel service could not be reached, or does not have notebook kernels yet. Cells still run (see Replay mode). Ask your administrator if it persists.
Kernel failed with "Your security policies do not let you run ..."You need the run or update right on the notebook's script
A cell says a variable does not exist, though the cell that makes it is aboveThat cell has not run since the kernel started (or the kernel ended). Run it, or Run all.
A value is shown that does not match the codeThe kernel has the values of the cells as they were when you ran them. Restart and Run all.
A new kernel was startedThe last kernel ended (idle, too long, or the service restarted). Run the earlier cells again.
No value under a cellThe last line is a statement, not a value: add a line with the variable's name.
The notebook opens read onlyIt is an example (use Use this notebook), or you do not have the update right on it
The value is too large to show hereValues over 4 MB are not sent to the screen. Show part of it, for example a few contracts or a shorter range.