Jupyter Notebook Interactions

To be able to properly accomodate both UUIDs and our namespace into the notebook we’ve had to make some changes to the way normal notebooks work.

In the vanilla notebook an action like copying a cell and pasting it twice has no reprecussions, for us however these interactions had to be changed to incorporate things like ensuring that no Cell IDs is the same.

Let’s step through some of these interactions.

Delete Cell

A cell that has never been executed is the same interaction you’d see in a normal notebook, it removes the cell and you never have to deal with that cell ever again.

However, with CodeCells that have already been executed that is not the case, a horizontal red bar will show up where that cell was.

In [d7a7c8]:
from IPython.display import Image
Image:
IPython.core.display.Image
In [aed959]:
Deletee14d16 = Image(url='https://rawgit.com/colinjbrown/dfkernel/documentation-update/docs/tutorial/img/delete_cell.png',width=800)
Deletee14d16:

It’s best to think of this cell as a “Soft Delete”, it’s completely reversible without any consequences. The reason why this is the case is because until a new cell is executed the Python kernel doesn’t even know you’ve deleted a cell. Upon executing another cell though this bar will be completely removed and will be considered “hard deleted”.

Note: We think this is the best way to handle these deletions because when you delete any cell in the Notebook you might not be aware of the cells that are impacted by it.

Copy, Cut and Paste Cell

Copy

Copy behaves just as you imagine it would so there are no special interactions that happen here.

Cut

On cutting a cell, much like when we delete a cell performing a soft delete. However there are now two copies of the cell that exist, one exists in the undelete stack and one exists on the clipboard. Both of these are considered equally valid references so until one of two events happens they are all valid.

  • Paste Event: Pasted Cell is now considered the authentic reference to that cell and the deleted cell maintains a different Cell ID and has output wiped if it is undeleted.
  • Undelete Event: Undeleted Cell is now considered the authentic reference to that cell and the cell on clipboard maintains a different Cell ID and has output wiped if it is pasted.

Paste

This behaves relatively the same other than two references to the same cell cannot exist, so if you try and for example paste twice they will have two different Cell IDs and the second one will not have any output attached to it.

Split and Merge

Split

This is the same as a typical split, one side gets the output tags and the other does not, determining the proper way to split requires code introspection so the onus falls on the user to not make poor choices.

Merge As text is collapsed together so is the output, we only retain the outputs from the bottom cell.