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

Class CellDef

marimo/_schemas/serialization.py:42–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41@dataclass
42class CellDef(Node):
43 code: str = ""
44 name: str = DEFAULT_CELL_NAME
45 options: dict[str, Any] = field(default_factory=dict)
46
47 _ast: NodeRef | None = None
48
49 def __post_init__(self) -> None:
50 from marimo._ast.parse import extract_lineno
51
52 if self._ast:
53 self.lineno = (
54 extract_lineno(self._ast) if self.lineno == 0 else self.lineno
55 )
56 self.col_offset = (
57 self._ast.col_offset
58 if self.col_offset == 0
59 else self.col_offset
60 )
61 self.end_lineno = (
62 self._ast.end_lineno
63 if self.end_lineno == 0 and self._ast.end_lineno
64 else self.end_lineno
65 )
66 self.end_col_offset = (
67 self._ast.end_col_offset
68 if self.end_col_offset == 0 and self._ast.end_col_offset
69 else self.end_col_offset
70 )
71 if self.name == DEFAULT_CELL_NAME:
72 self.name = getattr(self._ast, "name", DEFAULT_CELL_NAME)
73
74
75class SetupCell(CellDef): ...

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…