Skip to content

notebook & cell states

Tony Fast edited this page Jan 27, 2024 · 3 revisions

not every notebook document has the same veracity. notebook's MAY carry execution state with them that provide information to consumer's about the quality of computational content. state provides resolve to the important question: "should this document compute?"

the lowest potential of a notebook has no executed cells. all of the [cell execution counts] are None. in this state, effectively the notebook is a markdown document encoded in data structured. unexecuted code blocks default to monospace text representations and may add syntax highlighting (that is ideally accessible).

notebook states

a notebook is an aggregate of cells, they carry state implicit through the ordering of cells. cells record an execution count when they are computed. the novel inclusion of compute in the document introduces the concept of state. there are varying states of an executed notebook document and we explore each of the following:

  • ordered execution
    • dirty execution
  • out-of-order/unordered execution
  • partial execution

ordered execution

ordered execution means that a notebook can "restart and run all". notebooks have the most veracity when the code cell execution count is monotonically increasing.

dirty execution

dirty execution means that a cell has been executed while the input has been changed since. it is not currently possible to identify dirty execution, but it should be otherwise it is possible to publish duplicitous content.

out-of-order execution

partial execution

notebook state and accessibility

it is important to identify the state of notebook or cell. anytime these states can be visually inferred they must be audibly announced. it may take significantly longer for an assistive tech user that they are observing a notebook that may have hidden state.