MCPcopy
hub / github.com/marimo-team/marimo / _cell_view

Method _cell_view

marimo/_code_mode/_context.py:504–525  ·  view source on GitHub ↗

Wrap a document cell with runtime state from the graph.

(self, cell: _NotebookCell)

Source from the content-addressed store, hash-verified

502 return self._ctx._document
503
504 def _cell_view(self, cell: _NotebookCell) -> NotebookCell:
505 """Wrap a document cell with runtime state from the graph."""
506 try:
507 graph = self._ctx.graph
508 impl = graph.cells.get(cell.id)
509 graph_errors = self._ctx._kernel.errors.get(cell.id, ())
510 outputs = self._ctx._outputs
511 except AttributeError:
512 impl = None
513 graph_errors = ()
514 outputs = None
515
516 def record_read() -> None:
517 self._ctx._note_read(cell.id, cell.version)
518
519 return NotebookCell(
520 cell,
521 impl,
522 graph_errors=graph_errors,
523 outputs=outputs,
524 record_read=record_read,
525 )
526
527 def _cell_ids(self) -> list[CellId_t]:
528 return list(self._doc)

Callers 7

__getitem__Method · 0.95
__iter__Method · 0.95
valuesMethod · 0.95
itemsMethod · 0.95
findMethod · 0.95
grepMethod · 0.95
_fmtMethod · 0.95

Calls 2

NotebookCellClass · 0.70
getMethod · 0.65

Tested by

no test coverage detected