Skip to content

SourceUnit

Source snapshots in result.sources, keyed by their identifiers.

dataclass linescope.model.SourceUnit[source]

Preserve the full source text observed during collection.

Attributes

id : str

Stable identifier used by measurements and navigation links.

path : str

Original file path or notebook cell label shown in the report.

source : str

Complete source text frozen when the snapshot is captured.

kind : str | SourceKind

Source category normalized to SourceKind at construction.

cell_number : int | None

One-based position in the original notebook, counting all cell types. None means the frontend did not expose an unambiguous position.

cell_id : str | None

Frontend notebook cell identifier, when available. Retain this identity across edits without treating execution counts as notebook positions.


See Also

ProfileResult

Combine portable source snapshots with backend-independent run data.

SourceLocation

Locate a one-based line and zero-based character column in a snapshot.

SymbolDefinition

Identify a statically resolved project definition.