All docs
lsdtools reference
Generated public SDK reference for lsdtools.
SDK distribution 1.0.0; API contract 1.0; generator 1.0.0.
Product source digest: 4ea39055732e8883c03ccfecf12af6ccebd2041a12ce1b843e4a769e200f5ef9.
Generated from declared public exports and source syntax. Signatures and annotations are declaration spellings; decorators, factories and annotations are never executed. Class members below are declared members; base classes remain explicit. Source docstrings describe their owning implementation; they do not grant app permissions.
lsdtools — the **public, stable SDK** for building LSD packages.
Install it into your project's local Python and import everything from here::
pip install lsdtools
...
from lsdtools import Tool, Engine, Table
The name is deliberately distinct from ``lsd``: if a module imports ``lsdtools``
it is using the **public** API; if it imports anything under ``lsd.*``
(``lsd.core``, ``lsd.flow``, ``lsd.runtime`` …) it is reaching into LSD
**internals**, which are private and may change without notice. So a quick scan
of a package's imports tells you, at a glance, whether it stays on the supported
surface.
This is a small, curated façade: a handful of authoring names (``Tool``,
``Context``, ``StepContext``, the ``View`` interaction model), the data facade
(``Table``, ``Source``), lazy model-query helpers (``models``), deterministic
geostatistical estimation (``geostats``), authenticated neural execution
(``neural``), headless integer-agent decisions (``integeragent``), the
interop/standalone objects (``Entity``, ``Engine``, ``RunResult``), typed
failures, plus the AI bridge (``generate_step``). The *extension seams* — the component registries the charter puts
on every view kind (``register_chart_kind`` / ``register_cell_renderer`` /
``register_param_control`` / ``register_layer_kind``), the symbology seams
(``register_style_asset`` / ``register_default_style``), the data-format registry
(``register_table_reader``), and the raw step/param/event substrate the ``@tool.*`` API
sits on — live in :mod:`lsdtools.extend`, a **declared, charter-enforced** surface you
reach for when the declarative API can't express something.
Authoring vs. running
---------------------
You author against ``lsdtools`` in any local Python (for editor/AI context and,
if you like, local runs). Runtime selection is deliberately not an SDK capability: the native Hub
resolves a project's exact version pin into its authenticated per-user runtime store. Package tests
install an exact package snapshot into an isolated ``LSD_HOME`` and launch the project through the
supported product/testkit entry point; they never search Program Files or execute a guessed runtime.
Quick start
-----------
from lsdtools import Tool, Engine, Table
tool = Tool("hello")
@tool.load
def numbers(count: int = 3) -> Table:
return Table({"x": range(count)})
@tool.shape
def double(t: Table) -> Table:
return t.with_column("x", t["x"] * 2)
if __name__ == "__main__":
Engine().run(double(t=numbers(count=3))).print() # [{'x': 0}, {'x': 2}, {'x': 4}]
lsdtools.API_VERSION#
Kind: value. Source: sdk/src/lsdtools/__init__.py:183.
API_VERSION = '1.0'
lsdtools.ActionInputField#
Kind: class. Source: core/lsd/src/lsd/core/view.py:152.
Source docstring:
One toolkit-neutral field in a complete View-action input document.
``json`` is the escape hatch for exact arrays and objects whose deeper domain validation
belongs to the action handler. Hidden fields hold immutable versions or review fences and
therefore must also be read-only.
Implementation alias: lsd.core.view.ActionInputField.
lsdtools.ActionInputField.name#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:160.
name: str
lsdtools.ActionInputField.label#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:161.
label: str
lsdtools.ActionInputField.kind#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:162.
kind: str
lsdtools.ActionInputField.description#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:163.
description: str
description = ''
lsdtools.ActionInputField.visibility#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:164.
visibility: str
visibility = 'visible'
lsdtools.ActionInputField.read_only#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:165.
read_only: bool
read_only = False
lsdtools.ActionInputField.choices#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:166.
choices: tuple[Any, ...]
choices = ()
lsdtools.ActionInputField.minimum#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:167.
minimum: float | int | None
minimum = None
lsdtools.ActionInputField.maximum#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:168.
maximum: float | int | None
maximum = None
lsdtools.ActionInputField.step#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:169.
step: float | int | None
step = None
lsdtools.ActionInputField.validate#
Kind: method. Source: core/lsd/src/lsd/core/view.py:240.
validate(self, value: Any) -> Any
self: (unannotated)
value: Any
Source docstring:
Return one immutable, detached value after exact kind/range validation.
lsdtools.ActionInputField.to_wire#
Kind: method. Source: core/lsd/src/lsd/core/view.py:273.
to_wire(self) -> dict[str, Any]
self: (unannotated)
Source docstring:
Return the exact toolkit-neutral 1.0 field declaration.
lsdtools.ActionInputSchema#
Kind: class. Source: core/lsd/src/lsd/core/view.py:291.
Source docstring:
A closed 1.0 form whose submission is one complete immutable JSON object.
Implementation alias: lsd.core.view.ActionInputSchema.
lsdtools.ActionInputSchema.fields#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:294.
fields: tuple[ActionInputField, ...]
lsdtools.ActionInputSchema.submit_label#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:295.
submit_label: str
submit_label = 'Apply'
lsdtools.ActionInputSchema.version#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:296.
version: str
version = '1.0'
lsdtools.ActionInputSchema.validate#
Kind: method. Source: core/lsd/src/lsd/core/view.py:320.
validate(self, value: Any) -> FrozenDict
self: (unannotated)
value: Any
Source docstring:
Validate an exact complete submission and detach it into immutable JSON.
lsdtools.ActionInputSchema.to_wire#
Kind: method. Source: core/lsd/src/lsd/core/view.py:351.
to_wire(self) -> dict[str, Any]
self: (unannotated)
Source docstring:
Return the exact toolkit-neutral 1.0 schema.
lsdtools.ChartPayload#
Kind: class. Source: core/lsd/src/lsd/flow/payload.py:483.
ChartPayload(self, *, kind: str='', title: str='', tables: Optional[Dict[str, Any]]=None, spec: Optional[Dict[str, Any]]=None, **extra: Any) -> None
Source docstring:
A chart delivered to a chart viewer (``viewer/chart/set``).
Spec-only by default: ``ChartPayload(kind="bar", title="Grades", series=[...])`` folds everything
into ``spec`` and carries no tables (pass ``tables=`` if a chart is table-backed).
Implementation alias: lsd.flow.payload.ChartPayload.
Declared bases: ViewerPayload.
lsdtools.ChartPayload.topic#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:490.
topic = 'viewer/chart/set'
lsdtools.ChartPayload.__init__#
Kind: method. Source: core/lsd/src/lsd/flow/payload.py:492.
__init__(self, *, kind: str='', title: str='', tables: Optional[Dict[str, Any]]=None, spec: Optional[Dict[str, Any]]=None, **extra: Any) -> None
extra: Any
kind: str
self: (unannotated)
spec: Optional[Dict[str, Any]]
tables: Optional[Dict[str, Any]]
title: str
lsdtools.Chunk#
Kind: class. Source: core/lsd/src/lsd/trip/view.py:101.
Chunk(self, view: 'TripView', index: int, offset: int, stop: int) -> None
Source docstring:
One row range of a view: ``c["x"]`` reads, ``c.out["x"]`` writes, ``c.reduce`` folds.
Implementation alias: lsd.trip.view.Chunk.
lsdtools.Chunk.__init__#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:106.
__init__(self, view: 'TripView', index: int, offset: int, stop: int) -> None
index: int
offset: int
self: (unannotated)
stop: int
view: 'TripView'
lsdtools.Chunk.count#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:115.
count(self) -> int
self: (unannotated)
lsdtools.Chunk.eid#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:119.
eid(self) -> 'np.ndarray'
self: (unannotated)
lsdtools.Chunk.__getitem__#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:122.
__getitem__(self, name: str) -> Any
name: str
self: (unannotated)
lsdtools.Chunk.reduce#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:131.
reduce(self, key: str, value: Any) -> None
key: str
self: (unannotated)
value: Any
Source docstring:
Record a per-chunk partial; the scheduler folds partials in chunk order.
lsdtools.Chunk.index#
Kind: attribute. Source: core/lsd/src/lsd/trip/view.py:109.
index: int
index = index
lsdtools.Chunk.offset#
Kind: attribute. Source: core/lsd/src/lsd/trip/view.py:110.
offset: int
offset = offset
lsdtools.Chunk.stop#
Kind: attribute. Source: core/lsd/src/lsd/trip/view.py:111.
stop: int
stop = stop
lsdtools.Chunk.out#
Kind: attribute. Source: core/lsd/src/lsd/trip/view.py:112.
out: (unannotated)
out = _ChunkOut(view, view._resolved_writes(), offset, stop)
lsdtools.Component#
Kind: class. Source: core/lsd/src/lsd/trip/model.py:161.
Source docstring:
One typed column of a Trip.
``dtype`` is the storage type and is fixed for the component's life; ``kind`` is the profile
kind it snapshots under (defaults from the dtype); ``shape`` is ``()`` for a scalar or
``(k,)`` for a fixed-width vector (``fixed_size_list<dtype>[k]`` in Arrow, an ``(n, k)`` numpy
view); ``mirror_of`` names the components this one is a derived, differently-typed image of
(a float32 render mirror of float64 coordinates) so its staleness is checkable;
``field_id`` is the project field identity minted once at the first materialization and
carried through every snapshot.
Implementation alias: lsd.trip.model.Component.
lsdtools.Component.name#
Kind: attribute. Source: core/lsd/src/lsd/trip/model.py:173.
name: str
lsdtools.Component.dtype#
Kind: attribute. Source: core/lsd/src/lsd/trip/model.py:174.
dtype: str
lsdtools.Component.kind#
Kind: attribute. Source: core/lsd/src/lsd/trip/model.py:175.
kind: str
kind = ''
lsdtools.Component.shape#
Kind: attribute. Source: core/lsd/src/lsd/trip/model.py:176.
shape: Tuple[int, ...]
shape = ()
lsdtools.Component.frozen#
Kind: attribute. Source: core/lsd/src/lsd/trip/model.py:177.
frozen: bool
frozen = False
lsdtools.Component.mirror_of#
Kind: attribute. Source: core/lsd/src/lsd/trip/model.py:178.
mirror_of: Tuple[str, ...]
mirror_of = ()
lsdtools.Component.unit#
Kind: attribute. Source: core/lsd/src/lsd/trip/model.py:179.
unit: Optional[str]
unit = None
lsdtools.Component.field_id#
Kind: attribute. Source: core/lsd/src/lsd/trip/model.py:180.
field_id: Optional[str]
field_id = None
lsdtools.Component.numeric#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:215.
numeric(self) -> bool
self: (unannotated)
lsdtools.Component.width#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:219.
width(self) -> int
self: (unannotated)
Source docstring:
Values per row: 1 for a scalar, ``k`` for a ``(k,)`` vector.
lsdtools.Component.with_field_id#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:223.
with_field_id(self, field_id: str) -> 'Component'
field_id: str
self: (unannotated)
lsdtools.Component.element_field_id#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:227.
element_field_id(self, index: int) -> str
index: int
self: (unannotated)
Source docstring:
The field identity of element *index* of a vector component.
A vector snapshots as ``k`` scalar columns (the profile layer measures scalars); their
identities derive from the component's own id, not from whichever step happened to
snapshot it, so they are stable for the component's whole life.
lsdtools.Component.element_name#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:241.
element_name(self, index: int) -> str
index: int
self: (unannotated)
Source docstring:
The snapshot column name of element *index* (``name.0``, ``name.1``, ...).
lsdtools.Component.to_dict#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:245.
to_dict(self) -> Dict[str, Any]
self: (unannotated)
lsdtools.Component.from_dict#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:253.
from_dict(cls, data: Mapping[str, Any]) -> 'Component'
cls: (unannotated)
data: Mapping[str, Any]
lsdtools.Configurable#
Kind: class. Source: core/lsd/src/lsd/core/configurable.py:337.
Configurable(self, *, id: Optional[str]=None, metadata: Optional[Dict[str, Any]]=None, event_bus: Optional['EventBus']=None, **kwargs: Any) -> None
Source docstring:
Base class for all configurable objects: Steps, Entities, Engine.
Subclasses declare parameters with ``param()``; serialization, validation,
introspection, and event emission are inherited automatically.
Implementation alias: lsd.core.configurable.Configurable.
lsdtools.Configurable.type_id#
Kind: attribute. Source: core/lsd/src/lsd/core/configurable.py:346.
type_id: ClassVar[str]
type_id = ''
lsdtools.Configurable.serialized_fields#
Kind: attribute. Source: core/lsd/src/lsd/core/configurable.py:347.
serialized_fields: ClassVar[frozenset[str]]
serialized_fields = frozenset()
lsdtools.Configurable.param_group_order#
Kind: attribute. Source: core/lsd/src/lsd/core/configurable.py:350.
param_group_order: ClassVar[List[str]]
param_group_order = []
lsdtools.Configurable.serialized_type_id#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:353.
serialized_type_id(self) -> str
self: (unannotated)
Source docstring:
Stable type identity written to and restored from project data.
A live variant instance keeps the identity of the configurable it
replaces. Consumers that bind declarations to project nodes must use
this public coordinate rather than the concrete provider class or the
private deserialization marker.
lsdtools.Configurable.serialized_field_names#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:368.
serialized_field_names(cls) -> frozenset[str]
cls: (unannotated)
Source docstring:
Exact persisted fields understood by this class in the current schema.
lsdtools.Configurable.register_variant#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:425.
register_variant(cls, identity: str, provider: str, klass: type, mode: str='replace') -> None
cls: (unannotated)
identity: str
klass: type
mode: str
provider: str
Source docstring:
Register *klass* (from *provider*) as a variant of node *identity* (see the note above).
lsdtools.Configurable.resolve_class#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:459.
resolve_class(cls, type_name: Optional[str], *, variant_state: 'Optional[Dict[str, dict]]'=None) -> Optional[type]
cls: (unannotated)
type_name: Optional[str]
variant_state: 'Optional[Dict[str, dict]]'
Source docstring:
Resolve an exact type under an explicit or scoped project selection.
lsdtools.Configurable.variant_providers#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:496.
variant_providers(cls, identity: str) -> 'List[str]'
cls: (unannotated)
identity: str
Source docstring:
Provider keys that offer a variant of *identity* (empty if none).
lsdtools.Configurable.validate_variant_state#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:501.
validate_variant_state(cls, state: 'Optional[Dict[str, dict]]') -> 'Dict[str, dict]'
cls: (unannotated)
state: 'Optional[Dict[str, dict]]'
Source docstring:
Validate and normalize one project's exact variant selection.
lsdtools.Configurable.variant_scope#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:549.
variant_scope(cls, state: 'Optional[Dict[str, dict]]') -> Generator[None, None, None]
cls: (unannotated)
state: 'Optional[Dict[str, dict]]'
Source docstring:
Apply one validated project selection only within the current task/thread.
lsdtools.Configurable.unregister#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:559.
unregister(cls, name: str) -> bool
cls: (unannotated)
name: str
Source docstring:
Remove an exact type id from the registry. Returns True if it was present.
Used on package reload/disable so step/entity classes deleted from a
package's source disappear from ``available_steps()`` instead of lingering.
Any variant implemented by the removed class is purged as well.
lsdtools.Configurable.__init__#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:580.
__init__(self, *, id: Optional[str]=None, metadata: Optional[Dict[str, Any]]=None, event_bus: Optional['EventBus']=None, **kwargs: Any) -> None
event_bus: Optional['EventBus']
id: Optional[str]
kwargs: Any
metadata: Optional[Dict[str, Any]]
self: (unannotated)
lsdtools.Configurable.set_parameter#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:692.
set_parameter(self, name: str, value: Any, *, coerce: bool=False) -> List[ValidationError]
coerce: bool
name: str
self: (unannotated)
value: Any
Source docstring:
Set a parameter by name. Returns error list (empty = success). Never raises.
lsdtools.Configurable.set_parameters#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:716.
set_parameters(self, values: Dict[str, Any], *, coerce: bool=False) -> List[ValidationError]
coerce: bool
self: (unannotated)
values: Dict[str, Any]
Source docstring:
Validate and apply several parameters atomically.
Every name, coercion, and value is checked before the first mutation.
On success values are committed in mapping order and ordinary callers
receive one batch-change event; on validation failure the instance is
unchanged and no event is emitted. When invoked inside an existing
:meth:`batch_update`, changes join that outer batch.
lsdtools.Configurable.get_parameter#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:776.
get_parameter(self, name: str) -> Any
name: str
self: (unannotated)
lsdtools.Configurable.set_output#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:782.
set_output(self, name: str, value: Any) -> None
name: str
self: (unannotated)
value: Any
Source docstring:
Store a computed output value from within run() without firing change events.
Safe to call from background threads. Use for output=True params only.
lsdtools.Configurable.get_outputs#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:797.
get_outputs(self) -> Dict[str, Any]
self: (unannotated)
Source docstring:
Return {name: value} for all output=True params.
Called by the runner after step execution to include in STEP_FINISHED event data.
Any subscriber (UI, CLI, logging) can read computed results from that event.
lsdtools.Configurable.get_parameters#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:811.
get_parameters(self) -> List[ParameterInfo]
self: (unannotated)
Source docstring:
Snapshot of all parameters for inspector / CLI generation.
lsdtools.Configurable.parameter_groups#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:836.
parameter_groups(self) -> OrderedDict
self: (unannotated)
Source docstring:
Parameters grouped by their ``group`` value.
Returns an ``OrderedDict[group_name, list[ParameterInfo]]``.
Groups appear in ``cls.param_group_order`` order first, then in
first-seen order for any groups not listed there.
lsdtools.Configurable.parameter_schema#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:851.
parameter_schema(cls) -> Dict[str, Any]
cls: (unannotated)
Source docstring:
Return a JSON Schema ``object`` for all non-hidden, non-output parameters.
Used by agents to build and validate tool call payloads without source inspection::
schema = MyStep.parameter_schema()
# → {"type": "object", "properties": {...}, "required": [...]}
lsdtools.Configurable.validate#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:893.
validate(self) -> ValidationResult
self: (unannotated)
Source docstring:
Validate all parameters. Returns structured result, never raises.
lsdtools.Configurable.batch_update#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:905.
batch_update(self) -> Generator[None, None, None]
self: (unannotated)
Source docstring:
Suppress per-field events; emit one batch event on exit.
lsdtools.Configurable.to_dict#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:923.
to_dict(self) -> Dict[str, Any]
self: (unannotated)
lsdtools.Configurable.validate_serialized_record#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:951.
validate_serialized_record(cls, data: Dict[str, Any], *, path: str='configurable', validate_parameters: bool=True) -> None
cls: (unannotated)
data: Dict[str, Any]
path: str
validate_parameters: bool
Source docstring:
Validate the current persisted contract without constructing an object.
lsdtools.Configurable.from_dict#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:1009.
from_dict(cls, data: Dict[str, Any]) -> 'Configurable'
cls: (unannotated)
data: Dict[str, Any]
Source docstring:
Restore one validated current-schema record.
lsdtools.Configurable.set_metadata#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:1029.
set_metadata(self, key: str, value: Any) -> None
key: str
self: (unannotated)
value: Any
lsdtools.Configurable.remove_metadata#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:1045.
remove_metadata(self, key: str) -> None
key: str
self: (unannotated)
lsdtools.Configurable.clear_metadata#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:1059.
clear_metadata(self) -> None
self: (unannotated)
lsdtools.Configurable.get_metadata#
Kind: method. Source: core/lsd/src/lsd/core/configurable.py:1066.
get_metadata(self, key: str, default: Any=None) -> Any
default: Any
key: str
self: (unannotated)
lsdtools.Context#
Kind: class. Source: core/lsd/src/lsd/tools/context.py:277.
Context(self, *, host: Any=None, engine: Any=None, project: Any=None, entity: Any=None, selection: Any=None, ui: Any=None, viewer: Any=None, view_id: Optional[str]=None, panel: Any=None, events: Any=None) -> None
Source docstring:
The single injected object interactive handlers receive (actions / commands / panels).
Fields are populated lazily by the runtime for the surface that invoked the handler; unset ones
are ``None``. ``ctx.viewer`` is an exact-target facade over standard serializable viewer actions;
it never exposes the host's Desktop or renderer implementation. Declare the Context by
annotating any parameter ``Context`` (the name is up to you)::
@tool.action("entity/csv_import/settings")
def change_settings(ctx: Context):
ctx.ui.notify("re-importing with the new settings")
...
Use :meth:`testing` to build a stub for unit tests.
Implementation alias: lsd.tools.context.Context.
lsdtools.Context.__init__#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:296.
__init__(self, *, host: Any=None, engine: Any=None, project: Any=None, entity: Any=None, selection: Any=None, ui: Any=None, viewer: Any=None, view_id: Optional[str]=None, panel: Any=None, events: Any=None) -> None
engine: Any
entity: Any
events: Any
host: Any
panel: Any
project: Any
selection: Any
self: (unannotated)
ui: Any
view_id: Optional[str]
viewer: Any
lsdtools.Context.testing#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:311.
testing(cls, **fields: Any) -> 'Context'
cls: (unannotated)
fields: Any
Source docstring:
Build a Context stub for tests: ``Context.testing(project=fake_project, ui=fake_ui)``.
lsdtools.Context.host#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:299.
host: Any
host = host
lsdtools.Context.engine#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:300.
engine: Any
engine = engine
lsdtools.Context.project#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:301.
project: Any
project = project
lsdtools.Context.entity#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:302.
entity: Any
entity = entity
lsdtools.Context.selection#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:303.
selection: Any
selection = selection
lsdtools.Context.ui#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:304.
ui: Any
ui = ui
lsdtools.Context.viewer#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:305.
viewer: Any
viewer = viewer
lsdtools.Context.view_id#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:306.
view_id: Optional[str]
view_id = view_id
lsdtools.Context.panel#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:307.
panel: Any
panel = panel
lsdtools.Context.events#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:308.
events: Any
events = events
lsdtools.Creates#
Kind: class. Source: core/lsd/src/lsd/trip/view.py:63.
Creates(self, *components: Component) -> None
Source docstring:
Components a system adds to the Trip (each a :class:`Component` declaration).
Implementation alias: lsd.trip.view.Creates.
lsdtools.Creates.components#
Kind: attribute. Source: core/lsd/src/lsd/trip/view.py:65.
components: Tuple[Component, ...]
lsdtools.Creates.__init__#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:67.
__init__(self, *components: Component) -> None
components: Component
self: (unannotated)
lsdtools.DomainMode#
Kind: class. Source: core/lsd/src/lsd/project_semantics.py:425.
Implementation alias: lsd.project_semantics.DomainMode.
Declared bases: str, Enum.
lsdtools.DomainMode.FIXED#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:426.
FIXED = 'fixed'
lsdtools.DomainMode.REFERENCE_FIELD#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:427.
REFERENCE_FIELD = 'reference-field'
lsdtools.DomainMode.PROJECT_ENVELOPE#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:428.
PROJECT_ENVELOPE = 'project-envelope'
lsdtools.DomainMode.ROBUST_PERCENTILE#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:429.
ROBUST_PERCENTILE = 'robust-percentile'
lsdtools.DomainMode.PER_TABLE#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:430.
PER_TABLE = 'per-table'
lsdtools.DomainPolicy#
Kind: class. Source: core/lsd/src/lsd/project_semantics.py:434.
Source docstring:
Explicit authority for the data range used by one style assignment.
Implementation alias: lsd.project_semantics.DomainPolicy.
lsdtools.DomainPolicy.mode#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:437.
mode: DomainMode | str
lsdtools.DomainPolicy.minimum#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:438.
minimum: float | None
minimum = None
lsdtools.DomainPolicy.maximum#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:439.
maximum: float | None
maximum = None
lsdtools.DomainPolicy.reference_field_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:440.
reference_field_id: str | None
reference_field_id = None
lsdtools.DomainPolicy.contributor_field_ids#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:441.
contributor_field_ids: tuple[str, ...]
contributor_field_ids = ()
lsdtools.DomainPolicy.lower_percentile#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:442.
lower_percentile: float | None
lower_percentile = None
lsdtools.DomainPolicy.upper_percentile#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:443.
upper_percentile: float | None
upper_percentile = None
lsdtools.DomainPolicy.version#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:444.
version: int
version = 1
lsdtools.DomainPolicy.fixed#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:501.
fixed(cls, minimum: float, maximum: float) -> 'DomainPolicy'
cls: (unannotated)
maximum: float
minimum: float
lsdtools.DomainPolicy.per_table#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:505.
per_table(cls) -> 'DomainPolicy'
cls: (unannotated)
lsdtools.DomainPolicy.from_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:509.
from_dict(cls, data: Mapping[str, Any]) -> 'DomainPolicy'
cls: (unannotated)
data: Mapping[str, Any]
lsdtools.DomainPolicy.to_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:524.
to_dict(self) -> dict[str, Any]
self: (unannotated)
lsdtools.Engine#
Kind: class. Source: core/lsd/src/lsd/runtime/engine.py:323.
Engine(self, workspace: Optional[Workspace]=None, *, artifact_workspace: 'Optional[str | os.PathLike[str]]'=None, name: Optional[str]=None, **kwargs: Any) -> None
Source docstring:
Execution runtime over a Workspace-owned entity forest.
``param_group_order`` keeps project-level settings in a logical tab order
for the desktop inspector.
Implementation alias: lsd.runtime.engine.Engine.
Declared bases: Configurable.
lsdtools.Engine.param_group_order#
Kind: attribute. Source: core/lsd/src/lsd/runtime/engine.py:330.
param_group_order = ['Project', 'Execution']
lsdtools.Engine.project_path#
Kind: attribute. Source: core/lsd/src/lsd/runtime/engine.py:333.
project_path: Optional[str]
lsdtools.Engine.desktop_runtime#
Kind: attribute. Source: core/lsd/src/lsd/runtime/engine.py:336.
desktop_runtime: Optional[Dict[str, Any]]
lsdtools.Engine.viewer_provider_bindings#
Kind: attribute. Source: core/lsd/src/lsd/runtime/engine.py:337.
viewer_provider_bindings: Dict[str, Dict[str, str]]
lsdtools.Engine.viewer_provider_state#
Kind: attribute. Source: core/lsd/src/lsd/runtime/engine.py:338.
viewer_provider_state: Dict[str, Dict[str, dict]]
lsdtools.Engine.viewer_layout#
Kind: attribute. Source: core/lsd/src/lsd/runtime/engine.py:339.
viewer_layout: Dict[str, list]
lsdtools.Engine.name#
Kind: attribute. Source: core/lsd/src/lsd/runtime/engine.py:342.
name = param(str, default='project', label='Name', group='Project', validators=[_name_not_empty])
lsdtools.Engine.artifact_workspace#
Kind: attribute. Source: core/lsd/src/lsd/runtime/engine.py:349.
artifact_workspace = param(str, required=True, label='Artifact workspace', group='Project', widget='dir', description='Execution artifact root; each entity gets a sub-folder')
lsdtools.Engine.max_parallel#
Kind: attribute. Source: core/lsd/src/lsd/runtime/engine.py:357.
max_parallel = param(int, default=1, min=1, label='Max Parallel', group='Execution', visibility='advanced', description='Max simultaneous pipeline runs; >1 runs independent entity branches concurrently in run_all')
lsdtools.Engine.__init__#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:362.
__init__(self, workspace: Optional[Workspace]=None, *, artifact_workspace: 'Optional[str | os.PathLike[str]]'=None, name: Optional[str]=None, **kwargs: Any) -> None
artifact_workspace: 'Optional[str | os.PathLike[str]]'
kwargs: Any
name: Optional[str]
self: (unannotated)
workspace: Optional[Workspace]
lsdtools.Engine.workspace#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:472.
workspace(self) -> Workspace
self: (unannotated)
Source docstring:
The domain entity forest and EventBus owner consumed by this engine.
lsdtools.Engine.rejected_package_contract#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:477.
rejected_package_contract(self) -> Optional[str]
self: (unannotated)
Source docstring:
Why this Engine is an inspectable, non-writing recovery session.
lsdtools.Engine.set_parameter#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:493.
set_parameter(self, name: str, value: Any, *, coerce: bool=False) -> List[Any]
coerce: bool
name: str
self: (unannotated)
value: Any
Source docstring:
Keep artifact path writes wrapped in :class:`ArtifactWorkspace`.
lsdtools.Engine.execution_status#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:533.
execution_status(self) -> ExecutionStatusSnapshot
self: (unannotated)
Source docstring:
Return a frozen, runtime-only snapshot of current/recent execution.
The snapshot contains no live Entity/Step objects and mutating a dict
returned by its :meth:`to_dict` helper cannot affect this Engine.
lsdtools.Engine.entity_execution_gate#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:580.
entity_execution_gate(self, entity: Entity)
entity: Entity
self: (unannotated)
Source docstring:
Hold this Engine's per-entity execution gate for one live Entity.
The public form of :meth:`_execution_lock_for` for direct callers of
the low-level ``runner.run_pipeline`` — its concurrency note requires
that callers provide the same serialization boundary Engine uses,
because a pipeline mutates its manifest, output paths, and last-run
fields (see ``runner.py`` "Concurrency note"). Same Entity: at most one
execution at a time; distinct entities never block each other.
The gate is a plain (non-reentrant) lock, and pipeline events are
emitted synchronously while it is held — a bus handler must never call
``run``/``run_branch``/this gate for the SAME entity, or it deadlocks.
lsdtools.Engine.add#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:597.
add(self, view: Any) -> 'Engine'
self: (unannotated)
view: Any
Source docstring:
Attach a :class:`~lsd.core.view.View` presented by :meth:`show`.
Entity ownership and mutation belong to :attr:`workspace`.
lsdtools.Engine.views#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:626.
views(self) -> List[Any]
self: (unannotated)
Source docstring:
All attached views, in insertion order.
lsdtools.Engine.remove_view#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:630.
remove_view(self, view: Any) -> 'Engine'
self: (unannotated)
view: Any
lsdtools.Engine.show#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:641.
show(self, *, mode: str='auto', title: Optional[str]=None, block: bool=True) -> Any
block: bool
mode: str
self: (unannotated)
title: Optional[str]
Source docstring:
Present every attached view — a single window hosting them all when a front-end is loaded,
else each view's titled text rendering. The symmetry partner of :meth:`run_all`.
lsdtools.Engine.table_profiles#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:665.
table_profiles(self) -> 'Dict[tuple[str, str, str], Any]'
self: (unannotated)
Source docstring:
Latest derived tables indexed by exact producer coordinate.
Keys are ``(entity_id, step_id, output_port)``. No column-name or
display-name merge is performed; observed fields absent from the
project semantics catalog remain visible as unbound observations.
lsdtools.Engine.table_profile#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:693.
table_profile(self, entity_id: str, step_id: str, output_port: str) -> Any
entity_id: str
output_port: str
self: (unannotated)
step_id: str
Source docstring:
Return one exact current profile, or ``None`` when unmaterialized.
lsdtools.Engine.run#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:911.
run(self, target: 'str | Entity | Any', *, resume: bool=True, from_step: Optional[str]=None, cancellation_signal: Any=None, run_capabilities: Any=None) -> 'PipelineResult | Any'
cancellation_signal: Any
from_step: Optional[str]
resume: bool
run_capabilities: Any
self: (unannotated)
target: 'str | Entity | Any'
Source docstring:
Run a pipeline.
*target* may be:
* a stable **entity id**, a unique entity name, or an **Entity** instance —
returns a :class:`~lsd.runtime.runner.PipelineResult`;
* a **wired step** or **list of steps** (``engine.run(double(t=numbers()))``) —
the steps and their upstream closure are wrapped in an implicit entity and run,
returning a friendly :class:`~lsd.runtime.runner.RunResult` (``.output`` is a
:class:`~lsd.table.Table`, plus ``.print()``).
``cancellation_signal`` is an optional callable or Event-like signal.
It is checked at runner boundaries and exposed to package code through
``StepContext.cancelled``.
lsdtools.Engine.run_branch#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:968.
run_branch(self, target: 'str | Entity', terminals: Any, *, resume: bool=True, from_step: Optional[str]=None, cancellation_signal: Any=None, run_capabilities: Any=None) -> 'PipelineResult'
cancellation_signal: Any
from_step: Optional[str]
resume: bool
run_capabilities: Any
self: (unannotated)
target: 'str | Entity'
terminals: Any
Source docstring:
Run attached terminal steps and their same-entity ``bind_from`` closure.
The existing entity is passed directly to the canonical runner, so step
ownership, workspace, manifest, and event bus are preserved. References
to steps owned by other entities are treated as already-materialized
external inputs and are never executed or re-parented.
Only explicit ``bind_from`` edges define this branch. Implicit sequential
predecessors are not inferred; a branch that needs one must bind it.
Execution still follows the runner's normal Load -> Shape -> Deliver order.
lsdtools.Engine.set_variant#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1074.
set_variant(self, identity: str, *, mode: str='replace', provider: Optional[str]=None) -> int
identity: str
mode: str
provider: Optional[str]
self: (unannotated)
Source docstring:
Choose the active provider for a node *identity* in this project and swap live nodes.
``mode="replace"`` makes *provider* win the identity (existing nodes instantly use it);
``mode="coexist"`` reverts the identity to the original (each override stays addable on its
own). Persisted in the ``.lsd`` (``package_state.variants``). Returns the number of live
steps swapped.
lsdtools.Engine.resolve_configurable_class#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1094.
resolve_configurable_class(self, identity: Optional[str]) -> Optional[type]
identity: Optional[str]
self: (unannotated)
Source docstring:
Resolve a type using this project's variant selection only.
lsdtools.Engine.variant_scope#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1099.
variant_scope(self)
self: (unannotated)
Source docstring:
Scope nested classmethod deserialization to this Engine's exact selection.
lsdtools.Engine.disabled_packages#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1103.
disabled_packages(self) -> 'frozenset[str]'
self: (unannotated)
Source docstring:
Packages whose steps are frozen for this project (explicit per-project disables).
Steps owned by these packages serve their cached output and refuse to recompute, so a run
neither loses them nor executes stale/withheld code.
lsdtools.Engine.set_runtime_parallelism#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1151.
set_runtime_parallelism(self, value: Optional[int]) -> None
self: (unannotated)
value: Optional[int]
Source docstring:
Override ``max_parallel`` for this session only (``None`` clears it).
A runtime dial, not a project setting: the ``max_parallel`` param is
untouched, so ``to_dict()``/``save()`` output stays byte-identical and
the override never persists into the ``.lsd`` document.
lsdtools.Engine.effective_max_parallel#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1166.
effective_max_parallel(self) -> int
self: (unannotated)
Source docstring:
The parallelism ``run_all`` actually uses: the session override when
set, else the persisted ``max_parallel`` param.
lsdtools.Engine.run_all#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1172.
run_all(self, *, resume: bool=True, cancellation_signal: Any=None) -> 'Dict[str, PipelineResult]'
cancellation_signal: Any
resume: bool
self: (unannotated)
Source docstring:
Run every entity in dependency order (sources before dependents).
``max_parallel == 1`` (default): strictly sequential.
``max_parallel > 1``: independent branches execute concurrently on a
thread pool; a failed entity's descendants are *blocked* (not launched)
while unrelated branches continue.
``resume=True`` skips unchanged entities via the manifest (incremental
rebuild — composes correctly with both modes).
``cancellation_signal`` stops admitting later entities and is leased to
every active step for cooperative cancellation.
Raises ``CycleError`` if the dependency graph contains a cycle.
lsdtools.Engine.run_upstream_of#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1455.
run_upstream_of(self, target: 'str | Entity', *, resume: bool=True, cancellation_signal: Any=None) -> 'Dict[str, PipelineResult]'
cancellation_signal: Any
resume: bool
self: (unannotated)
target: 'str | Entity'
Source docstring:
Run *target* and the transitive closure of entities it depends on.
Useful for targeted rebuilds: if ``report`` depends on ``raw``, then
``engine.run_upstream_of(report.id)`` runs ``raw`` then ``report``
while leaving unrelated entities untouched. Results are keyed by stable
entity id.
``cancellation_signal`` stops admitting later entities and is combined
with the enclosing project task's lifetime signal when one is present.
lsdtools.Engine.plan#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1569.
plan(self, target: 'str | Entity | None'=None) -> Dict[str, Any]
self: (unannotated)
target: 'str | Entity | None'
Source docstring:
Dry-run preview: what would execute without running anything.
Returns a serialisable dict describing which steps would run vs. be
skipped (cached). Reads the manifest and current parameters; no writes.
engine.plan() # all entities
engine.plan(sales.id) # one entity by stable id
engine.plan(my_entity) # one entity by instance
lsdtools.Engine.diff#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1645.
diff(self, target: 'str | Entity | None'=None) -> 'List[Dict[str, Any]]'
self: (unannotated)
target: 'str | Entity | None'
Source docstring:
Return steps whose parameters changed since the last successful run.
Compares current param values against the ``param_snapshot`` stored in
the manifest after each successful execution. Returns an empty list when
nothing has changed, or the manifest has no prior snapshot.
changes = engine.diff("sales")
# → [{"entity_name", "step_id", "step_class",
# "current_params", "old_params"}, ...]
lsdtools.Engine.close#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1825.
close(self) -> None
self: (unannotated)
Source docstring:
Release resources owned by this engine. Safe to call repeatedly.
lsdtools.Engine.__enter__#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1870.
__enter__(self) -> 'Engine'
self: (unannotated)
lsdtools.Engine.__exit__#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:1873.
__exit__(self, *_exc: object) -> None
_exc: object
self: (unannotated)
lsdtools.Engine.save#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:2179.
save(self, path: Optional[str]=None, *, document_sections: Optional[Mapping[str, Any]]=None) -> None
document_sections: Optional[Mapping[str, Any]]
path: Optional[str]
self: (unannotated)
Source docstring:
Serialize the whole project (engine params + all entities) to JSON.
The first explicit *path* becomes this document's save target; later calls may omit it.
Records ``packages`` as explicit activation roots. Package-owned entity records carry
transitive/implicit provenance themselves. ``document_sections`` lets the application add
opaque,
JSON-compatible top-level sections (for example Desktop's ``"ui"`` block) to this same
atomic snapshot. Such sections cannot replace fields owned by the engine.
lsdtools.Engine.load#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:2346.
load(cls, path: str, *, project_document: Optional[Mapping[str, Any]]=None, workspace: Optional[Workspace]=None, artifact_workspace: 'Optional[str | os.PathLike[str]]'=None, package_manager=None, package_host=None, packages_preloaded: bool=False, inactive_packages: Optional[Dict[str, str]]=None, rejected_package_contract: Optional[str]=None) -> 'Engine'
artifact_workspace: 'Optional[str | os.PathLike[str]]'
cls: (unannotated)
inactive_packages: Optional[Dict[str, str]]
package_host: (unannotated)
package_manager: (unannotated)
packages_preloaded: bool
path: str
project_document: Optional[Mapping[str, Any]]
rejected_package_contract: Optional[str]
workspace: Optional[Workspace]
Source docstring:
Restore an engine from a JSON file saved by ``engine.save()``.
Loads the project's declared ``packages`` first so their step/entity classes
are registered before deserialization (a no-op if already loaded).
``workspace`` supplies the domain forest/EventBus owner. ``artifact_workspace``
overrides the serialized execution-artifact directory when a caller needs a
location specific to the current checkout or process.
``project_document`` supplies an already-decoded strict snapshot. The caller retains
ownership of that mapping, so loading works from a deep copy and never rereads ``path``;
the path remains the runtime save/document identity. Omitting it preserves ordinary file
loading exactly.
``packages_preloaded`` is the explicit Desktop handoff: package activation was already
attempted with the Desktop PackageHost, so only metadata is restored here and discovery/
loading is not repeated. Headless callers retain the default load behavior.
``rejected_package_contract`` is a fail-closed Desktop recovery handoff. It is accepted only
with preloaded mode and an ``inactive_packages`` map covering every recoverable package name;
exact/variant state is then ignored and package-owned nodes restore as placeholders.
lsdtools.Engine.ephemeral#
Kind: method. Source: core/lsd/src/lsd/runtime/engine.py:2529.
ephemeral(cls, *, workspace: Optional[Workspace]=None) -> 'Engine'
cls: (unannotated)
workspace: Optional[Workspace]
Source docstring:
Engine backed by temporary artifact storage for an optional Workspace.
lsdtools.Entity#
Kind: class. Source: core/lsd/src/lsd/tree/entity.py:46.
Entity(self, name: str, *, id: Optional[str]=None, traits: Optional[Set[str]]=None, metadata: Optional[Dict[str, Any]]=None, event_bus: Optional['EventBus']=None, **kwargs: Any) -> None
Source docstring:
A domain node in a Workspace entity hierarchy.
``Entity("name").add(LoadStep(...)).add(ShapeStep(...)).run()``
``**kwargs`` in ``__init__`` accepts declared entity parameters such as
``workspace_dir`` and parameters added by subclasses. Entity classes define
persisted domain state and behaviour only. A package
makes one available to authoring surfaces by mounting an
:class:`lsd.packages.EntityTypeSpec` (normally through ``@tool.entity``).
Labels, icons, creation availability, and tree presentation never live on
the entity model.
Implementation alias: lsd.tree.entity.Entity.
Declared bases: Configurable, Container[Configurable].
lsdtools.Entity.serialized_fields#
Kind: attribute. Source: core/lsd/src/lsd/tree/entity.py:60.
serialized_fields = frozenset({'traits', 'configurables', 'child_entities'})
lsdtools.Entity.name#
Kind: attribute. Source: core/lsd/src/lsd/tree/entity.py:62.
name = param(str, required=True, label='Name', description='Entity name', validators=[_name_not_empty])
lsdtools.Entity.workspace_dir#
Kind: attribute. Source: core/lsd/src/lsd/tree/entity.py:69.
workspace_dir = param(str, default=None, visibility='advanced', label='Workspace', widget='dir', description='Directory for intermediate Parquet files')
lsdtools.Entity.__init__#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:75.
__init__(self, name: str, *, id: Optional[str]=None, traits: Optional[Set[str]]=None, metadata: Optional[Dict[str, Any]]=None, event_bus: Optional['EventBus']=None, **kwargs: Any) -> None
event_bus: Optional['EventBus']
id: Optional[str]
kwargs: Any
metadata: Optional[Dict[str, Any]]
name: str
self: (unannotated)
traits: Optional[Set[str]]
lsdtools.Entity.workspace#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:100.
workspace(self) -> Any
self: (unannotated)
Source docstring:
The domain workspace that owns this entity, including descendants.
lsdtools.Entity.engine#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:105.
engine(self) -> Any
self: (unannotated)
Source docstring:
The currently associated execution Engine, if the workspace has one.
lsdtools.Entity.add#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:320.
add(self, configurable: Configurable) -> 'Entity'
configurable: Configurable
self: (unannotated)
lsdtools.Entity.configurables#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:351.
configurables(self) -> List[Configurable]
self: (unannotated)
Source docstring:
All attached configurables, in display order.
lsdtools.Entity.step#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:355.
step(self, reference: str) -> Optional[Configurable]
reference: str
self: (unannotated)
Source docstring:
Find one child by stable id or an unambiguous human alias.
entity.step("clean_csv") # a @tool.load def clean_csv → class CleanCsv
entity.step("CleanCsv") # by class name
An exact id always wins. Class and builder-function aliases are
conveniences only: if more than one child matches, use a stable step id.
lsdtools.Entity.parent#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:392.
parent(self) -> 'Optional[Entity]'
self: (unannotated)
Source docstring:
The entity that contains this one, or ``None`` if top-level.
lsdtools.Entity.child_entities#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:397.
child_entities(self) -> 'List[Entity]'
self: (unannotated)
Source docstring:
Direct child entities (separate from step configurables).
lsdtools.Entity.add_entity#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:401.
add_entity(self, child: 'Entity') -> 'Entity'
child: 'Entity'
self: (unannotated)
Source docstring:
Attach *child* as a sub-entity.
Raises ``ValueError`` on a cycle (adding an ancestor or self).
An attached parent asks its Workspace to adopt the complete subtree,
removing an existing root from the workspace roots atomically.
Returns ``self`` for chaining.
lsdtools.Entity.remove_entity#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:447.
remove_entity(self, child: 'Entity') -> None
child: 'Entity'
self: (unannotated)
Source docstring:
Detach *child* and its complete subtree from this workspace.
lsdtools.Entity.move_to#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:459.
move_to(self, new_parent: 'Entity') -> None
new_parent: 'Entity'
self: (unannotated)
Source docstring:
Re-parent this entity under *new_parent*.
Raises ``ValueError`` if *new_parent* is this entity or a descendant
(which would create a cycle).
lsdtools.Entity.is_ancestor#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:472.
is_ancestor(self, other: 'Entity') -> bool
other: 'Entity'
self: (unannotated)
Source docstring:
Return ``True`` if *other* is an ancestor of this entity (i.e. in the parent chain).
lsdtools.Entity.iter_descendants#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:481.
iter_descendants(self) -> 'Generator[Entity, None, None]'
self: (unannotated)
Source docstring:
Depth-first pre-order traversal of all descendant entities.
lsdtools.Entity.output#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:490.
output(self) -> 'Any'
self: (unannotated)
Source docstring:
This entity's terminal output as an :class:`lsd.table.Table`, or ``None`` if it has not run.
The last configurable that recorded an output path wins (steps run in order, so that is the
entity's terminal result); its ``"output"`` key is preferred, else its first. Reads the Parquet
the run wrote — so it survives a project reopen, where
``Engine._restore_manifest_outputs`` repopulates ``last_output_paths`` from the manifest.
This is the pull side of :meth:`lsd.core.view.View.watch`: a watching view reads it on
``engine/entity/finished`` and whenever it starts watching.
lsdtools.Entity.output_at#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:515.
output_at(self, reference: 'Any', output_port: 'Optional[str]'=None, *, expected: str='table') -> 'Any'
expected: str
output_port: 'Optional[str]'
reference: 'Any'
self: (unannotated)
Source docstring:
Read one exact declared step output, or ``None`` when it is unrun/stale.
``reference`` is preferably an :class:`lsd.OutputRef`; ``step_id`` plus
``output_port`` is accepted as concise sugar. Resolution is deliberately
local and exact: the referenced entity must be ``self``, the configurable
id must identify one of this entity's pipeline steps, and the port must be
declared by that step. No terminal, first-path, or similarly named port
fallback is performed.
The default ``expected="table"`` reads only a Parquet table. Use
``expected="path"`` when an explicitly declared port is intentionally a
non-table artifact; a ViewerPayload JSON sidecar never masquerades as a
table.
A Trip-valued port (``lsd.trip``; its recorded value is a ``mem://``
handle) answers ``expected="trip"`` with the resident :class:`lsd.trip.Trip`
(restored from its snapshot when it is no longer resident), and answers
``expected="table"``/``"path"`` with its parquet *snapshot* -- the table
form a run leaves behind -- or ``None`` until the runner has written one.
lsdtools.Entity.declared_output_refs#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:614.
declared_output_refs(self, output_port: 'Optional[str]'=None) -> 'List[Any]'
output_port: 'Optional[str]'
self: (unannotated)
Source docstring:
Enumerate exact declared pipeline outputs in configurable order.
``output_port`` is an optional exact filter. This is the public,
domain-neutral discovery companion to :meth:`output_at`: callers must
still reject zero or multiple matches when their contract requires one.
lsdtools.Entity.viewer_payloads#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:640.
viewer_payloads(self) -> 'List[Dict[str, Any]]'
self: (unannotated)
Source docstring:
The persisted viewer payloads (``viewer/layer/set`` / ``chart`` / ``legend`` …) this entity's
deliver steps produced — reconstructed generically, with no per-step code.
For each configurable, this reads the ``*_payload.json`` sidecar a :class:`ViewerPayload`
deliver wrote (found among its :attr:`last_output_paths`), rebases the stored Parquet paths onto
the sidecar's own directory (robust to a moved workspace), and stamps the *current* entity/step
ids. So a watched entity's layers reappear after a project reopen — where the runtime cache is
gone but the workspace survives (``Engine._restore_manifest_outputs`` repopulates
``last_output_paths``) — without re-running.
The sole mechanism is the JSON sidecar: every deliver step that returns a :class:`ViewerPayload`
writes a ``*_payload.json`` beside its Parquet outputs. Empty until the entity runs.
lsdtools.Entity.has_viewer_steps#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:689.
has_viewer_steps(self) -> bool
self: (unannotated)
Source docstring:
True if any step *can* deliver a viewer payload — i.e. its class carries a
``viewer_payload_type`` (stamped by ``@tool.deliver`` on a ``-> ViewerPayload`` function).
A **class**-level check (no import of any domain package, no run needed): it answers before the
entity has run, where :meth:`viewer_payloads` is still empty. That is what lets a front-end
accept a drop of an un-run entity onto a viewer — the viewer
:meth:`~lsd.core.view.View.watch`\es it and fills in once the run finishes.
lsdtools.Entity.table_profiles#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:701.
table_profiles(self) -> 'Dict[str, Dict[str, Any]]'
self: (unannotated)
Source docstring:
Latest derived profiles by exact ``step_id`` then ``output_port``.
Profiles remain separate observations. They are never merged by an
editable column name, so equally named fields from multiple outputs
cannot silently acquire one another's identity or statistics.
lsdtools.Entity.input_entity_deps#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:717.
input_entity_deps(self) -> Set[str]
self: (unannotated)
Source docstring:
Stable ids of entities this entity depends on for execution.
Used by ``Engine.run_all()`` to derive topological run order. Only
``bind_from`` step bindings and exact ``execution_dependencies``
contribute edges; path-only ``bind`` bindings are excluded (they're
external files, not entity dependencies).
A live source reference is authoritative; the persisted
``source_entity_id`` keeps the edge stable across save/load. Display
names are deliberately ignored because they are editable and non-unique.
lsdtools.Entity.add_trait#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:748.
add_trait(self, trait: str) -> None
self: (unannotated)
trait: str
lsdtools.Entity.remove_trait#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:755.
remove_trait(self, trait: str) -> None
self: (unannotated)
trait: str
lsdtools.Entity.has_trait#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:779.
has_trait(self, trait: str) -> bool
self: (unannotated)
trait: str
lsdtools.Entity.has_all_traits#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:782.
has_all_traits(self, *traits: str) -> bool
self: (unannotated)
traits: str
lsdtools.Entity.has_any_trait#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:785.
has_any_trait(self, *traits: str) -> bool
self: (unannotated)
traits: str
lsdtools.Entity.has_metadata#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:790.
has_metadata(self, key: str) -> bool
key: str
self: (unannotated)
lsdtools.Entity.clear_metadata#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:793.
clear_metadata(self) -> None
self: (unannotated)
lsdtools.Entity.to_dict#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:798.
to_dict(self) -> Dict[str, Any]
self: (unannotated)
lsdtools.Entity.from_dict#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:821.
from_dict(cls, data: Dict[str, Any], event_bus: Optional['EventBus']=None, inactive_packages: Optional[Mapping[str, str]]=None) -> 'Entity'
cls: (unannotated)
data: Dict[str, Any]
event_bus: Optional['EventBus']
inactive_packages: Optional[Mapping[str, str]]
Source docstring:
Restore from a serialized dict. Types auto-resolved via the registry.
The concrete ``Entity`` subclass is recovered from the serialized
``_type`` field. An unavailable type becomes a lossless
:class:`~lsd.tree.missing.MissingEntity`; it is never silently flattened
into the base class.
lsdtools.Entity.run#
Kind: method. Source: core/lsd/src/lsd/tree/entity.py:1003.
run(self, *, resume: bool=True, from_step: Optional[str]=None, cancellation_signal: Any=None) -> 'PipelineResult'
cancellation_signal: Any
from_step: Optional[str]
resume: bool
self: (unannotated)
Source docstring:
Execute the Load -> Shape(s) -> Deliver pipeline on this entity.
Delegates to the parent Engine if one is attached; otherwise creates
a temporary ephemeral engine for this single run.
lsdtools.Events#
Kind: class. Source: core/lsd/src/lsd/core/event_bus.py:406.
Source docstring:
Canonical lifecycle event names with their payload fields.
Subscribe via ``bus.on(Events.STEP_FINISHED, handler)`` or with a glob
(e.g. ``bus.on("pipeline/step/**", h)``). Every payload includes the
keys documented here; unknown extra keys are forward-compatible additions.
Payload values are exact JSON — dict/list/str/bool/int/finite-float/None
with string keys; anything else is refused when the Event is constructed.
Live objects never ride an event: emitters convert first (ids, names,
``to_dict()`` snapshots), which is why the ``entity``/``configurable``
payloads below are dicts.
Engine / run_all level
----------------------
RUN_STARTED run_id, engine_id, order:list[entity_id], entity_names:mapping[id,name],
parallel:int, entity_count:int
RUN_FINISHED run_id, engine_id, ok:bool, ran:int, failed:int, blocked:int,
duration_s:float, error:str|None
ENTITY_STARTED run_id, name, entity_id
ENTITY_FINISHED run_id, name, entity_id, ok:bool, rows:int, duration_s:float,
error:str|None
(``entity_id`` is how a watching View identifies the entity across a
rename — see ``lsd.core.view.View.watch``)
ENTITY_BLOCKED run_id, name, entity_id, upstream:list[entity_id]
Workspace entity forest and Engine view presentation
-----------------------------------------------------
WORKSPACE_ENTITY_ADDED workspace_id, entity_id, parent_id, name,
attached_entity_ids:list[entity_id],
entity:dict — the entity's validated ``to_dict()``
snapshot, captured before the mutation commits
WORKSPACE_ENTITY_REMOVED workspace_id, entity_id, parent_id, name,
detached_entity_ids, entity:dict
WORKSPACE_ENTITY_MOVED workspace_id, entity_id, old_parent_id,
new_parent_id, name
WORKSPACE_ENTITY_REPLACED workspace_id, entity_id, parent_id, name,
detached_entity_ids, attached_entity_ids,
entity:dict, replaced_entity:dict (``to_dict()``
snapshots of the replacement and replaced subtrees)
WORKSPACE_ENTITY_REORDERED workspace_id, entity_id, parent_id, old_index, new_index
PROJECT_SEMANTICS_CHANGED workspace_id, version:1, expected_revision, revision,
variables:dict, symbology:dict
PROJECT_STYLES_CHANGED workspace_id, version:1, styles:list
PROJECT_SHADERS_CHANGED workspace_id, version:1, revision, shaders:list
METADATA_CHANGED type, id, entity_id, workspace_id, key,
old_value, new_value
ENTITY_TRAITS_CHANGED type, id, entity_id, workspace_id, old_traits,
new_traits, added, removed
VIEW_ADDED engine_id, view_id, name
VIEW_REMOVED engine_id, view_id, name
VIEW_SHOWN engine_id, count:int, mode:str (Engine.show over all views)
view_id, name, mode:str (View.show for one view)
CONFIGURABLE_ADDED entity_id, entity_name, configurable_id,
configurable:dict (its ``to_dict()`` snapshot),
configurable_type
CONFIGURABLE_REMOVED entity_id, entity_name, configurable_id,
configurable:dict, configurable_type
Pipeline level (one pipeline per entity)
-----------------------------------------
PIPELINE_STARTED run_id, entity_id, entity_name, step_count:int
PIPELINE_FINISHED run_id, entity_id, ok:bool, ran:int, skipped:int, rows:int,
duration_s:float, error_step:str|None
Step level (all carry ``entity_id`` so consumers attribute steps correctly
when entities run concurrently under ``max_parallel > 1``)
----------
STEP_STARTED run_id, step_class, step_id, entity_id, index:int, total:int
STEP_PROGRESS run_id, step_id, entity_id, fraction:float, message:str
STEP_SKIPPED run_id, step_class, step_id, entity_id, rows:int, output_paths:dict, outputs:dict,
reason:str — either a cache decision ("cached"), or a GATE reason from
``runner._gate_reason``: "package-missing" (a Missing* placeholder),
"package-disabled" (its package is off for this project), or the package's
own freeze string (e.g. "seat-exceeded") when the host set one.
STEP_MATERIALIZED run_id, step_class, step_id, entity_id, output_paths:dict
- fresh artifacts have been written but their paths have not yet been
published to viewer/other consumers. Host-owned materialization transforms
run at this boundary, never after publication.
TRIP_UPDATED run_id, step_class, step_id, entity_id, output_port, trip_id, version_key,
layout:int, versions:dict, num_rows:int, handle, tick:int, final:bool,
snapshot:str|None, snapshot_id:str|None
- a system committed a new Trip value. Nothing was written: the value is
resident and reachable through ``lsd.trip.registry`` by ``handle``. ``final``
is False for a preview tick inside a system group; ``snapshot`` is set once
the runner has written the Trip's parquet snapshot (a second TRIP_UPDATED with
the same versions), which is the only form that survives a restart.
STEP_FINISHED run_id, step_class, step_id, entity_id, rows:int, duration_s:float,
output_paths:dict, outputs:dict
STEP_FAILED run_id, step_class, step_id, entity_id, error:str, duration_s:float
Structure level (the Workspace-owned facts every tree/inspector consumes)
----------
WORKSPACE_ENTITY_ADDED / _REMOVED / _MOVED / _REPLACED / _REORDERED
CONFIGURABLE_ADDED / _REMOVED / _REORDERED
STEP_INPUT_CHANGED one step output re-bound to another step's input
Note: STEP_FINISHED/STEP_SKIPPED carry BOTH ``output_paths`` (manifest paths
on disk, dict name->path) and ``outputs`` (the step's declared output values
via ``get_outputs()``). UI consumers (for example ``lsd-view-pipeline``) read
``outputs``; both keys are present on both events.
Implementation alias: lsd.core.event_bus.Events.
lsdtools.Events.RUN_STARTED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:510.
RUN_STARTED = 'engine/run/started'
lsdtools.Events.RUN_FINISHED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:511.
RUN_FINISHED = 'engine/run/finished'
lsdtools.Events.ENTITY_STARTED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:512.
ENTITY_STARTED = 'engine/entity/started'
lsdtools.Events.ENTITY_FINISHED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:513.
ENTITY_FINISHED = 'engine/entity/finished'
lsdtools.Events.ENTITY_BLOCKED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:514.
ENTITY_BLOCKED = 'engine/entity/blocked'
lsdtools.Events.WORKSPACE_ENTITY_ADDED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:517.
WORKSPACE_ENTITY_ADDED = 'workspace/entity/added'
lsdtools.Events.WORKSPACE_ENTITY_REMOVED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:518.
WORKSPACE_ENTITY_REMOVED = 'workspace/entity/removed'
lsdtools.Events.WORKSPACE_ENTITY_MOVED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:519.
WORKSPACE_ENTITY_MOVED = 'workspace/entity/moved'
lsdtools.Events.WORKSPACE_ENTITY_REPLACED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:520.
WORKSPACE_ENTITY_REPLACED = 'workspace/entity/replaced'
lsdtools.Events.WORKSPACE_ENTITY_REORDERED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:521.
WORKSPACE_ENTITY_REORDERED = 'workspace/entity/reordered'
lsdtools.Events.PROJECT_SEMANTICS_CHANGED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:522.
PROJECT_SEMANTICS_CHANGED = 'workspace/project-semantics/changed'
lsdtools.Events.PROJECT_STYLES_CHANGED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:526.
PROJECT_STYLES_CHANGED = 'workspace/project-styles/changed'
lsdtools.Events.PROJECT_SHADERS_CHANGED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:527.
PROJECT_SHADERS_CHANGED = 'workspace/project-shaders/changed'
lsdtools.Events.CONFIGURABLE_ADDED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:528.
CONFIGURABLE_ADDED = 'entity/configurable/added'
lsdtools.Events.CONFIGURABLE_REMOVED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:529.
CONFIGURABLE_REMOVED = 'entity/configurable/removed'
lsdtools.Events.CONFIGURABLE_REORDERED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:530.
CONFIGURABLE_REORDERED = 'entity/configurable/reordered'
lsdtools.Events.STEP_INPUT_CHANGED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:531.
STEP_INPUT_CHANGED = 'pipeline/step/input/changed'
lsdtools.Events.VIEW_ADDED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:532.
VIEW_ADDED = 'engine/view/added'
lsdtools.Events.VIEW_REMOVED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:533.
VIEW_REMOVED = 'engine/view/removed'
lsdtools.Events.VIEW_SHOWN#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:534.
VIEW_SHOWN = 'engine/view/shown'
lsdtools.Events.PIPELINE_STARTED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:537.
PIPELINE_STARTED = 'pipeline/started'
lsdtools.Events.PIPELINE_FINISHED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:538.
PIPELINE_FINISHED = 'pipeline/finished'
lsdtools.Events.STEP_STARTED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:541.
STEP_STARTED = 'pipeline/step/started'
lsdtools.Events.STEP_PROGRESS#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:542.
STEP_PROGRESS = 'pipeline/step/progress'
lsdtools.Events.STEP_SKIPPED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:543.
STEP_SKIPPED = 'pipeline/step/skipped'
lsdtools.Events.STEP_MATERIALIZED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:544.
STEP_MATERIALIZED = 'pipeline/step/materialized'
lsdtools.Events.TRIP_UPDATED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:546.
TRIP_UPDATED = 'pipeline/trip/updated'
lsdtools.Events.STEP_FINISHED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:547.
STEP_FINISHED = 'pipeline/step/finished'
lsdtools.Events.STEP_FAILED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:548.
STEP_FAILED = 'pipeline/step/failed'
lsdtools.Events.ENTITY_RENAMED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:551.
ENTITY_RENAMED = 'entity/renamed'
lsdtools.Events.ENTITY_TRAITS_CHANGED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:552.
ENTITY_TRAITS_CHANGED = 'entity/traits/changed'
lsdtools.Events.PACKAGE_VERSION_MISMATCH#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:555.
PACKAGE_VERSION_MISMATCH = 'package/version/mismatch'
lsdtools.Events.FILE_CHANGED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:558.
FILE_CHANGED = 'file/changed'
lsdtools.Events.PARAMETER_CHANGED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:561.
PARAMETER_CHANGED = 'configurable/parameter/changed'
lsdtools.Events.PARAMETER_BATCH_CHANGED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:562.
PARAMETER_BATCH_CHANGED = 'configurable/parameter/batch_changed'
lsdtools.Events.METADATA_CHANGED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:563.
METADATA_CHANGED = 'configurable/metadata/changed'
lsdtools.Events.VIEW_ACTION_INVOKED#
Kind: attribute. Source: core/lsd/src/lsd/core/event_bus.py:566.
VIEW_ACTION_INVOKED = 'view/action/invoked'
lsdtools.FieldDefinition#
Kind: class. Source: core/lsd/src/lsd/project_semantics.py:219.
Source docstring:
Semantic identity and optional variable binding for one physical field.
Implementation alias: lsd.project_semantics.FieldDefinition.
lsdtools.FieldDefinition.field_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:222.
field_id: str
lsdtools.FieldDefinition.variable_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:223.
variable_id: str | None
lsdtools.FieldDefinition.name#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:224.
name: str
lsdtools.FieldDefinition.kind#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:225.
kind: str
lsdtools.FieldDefinition.producer#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:226.
producer: FieldProducer | Mapping[str, Any]
lsdtools.FieldDefinition.lineage#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:227.
lineage: tuple[str, ...]
lsdtools.FieldDefinition.unit#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:228.
unit: str | None
unit = None
lsdtools.FieldDefinition.support#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:229.
support: str | None
support = None
lsdtools.FieldDefinition.version#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:230.
version: int
version = 1
lsdtools.FieldDefinition.from_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:257.
from_dict(cls, data: Mapping[str, Any]) -> 'FieldDefinition'
cls: (unannotated)
data: Mapping[str, Any]
lsdtools.FieldDefinition.to_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:273.
to_dict(self) -> dict[str, Any]
self: (unannotated)
lsdtools.FieldProducer#
Kind: class. Source: core/lsd/src/lsd/project_semantics.py:189.
Source docstring:
Stable pipeline output that produces a field across table reruns.
Implementation alias: lsd.project_semantics.FieldProducer.
lsdtools.FieldProducer.entity_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:192.
entity_id: str
lsdtools.FieldProducer.step_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:193.
step_id: str
lsdtools.FieldProducer.output_port#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:194.
output_port: str
lsdtools.FieldProducer.from_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:202.
from_dict(cls, data: Mapping[str, Any]) -> 'FieldProducer'
cls: (unannotated)
data: Mapping[str, Any]
lsdtools.FieldProducer.to_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:210.
to_dict(self) -> dict[str, str]
self: (unannotated)
lsdtools.FileArtifact#
Kind: class. Source: core/lsd/src/lsd/flow/payload.py:261.
Source docstring:
One file or directory produced by a :class:`FileSetPayload`.
Package code supplies ``path`` and optional descriptive fields. The framework resolves the path
after ``run()`` returns and fills the integrity fields; callers can read those fields from
``RunResult.artifacts`` or a low-level ``StepResult``. Symlinks and special files are rejected so
a cached artifact always describes self-contained bytes.
Implementation alias: lsd.flow.payload.FileArtifact.
lsdtools.FileArtifact.path#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:270.
path: str
lsdtools.FileArtifact.media_type#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:271.
media_type: str
media_type = ''
lsdtools.FileArtifact.role#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:272.
role: str
role = ''
lsdtools.FileArtifact.sha256#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:273.
sha256: str
sha256 = field(default='', init=False)
lsdtools.FileArtifact.kind#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:274.
kind: str
kind = field(default='', init=False)
lsdtools.FileArtifact.size_bytes#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:275.
size_bytes: int
size_bytes = field(default=0, init=False)
lsdtools.FileArtifact.file_count#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:276.
file_count: int
file_count = field(default=0, init=False)
lsdtools.FileArtifact.to_dict#
Kind: method. Source: core/lsd/src/lsd/flow/payload.py:311.
to_dict(self) -> Dict[str, Any]
self: (unannotated)
Source docstring:
Return the JSON-safe persisted artifact record.
lsdtools.FileArtifact.from_dict#
Kind: method. Source: core/lsd/src/lsd/flow/payload.py:325.
from_dict(cls, value: Mapping[str, Any]) -> 'FileArtifact'
cls: (unannotated)
value: Mapping[str, Any]
Source docstring:
Reconstruct a persisted record without touching the filesystem.
lsdtools.FileRole#
Kind: class. Source: core/lsd/src/lsd/packages/contributions.py:533.
Source docstring:
One data slot an :class:`EntityTemplate` consumes (e.g. a drillhole's ``collar`` CSV).
``fields`` are the target columns the wizard maps to; ``aliases`` is the per-field alias table the
auto-mapper (:func:`lsd.core.columnmap.resolve_column_map`) uses to detect them; ``rules`` is
lsd-data validation text (e.g. ``"hole_id unique\nrequire x y z"``). A single-file template needs no
roles — its file is loaded as-is.
Implementation alias: lsd.packages.contributions.FileRole.
lsdtools.FileRole.name#
Kind: attribute. Source: core/lsd/src/lsd/packages/contributions.py:541.
name: str
lsdtools.FileRole.fields#
Kind: attribute. Source: core/lsd/src/lsd/packages/contributions.py:542.
fields: Tuple[str, ...]
fields = ()
lsdtools.FileRole.aliases#
Kind: attribute. Source: core/lsd/src/lsd/packages/contributions.py:543.
aliases: Mapping[str, Tuple[str, ...]]
aliases = field(default_factory=dict)
lsdtools.FileRole.rules#
Kind: attribute. Source: core/lsd/src/lsd/packages/contributions.py:544.
rules: str
rules = ''
lsdtools.FileRole.required#
Kind: attribute. Source: core/lsd/src/lsd/packages/contributions.py:545.
required: bool
required = True
lsdtools.FileSetPayload#
Kind: class. Source: core/lsd/src/lsd/flow/payload.py:340.
FileSetPayload(self, artifacts: Mapping[str, FileArtifact | os.PathLike[str] | str], *, metadata: Optional[Mapping[str, Any]]=None) -> None
Source docstring:
Tracked external files/directories returned by an ``@tool.deliver`` function.
``artifacts`` maps stable logical names to :class:`FileArtifact` instances or path-like values.
The framework verifies each path, computes its content SHA-256, persists the records, and refuses
cache reuse after a tracked artifact is deleted or changed.
Example::
return FileSetPayload({
"project": FileArtifact(project_dir, role="SGeMS project"),
"parameters": parameter_xml,
}, metadata={"format": "sgems-review-v1"})
Implementation alias: lsd.flow.payload.FileSetPayload.
lsdtools.FileSetPayload.__init__#
Kind: method. Source: core/lsd/src/lsd/flow/payload.py:355.
__init__(self, artifacts: Mapping[str, FileArtifact | os.PathLike[str] | str], *, metadata: Optional[Mapping[str, Any]]=None) -> None
artifacts: Mapping[str, FileArtifact | os.PathLike[str] | str]
metadata: Optional[Mapping[str, Any]]
self: (unannotated)
lsdtools.FileSetPayload.artifacts#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:374.
artifacts: (unannotated)
artifacts = normalized
lsdtools.FileSetPayload.metadata#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:375.
metadata: (unannotated)
metadata = dict(metadata or {})
lsdtools.InputArtifact#
Kind: class. Source: core/lsd/src/lsd/tools/context.py:26.
Source docstring:
A declared, cache-tracked upstream file without materializing its table.
``@tool.shape`` and ``@tool.deliver`` parameters annotated ``InputArtifact``
are graph input ports, just like ``Table`` parameters. The difference is
that the runtime passes the persisted artifact descriptor and leaves the
Parquet file unopened. This lets a bounded-memory service scan the exact
artifact already produced by LSD::
@tool.shape
def summarize(blocks: InputArtifact) -> Table:
backend = models.open_block_model(blocks)
...
The source path, size, and modification time are already part of the step's
resume-cache key. ``fingerprint`` is a convenient stable identity for
service provenance; it is metadata identity, not a content hash.
Implementation alias: lsd.tools.context.InputArtifact.
Declared bases: os.PathLike[str].
lsdtools.InputArtifact.port#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:45.
port: str
lsdtools.InputArtifact.path#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:46.
path: str
lsdtools.InputArtifact.output_key#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:47.
output_key: str
lsdtools.InputArtifact.source_step_id#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:48.
source_step_id: Optional[str]
source_step_id = None
lsdtools.InputArtifact.source_entity_id#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:49.
source_entity_id: Optional[str]
source_entity_id = None
lsdtools.InputArtifact.size_bytes#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:50.
size_bytes: Optional[int]
size_bytes = None
lsdtools.InputArtifact.mtime_ns#
Kind: attribute. Source: core/lsd/src/lsd/tools/context.py:51.
mtime_ns: Optional[int]
mtime_ns = None
lsdtools.InputArtifact.fingerprint#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:57.
fingerprint(self) -> str
self: (unannotated)
lsdtools.InputArtifact.open_parquet#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:72.
open_parquet(self, *, scan_options: Any=None, filesystem: Any=None, partitioning: Any=None) -> Any
filesystem: Any
partitioning: Any
scan_options: Any
self: (unannotated)
Source docstring:
Open this artifact for projected, bounded record-batch scans.
The artifact's cache-tracked fingerprint and producer coordinates are
carried into the returned dataset metadata. Import stays lazy so a
process that never scans Parquet does not pay PyArrow startup cost.
lsdtools.LayerPayload#
Kind: class. Source: core/lsd/src/lsd/flow/payload.py:459.
LayerPayload(self, *, kind: str='', tables: Optional[Dict[str, Any]]=None, style: Optional[Dict[str, Any]]=None, spec: Optional[Dict[str, Any]]=None, **extra: Any) -> None
Source docstring:
A 3-D viewer geometry layer (``viewer/layer/set``).
``LayerPayload(kind="lines", tables={"path": lines}, style={"width": 1.5})`` folds ``kind`` /
``style`` (and any extra keyword) into ``spec``; ``tables`` carry the geometry Parquet(s).
A package may explicitly retain a layer-scoped editable dataset at zero
geometry with ``feature_kind=...`` and ``data_layer={"version": 1}`` plus
canonical ``tables={"path": ...}``; Viewer3D validates that closed marker.
Implementation alias: lsd.flow.payload.LayerPayload.
Declared bases: ViewerPayload.
lsdtools.LayerPayload.topic#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:469.
topic = 'viewer/layer/set'
lsdtools.LayerPayload.__init__#
Kind: method. Source: core/lsd/src/lsd/flow/payload.py:471.
__init__(self, *, kind: str='', tables: Optional[Dict[str, Any]]=None, style: Optional[Dict[str, Any]]=None, spec: Optional[Dict[str, Any]]=None, **extra: Any) -> None
extra: Any
kind: str
self: (unannotated)
spec: Optional[Dict[str, Any]]
style: Optional[Dict[str, Any]]
tables: Optional[Dict[str, Any]]
lsdtools.LegendPayload#
Kind: class. Source: core/lsd/src/lsd/flow/payload.py:503.
LegendPayload(self, *, tables: Optional[Dict[str, Any]]=None, spec: Optional[Dict[str, Any]]=None, **extra: Any) -> None
Source docstring:
A strict v1 colour legend (``viewer/legend/set``) — spec-only.
``spec`` contains exactly ``title``, canonical ``symbology``, ``value_col``, and nullable
``project_symbology`` provenance. See :func:`validate_legend_payload_spec` for the closed schema.
Implementation alias: lsd.flow.payload.LegendPayload.
Declared bases: ViewerPayload.
lsdtools.LegendPayload.topic#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:510.
topic = 'viewer/legend/set'
lsdtools.LegendPayload.__init__#
Kind: method. Source: core/lsd/src/lsd/flow/payload.py:512.
__init__(self, *, tables: Optional[Dict[str, Any]]=None, spec: Optional[Dict[str, Any]]=None, **extra: Any) -> None
extra: Any
self: (unannotated)
spec: Optional[Dict[str, Any]]
tables: Optional[Dict[str, Any]]
lsdtools.OutputRef#
Kind: class. Source: core/lsd/src/lsd/core/output_ref.py:26.
Source docstring:
Versioned identity of one declared output port on one exact entity step.
Display names, step order, column names, and artifact paths are deliberately
absent. They are mutable observations, not durable routing coordinates.
Implementation alias: lsd.core.output_ref.OutputRef.
lsdtools.OutputRef.entity_id#
Kind: attribute. Source: core/lsd/src/lsd/core/output_ref.py:33.
entity_id: str
lsdtools.OutputRef.step_id#
Kind: attribute. Source: core/lsd/src/lsd/core/output_ref.py:34.
step_id: str
lsdtools.OutputRef.output_port#
Kind: attribute. Source: core/lsd/src/lsd/core/output_ref.py:35.
output_port: str
output_port = 'output'
lsdtools.OutputRef.VERSION#
Kind: attribute. Source: core/lsd/src/lsd/core/output_ref.py:37.
VERSION: ClassVar[int]
VERSION = OUTPUT_REF_VERSION
lsdtools.OutputRef.to_dict#
Kind: method. Source: core/lsd/src/lsd/core/output_ref.py:44.
to_dict(self) -> dict[str, Any]
self: (unannotated)
Source docstring:
Return the closed, JSON-compatible v1 document.
lsdtools.OutputRef.from_dict#
Kind: method. Source: core/lsd/src/lsd/core/output_ref.py:54.
from_dict(cls, value: Mapping[str, Any]) -> OutputRef
cls: (unannotated)
value: Mapping[str, Any]
Source docstring:
Validate and detach one exact v1 output-reference document.
lsdtools.PARQUET_WRITE_POLICY_VERSION#
Kind: value. Source: core/lsd/src/lsd/core/parquet.py:37.
PARQUET_WRITE_POLICY_VERSION = 1
Implementation alias: lsd.core.parquet.PARQUET_WRITE_POLICY_VERSION.
lsdtools.PackageHost#
Kind: class. Source: core/lsd/src/lsd/packages/host.py:30.
PackageHost(self, bus: Any=None, *, services: Optional[Dict[str, Callable]]=None) -> None
Source docstring:
Wraps an event bus and exposes optional host services to a package.
Service callables (all optional) are passed in ``services``:
* ``engine`` : ``() -> Engine | None`` — the current project's engine
* ``project_dir`` : ``() -> str | None`` — the open project's folder
* ``notify`` : ``(message: str, level: str) -> None`` — surface a message
* ``open_in_editor``: ``(path: str | None) -> None`` — open a file/folder in the editor
* ``request_reload``: ``() -> None`` — ask the host to reload scripts
Implementation alias: lsd.packages.host.PackageHost.
lsdtools.PackageHost.__init__#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:41.
__init__(self, bus: Any=None, *, services: Optional[Dict[str, Callable]]=None) -> None
bus: Any
self: (unannotated)
services: Optional[Dict[str, Callable]]
lsdtools.PackageHost.wrap#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:56.
wrap(cls, obj: Any, services: Optional[Dict[str, Callable]]=None) -> 'PackageHost'
cls: (unannotated)
obj: Any
services: Optional[Dict[str, Callable]]
Source docstring:
Return a PackageHost for *obj*. If it's already a host, return it unchanged
(new *services* are added); otherwise wrap the bus.
lsdtools.PackageHost.for_package#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:75.
for_package(self, package: str) -> '_PackageBoundHost'
package: str
self: (unannotated)
Source docstring:
Return a permanent package-owned facade for runtime callbacks.
Unlike :meth:`mounting`, this retains ownership after mount returns, so late services and
subscriptions participate in disable, reload, and unmount lifecycle operations.
lsdtools.PackageHost.bus#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:84.
bus(self) -> Any
self: (unannotated)
Source docstring:
The underlying event bus (or ``None``).
lsdtools.PackageHost.service#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:88.
service(self, name: str, default: Any=None) -> Any
default: Any
name: str
self: (unannotated)
Source docstring:
Resolve a named host service by calling its zero-arg provider.
Returns *default* when the service isn't provided or its provider raises. This is the
generic accessor behind the named properties (``engine``/``project_dir``); front-ends use
it for app-specific capabilities they register — e.g. ``host.service("cache")`` for a
shared package cache. Keeps the core generic (no gui/app names baked into these properties).
The front-end's constructor ``services`` take precedence; a package-registered provider
(:meth:`register_service`) resolves as a fallback.
lsdtools.PackageHost.register_service#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:112.
register_service(self, name: str, provider: Callable, *, package: Optional[str]=None) -> None
name: str
package: Optional[str]
provider: Callable
self: (unannotated)
Source docstring:
Register a named host service *provider* (a zero-arg callable) a package supplies.
Symmetric to :meth:`service` (consumption): a package can *provide* a handle other packages
resolve by name (e.g. a shared cache, a domain client). The provider is stored with its owning
*package* so :meth:`unregister_package_services` can drop exactly that package's providers on
disable/reload. One name has one owner and provider; replaying that exact declaration is
idempotent.
lsdtools.PackageHost.unregister_package_services#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:139.
unregister_package_services(self, package: Optional[str]) -> None
package: Optional[str]
self: (unannotated)
Source docstring:
Drop every service a *package* registered via :meth:`register_service`.
lsdtools.PackageHost.unmount_package#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:143.
unmount_package(self, package: str) -> None
package: str
self: (unannotated)
Source docstring:
Remove every runtime binding owned by *package*.
Disabling is reversible and therefore only gates bindings. Unmounting is the terminal
lifecycle boundary used by reload/removal: callbacks leave the bus, services disappear,
and no inactive marker survives to affect a later fresh mount.
lsdtools.PackageHost.mounting#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:158.
mounting(self, package: str)
package: str
self: (unannotated)
Source docstring:
Attribute subscriptions/services created while one package Tool mounts.
lsdtools.PackageHost.set_package_active#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:167.
set_package_active(self, package: str, active: bool) -> None
active: bool
package: str
self: (unannotated)
Source docstring:
Atomically gate a package's host services and event handlers.
lsdtools.PackageHost.snapshot_runtime_state#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:174.
snapshot_runtime_state(self) -> dict
self: (unannotated)
Source docstring:
Capture package-owned host state for an activation transaction.
lsdtools.PackageHost.restore_runtime_state#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:183.
restore_runtime_state(self, state: dict) -> None
self: (unannotated)
state: dict
Source docstring:
Restore the exact handler/service state captured by :meth:`snapshot_runtime_state`.
lsdtools.PackageHost.on#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:202.
on(self, pattern: str, handler: Callable, priority: int=100) -> Any
handler: Callable
pattern: str
priority: int
self: (unannotated)
lsdtools.PackageHost.off#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:225.
off(self, pattern: str, handler: Callable) -> None
handler: Callable
pattern: str
self: (unannotated)
lsdtools.PackageHost.emit#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:250.
emit(self, *args: Any, **kwargs: Any) -> Any
args: Any
kwargs: Any
self: (unannotated)
lsdtools.PackageHost.emit_collect#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:255.
emit_collect(self, *args: Any, **kwargs: Any) -> Any
args: Any
kwargs: Any
self: (unannotated)
lsdtools.PackageHost.engine#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:263.
engine(self) -> Any
self: (unannotated)
Source docstring:
The current project's engine, or ``None`` if unavailable.
lsdtools.PackageHost.project_dir#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:275.
project_dir(self) -> Optional[str]
self: (unannotated)
Source docstring:
The open project's folder (where its ``.lsd`` and scripts live), or ``None``.
lsdtools.PackageHost.notify#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:286.
notify(self, message: str, level: str='info') -> None
level: str
message: str
self: (unannotated)
Source docstring:
Surface a short message to the user (falls back to logging).
lsdtools.PackageHost.open_in_editor#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:297.
open_in_editor(self, path: Optional[str]=None) -> None
path: Optional[str]
self: (unannotated)
Source docstring:
Ask the host to open *path* in the code editor (no-op if unsupported).
With no *path*, opens the project folder. A relative path resolves against it.
lsdtools.PackageHost.request_reload#
Kind: method. Source: core/lsd/src/lsd/packages/host.py:311.
request_reload(self) -> None
self: (unannotated)
Source docstring:
Ask the host to reload the project's scripts (no-op if unsupported).
lsdtools.ParquetDataset#
Kind: class. Source: core/lsd/src/lsd/core/parquet.py:392.
ParquetDataset(self, source: Any, *, scan_options: ParquetScanOptions=ParquetScanOptions(), filesystem: Any=None, partitioning: Any=None, source_fingerprint: Optional[str]=None) -> None
Source docstring:
An unopened-until-scanned, projected and predicate-pushed dataset.
``source`` may be a Parquet file/directory, an :class:`InputArtifact`, or
an already constructed :class:`pyarrow.dataset.Dataset`. Paths never call
``pyarrow.parquet.read_table`` and therefore never materialize the complete
source table.
Implementation alias: lsd.core.parquet.ParquetDataset.
lsdtools.ParquetDataset.__init__#
Kind: method. Source: core/lsd/src/lsd/core/parquet.py:403.
__init__(self, source: Any, *, scan_options: ParquetScanOptions=ParquetScanOptions(), filesystem: Any=None, partitioning: Any=None, source_fingerprint: Optional[str]=None) -> None
filesystem: Any
partitioning: Any
scan_options: ParquetScanOptions
self: (unannotated)
source: Any
source_fingerprint: Optional[str]
lsdtools.ParquetDataset.schema#
Kind: method. Source: core/lsd/src/lsd/core/parquet.py:508.
schema(self) -> Any
self: (unannotated)
Source docstring:
The Arrow dataset schema, read from metadata without a row scan.
lsdtools.ParquetDataset.scan_batches#
Kind: method. Source: core/lsd/src/lsd/core/parquet.py:513.
scan_batches(self, *, columns: Optional[Union[Sequence[str], Mapping[str, Any]]]=None, filter: Any=None, scan_options: Optional[ParquetScanOptions]=None, cancel: Any=None) -> Iterator[Any]
cancel: Any
columns: Optional[Union[Sequence[str], Mapping[str, Any]]]
filter: Any
scan_options: Optional[ParquetScanOptions]
self: (unannotated)
Source docstring:
Yield projected record batches with an Arrow filter pushed down.
Build ``filter`` with :func:`pyarrow.dataset.field`; it is forwarded
unchanged so Parquet statistics and partition pruning remain available.
Cancellation is checked before scanner construction and at every batch
boundary. It accepts ``threading.Event``, ``StepContext``, or a
zero-argument callable.
lsdtools.ParquetDataset.scan_options#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:480.
scan_options: ParquetScanOptions
scan_options = scan_options
lsdtools.ParquetDataset.metadata#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:481.
metadata: (unannotated)
metadata = ParquetSourceMetadata(source=str(Path(source_text).resolve()) if source_kind == 'parquet' and filesystem is None and Path(source_text).exists() else source_text, source_kind=source_kind, schema=dataset.schema, schema_digest=_schema_digest(dataset.schema), source_fingerprint=trusted_fingerprint or derived_fingerprint, source_fingerprint_semantics='LSD InputArtifact cache-tracked source identity; metadata fingerprint, not file content' if artifact_fingerprint is not None and source_fingerprint is None else 'caller-supplied trusted source identity' if source_fingerprint is not None else derived_semantics, fragments=len(fragments), physical_files=physical_files, physical_bytes=physical_bytes, **artifact)
lsdtools.ParquetScanCancelled#
Kind: class. Source: core/lsd/src/lsd/core/parquet.py:40.
Source docstring:
Raised at a record-batch boundary after cooperative cancellation.
Implementation alias: lsd.core.parquet.ParquetScanCancelled.
Declared bases: RuntimeError.
lsdtools.ParquetScanOptions#
Kind: class. Source: core/lsd/src/lsd/core/parquet.py:45.
Source docstring:
Memory and read-ahead bounds for an Arrow Dataset scan.
Arrow may use worker threads inside these bounds. Defaults deliberately
retain only one decoded batch and one fragment of read-ahead, making the
contract safe for model-sized artifacts before a caller opts into a wider
throughput window.
Implementation alias: lsd.core.parquet.ParquetScanOptions.
lsdtools.ParquetScanOptions.batch_size#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:54.
batch_size: int
batch_size = 65536
lsdtools.ParquetScanOptions.batch_readahead#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:55.
batch_readahead: int
batch_readahead = 1
lsdtools.ParquetScanOptions.fragment_readahead#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:56.
fragment_readahead: int
fragment_readahead = 1
lsdtools.ParquetScanOptions.use_threads#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:57.
use_threads: bool
use_threads = True
lsdtools.ParquetSourceMetadata#
Kind: class. Source: core/lsd/src/lsd/core/parquet.py:72.
Source docstring:
Metadata identity and lineage for one opened Parquet dataset.
``source_fingerprint`` is intentionally explicit about its semantics. A
local source uses resolved fragment paths, sizes, and mtimes; an
:class:`InputArtifact` uses the runtime's cache-tracked artifact identity.
Neither is advertised as a content hash.
Implementation alias: lsd.core.parquet.ParquetSourceMetadata.
lsdtools.ParquetSourceMetadata.source#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:81.
source: str
lsdtools.ParquetSourceMetadata.source_kind#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:82.
source_kind: str
lsdtools.ParquetSourceMetadata.schema#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:83.
schema: Any
lsdtools.ParquetSourceMetadata.schema_digest#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:84.
schema_digest: str
lsdtools.ParquetSourceMetadata.source_fingerprint#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:85.
source_fingerprint: str
lsdtools.ParquetSourceMetadata.source_fingerprint_semantics#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:86.
source_fingerprint_semantics: str
lsdtools.ParquetSourceMetadata.fragments#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:87.
fragments: int
lsdtools.ParquetSourceMetadata.physical_files#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:88.
physical_files: int
lsdtools.ParquetSourceMetadata.physical_bytes#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:89.
physical_bytes: Optional[int]
lsdtools.ParquetSourceMetadata.artifact_port#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:90.
artifact_port: Optional[str]
artifact_port = None
lsdtools.ParquetSourceMetadata.artifact_output_key#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:91.
artifact_output_key: Optional[str]
artifact_output_key = None
lsdtools.ParquetSourceMetadata.source_step_id#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:92.
source_step_id: Optional[str]
source_step_id = None
lsdtools.ParquetSourceMetadata.source_entity_id#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:93.
source_entity_id: Optional[str]
source_entity_id = None
lsdtools.ParquetSourceMetadata.provenance_dict#
Kind: method. Source: core/lsd/src/lsd/core/parquet.py:95.
provenance_dict(self) -> dict[str, Any]
self: (unannotated)
Source docstring:
Return a detached, JSON-compatible provenance record.
lsdtools.ParquetWritePolicy#
Kind: class. Source: core/lsd/src/lsd/core/parquet.py:115.
Source docstring:
One named, versioned Parquet physical-layout policy.
Logical schemas and public write APIs remain unchanged when the runtime
advances a physical policy. ``policy_id`` is the stable value to record in
artifact manifests and benchmark results.
Implementation alias: lsd.core.parquet.ParquetWritePolicy.
lsdtools.ParquetWritePolicy.name#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:123.
name: str
lsdtools.ParquetWritePolicy.version#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:124.
version: int
version = PARQUET_WRITE_POLICY_VERSION
lsdtools.ParquetWritePolicy.compression#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:125.
compression: str
compression = 'snappy'
lsdtools.ParquetWritePolicy.compression_level#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:126.
compression_level: Optional[int]
compression_level = None
lsdtools.ParquetWritePolicy.row_group_size#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:127.
row_group_size: int
row_group_size = 131072
lsdtools.ParquetWritePolicy.use_dictionary#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:128.
use_dictionary: Union[bool, tuple[str, ...]]
use_dictionary = True
lsdtools.ParquetWritePolicy.write_statistics#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:129.
write_statistics: Union[bool, tuple[str, ...]]
write_statistics = True
lsdtools.ParquetWritePolicy.use_byte_stream_split#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:130.
use_byte_stream_split: Union[bool, tuple[str, ...]]
use_byte_stream_split = False
lsdtools.ParquetWritePolicy.data_page_version#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:131.
data_page_version: str
data_page_version = '1.0'
lsdtools.ParquetWritePolicy.write_page_index#
Kind: attribute. Source: core/lsd/src/lsd/core/parquet.py:132.
write_page_index: bool
write_page_index = False
lsdtools.ParquetWritePolicy.policy_id#
Kind: method. Source: core/lsd/src/lsd/core/parquet.py:166.
policy_id(self) -> str
self: (unannotated)
lsdtools.ParquetWritePolicy.with_overrides#
Kind: method. Source: core/lsd/src/lsd/core/parquet.py:169.
with_overrides(self, **changes: Any) -> 'ParquetWritePolicy'
changes: Any
self: (unannotated)
Source docstring:
Return a validated policy variant without mutating the registry.
lsdtools.ParquetWritePolicy.write_options#
Kind: method. Source: core/lsd/src/lsd/core/parquet.py:174.
write_options(self) -> dict[str, Any]
self: (unannotated)
Source docstring:
Arguments shared by ``pyarrow.parquet.write_table`` callers.
lsdtools.ParquetWritePolicy.writer_options#
Kind: method. Source: core/lsd/src/lsd/core/parquet.py:179.
writer_options(self) -> dict[str, Any]
self: (unannotated)
Source docstring:
Arguments shared by streaming ``ParquetWriter`` callers.
lsdtools.ProjectSemanticsCatalog#
Kind: class. Source: core/lsd/src/lsd/project_semantics.py:684.
Source docstring:
One immutable, atomically revisioned project semantics snapshot.
Implementation alias: lsd.project_semantics.ProjectSemanticsCatalog.
lsdtools.ProjectSemanticsCatalog.revision#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:687.
revision: int
revision = 0
lsdtools.ProjectSemanticsCatalog.concepts#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:688.
concepts: tuple[VariableConcept, ...]
concepts = ()
lsdtools.ProjectSemanticsCatalog.fields#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:689.
fields: tuple[FieldDefinition, ...]
fields = ()
lsdtools.ProjectSemanticsCatalog.styles#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:690.
styles: tuple[StyleDefinition, ...]
styles = ()
lsdtools.ProjectSemanticsCatalog.assignments#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:691.
assignments: tuple[StyleAssignment, ...]
assignments = ()
lsdtools.ProjectSemanticsCatalog.uses#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:692.
uses: tuple[SymbologyUse, ...]
uses = ()
lsdtools.ProjectSemanticsCatalog.version#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:693.
version: int
version = 1
lsdtools.ProjectSemanticsCatalog.empty#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:724.
empty(cls) -> 'ProjectSemanticsCatalog'
cls: (unannotated)
lsdtools.ProjectSemanticsCatalog.from_sections#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:728.
from_sections(cls, variables: Mapping[str, Any] | None, symbology: Mapping[str, Any] | None) -> 'ProjectSemanticsCatalog'
cls: (unannotated)
symbology: Mapping[str, Any] | None
variables: Mapping[str, Any] | None
lsdtools.ProjectSemanticsCatalog.from_document#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:751.
from_document(cls, document: Mapping[str, Any]) -> 'ProjectSemanticsCatalog'
cls: (unannotated)
document: Mapping[str, Any]
lsdtools.ProjectSemanticsCatalog.to_sections#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:756.
to_sections(self) -> tuple[dict[str, Any], dict[str, Any]]
self: (unannotated)
lsdtools.ProjectSemanticsCatalog.replace_contents#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:772.
replace_contents(self, *, concepts: Iterable[VariableConcept] | None=None, fields: Iterable[FieldDefinition] | None=None, styles: Iterable[StyleDefinition] | None=None, assignments: Iterable[StyleAssignment] | None=None, uses: Iterable[SymbologyUse] | None=None) -> 'ProjectSemanticsCatalog'
assignments: Iterable[StyleAssignment] | None
concepts: Iterable[VariableConcept] | None
fields: Iterable[FieldDefinition] | None
self: (unannotated)
styles: Iterable[StyleDefinition] | None
uses: Iterable[SymbologyUse] | None
Source docstring:
Build one validated candidate without advancing its base revision.
lsdtools.ProjectSemanticsCatalog.with_concept#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:804.
with_concept(self, value: VariableConcept) -> 'ProjectSemanticsCatalog'
self: (unannotated)
value: VariableConcept
lsdtools.ProjectSemanticsCatalog.without_concept#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:809.
without_concept(self, variable_id: str) -> 'ProjectSemanticsCatalog'
self: (unannotated)
variable_id: str
lsdtools.ProjectSemanticsCatalog.with_field#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:814.
with_field(self, value: FieldDefinition) -> 'ProjectSemanticsCatalog'
self: (unannotated)
value: FieldDefinition
lsdtools.ProjectSemanticsCatalog.without_field#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:819.
without_field(self, field_id: str) -> 'ProjectSemanticsCatalog'
field_id: str
self: (unannotated)
lsdtools.ProjectSemanticsCatalog.with_style#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:824.
with_style(self, value: StyleDefinition) -> 'ProjectSemanticsCatalog'
self: (unannotated)
value: StyleDefinition
lsdtools.ProjectSemanticsCatalog.without_style#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:829.
without_style(self, style_id: str) -> 'ProjectSemanticsCatalog'
self: (unannotated)
style_id: str
lsdtools.ProjectSemanticsCatalog.with_assignment#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:834.
with_assignment(self, value: StyleAssignment) -> 'ProjectSemanticsCatalog'
self: (unannotated)
value: StyleAssignment
lsdtools.ProjectSemanticsCatalog.without_assignment#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:841.
without_assignment(self, assignment_id: str) -> 'ProjectSemanticsCatalog'
assignment_id: str
self: (unannotated)
lsdtools.ProjectSemanticsCatalog.with_use#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:848.
with_use(self, value: SymbologyUse) -> 'ProjectSemanticsCatalog'
self: (unannotated)
value: SymbologyUse
lsdtools.ProjectSemanticsCatalog.without_use#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:853.
without_use(self, use_id: str) -> 'ProjectSemanticsCatalog'
self: (unannotated)
use_id: str
lsdtools.ProjectSemanticsCatalog.concept#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:856.
concept(self, variable_id: str) -> VariableConcept | None
self: (unannotated)
variable_id: str
lsdtools.ProjectSemanticsCatalog.field_definition#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:859.
field_definition(self, field_id: str) -> FieldDefinition | None
field_id: str
self: (unannotated)
lsdtools.ProjectSemanticsCatalog.style#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:862.
style(self, style_id: str) -> StyleDefinition | None
self: (unannotated)
style_id: str
lsdtools.ProjectSemanticsCatalog.assignment#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:865.
assignment(self, assignment_id: str) -> StyleAssignment | None
assignment_id: str
self: (unannotated)
lsdtools.ProjectSemanticsCatalog.use#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:871.
use(self, use_id: str) -> SymbologyUse | None
self: (unannotated)
use_id: str
lsdtools.ProjectSemanticsRevisionError#
Kind: class. Source: core/lsd/src/lsd/project_semantics.py:58.
Source docstring:
A Workspace semantic mutation was based on a stale catalog revision.
Implementation alias: lsd.project_semantics.ProjectSemanticsRevisionError.
Declared bases: ValueError.
lsdtools.Reads#
Kind: class. Source: core/lsd/src/lsd/trip/view.py:43.
Reads(self, *names: str) -> None
Source docstring:
Components a system reads (read-only views).
Implementation alias: lsd.trip.view.Reads.
lsdtools.Reads.names#
Kind: attribute. Source: core/lsd/src/lsd/trip/view.py:45.
names: Tuple[str, ...]
lsdtools.Reads.__init__#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:47.
__init__(self, *names: str) -> None
names: str
self: (unannotated)
lsdtools.RunResult#
Kind: class. Source: core/lsd/src/lsd/runtime/runner.py:184.
RunResult(self, pipeline: PipelineResult) -> None
Source docstring:
The friendly result of ``Engine.run(<wired steps>)`` — wraps a :class:`PipelineResult`.
Exposes the terminal table as an ``lsd.table.Table`` and stays fluent::
Engine().run(double(t=numbers())).print() # console preview
data = Engine().run(pipeline).output # a Table
for port, t in Engine().run(fanout).outputs.items(): ...
The wrapped :class:`PipelineResult` is available as :attr:`pipeline` for the
low-level view (``.step_results``, raw ``pa.Table`` via ``.pipeline.output``).
Implementation alias: lsd.runtime.runner.RunResult.
lsdtools.RunResult.__init__#
Kind: method. Source: core/lsd/src/lsd/runtime/runner.py:199.
__init__(self, pipeline: PipelineResult) -> None
pipeline: PipelineResult
self: (unannotated)
lsdtools.RunResult.ok#
Kind: method. Source: core/lsd/src/lsd/runtime/runner.py:203.
ok(self) -> bool
self: (unannotated)
lsdtools.RunResult.raise_on_error#
Kind: method. Source: core/lsd/src/lsd/runtime/runner.py:206.
raise_on_error(self) -> 'RunResult'
self: (unannotated)
lsdtools.RunResult.output#
Kind: method. Source: core/lsd/src/lsd/runtime/runner.py:211.
output(self)
self: (unannotated)
Source docstring:
The last step's primary output as a :class:`~lsd.table.Table` (or ``None``).
lsdtools.RunResult.outputs#
Kind: method. Source: core/lsd/src/lsd/runtime/runner.py:220.
outputs(self) -> dict
self: (unannotated)
Source docstring:
The last producing step's outputs as ``{port: Table}`` (a Trip passes through as-is).
lsdtools.RunResult.artifacts#
Kind: method. Source: core/lsd/src/lsd/runtime/runner.py:230.
artifacts(self) -> dict
self: (unannotated)
Source docstring:
Tracked files/directories delivered by the pipeline, keyed by logical name.
lsdtools.RunResult.print#
Kind: method. Source: core/lsd/src/lsd/runtime/runner.py:235.
print(self, n: int=20) -> 'RunResult'
n: int
self: (unannotated)
Source docstring:
Print a compact preview of the result to the console; returns self.
lsdtools.RunResult.pipeline#
Kind: attribute. Source: core/lsd/src/lsd/runtime/runner.py:200.
pipeline: PipelineResult
pipeline = pipeline
lsdtools.SchemaError#
Kind: class. Source: core/lsd/src/lsd/flow/steps.py:256.
Source docstring:
Raised when a step's output does not match its declared ``output_schema``.
Implementation alias: lsd.flow.steps.SchemaError.
Declared bases: ValueError.
lsdtools.Source#
Kind: class. Source: core/lsd/src/lsd/tools/source.py:57.
Source(self, spec: str='', step: Any=None) -> None
Source docstring:
The source a ``@tool.load`` reads from (see the module docstring).
Implementation alias: lsd.tools.source.Source.
lsdtools.Source.__init__#
Kind: method. Source: core/lsd/src/lsd/tools/source.py:62.
__init__(self, spec: str='', step: Any=None) -> None
self: (unannotated)
spec: str
step: Any
lsdtools.Source.file#
Kind: method. Source: core/lsd/src/lsd/tools/source.py:68.
file(cls, *paths: Any, folder: str='', patterns: str='', combine: str='concat') -> 'Source'
cls: (unannotated)
combine: str
folder: str
paths: Any
patterns: str
lsdtools.Source.sql#
Kind: method. Source: core/lsd/src/lsd/tools/source.py:74.
sql(cls, db: Any, query: str) -> 'Source'
cls: (unannotated)
db: Any
query: str
lsdtools.Source.of#
Kind: method. Source: core/lsd/src/lsd/tools/source.py:79.
of(cls, kind: str, **config: Any) -> 'Source'
cls: (unannotated)
config: Any
kind: str
Source docstring:
A source of any registered *kind* with its config fields (e.g. a custom ``rest-api`` kind).
lsdtools.Source.spec#
Kind: method. Source: core/lsd/src/lsd/tools/source.py:85.
spec(self) -> str
self: (unannotated)
Source docstring:
The serialized JSON spec (from the bound step's ``source`` param, or this value's).
lsdtools.Source.read#
Kind: method. Source: core/lsd/src/lsd/tools/source.py:91.
read(self) -> Any
self: (unannotated)
Source docstring:
Read the source into a :class:`~lsd.table.Table`.
lsdtools.Source.paths#
Kind: method. Source: core/lsd/src/lsd/tools/source.py:102.
paths(self) -> List[str]
self: (unannotated)
Source docstring:
Resolved file paths (file kinds) or ``[]``.
lsdtools.StepContext#
Kind: class. Source: core/lsd/src/lsd/tools/context.py:113.
StepContext(self, step: Any) -> None
Source docstring:
Declared-input and cache-neutral capabilities available inside a step's ``run``.
Declare it by annotating a ``run`` parameter ``StepContext``::
@tool.shape
def heavy(t: Table, ctx: StepContext) -> Table:
ctx.progress(0.5, "halfway")
if ctx.cancelled:
return t
...
Implementation alias: lsd.tools.context.StepContext.
lsdtools.StepContext.__init__#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:128.
__init__(self, step: Any) -> None
self: (unannotated)
step: Any
lsdtools.StepContext.require_capability#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:146.
require_capability(self, name: str) -> Any
name: str
self: (unannotated)
Source docstring:
Resolve a declared, explicitly supplied run capability while this step runs.
Such steps are never served from cache. The capability is not persisted,
inferred from the project, or inherited from an unrelated execution.
lsdtools.StepContext.progress#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:162.
progress(self, fraction: float, message: str='') -> None
fraction: float
message: str
self: (unannotated)
Source docstring:
Report progress in ``[0, 1]`` (best-effort; emits a step-progress event if a bus is set).
lsdtools.StepContext.cancelled#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:194.
cancelled(self) -> bool
self: (unannotated)
Source docstring:
True if a cancellation was requested for this run.
lsdtools.StepContext.step_id#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:207.
step_id(self) -> Optional[str]
self: (unannotated)
Source docstring:
This step's id (read-only — for keying emitted events, never for reading cached state).
lsdtools.StepContext.entity_id#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:212.
entity_id(self) -> Optional[str]
self: (unannotated)
Source docstring:
The owning entity's id (read-only — for keying emitted events).
lsdtools.StepContext.set_output#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:217.
set_output(self, name: str, value: Any) -> None
name: str
self: (unannotated)
value: Any
Source docstring:
Record a read-only graph-scalar output (declared via ``@tool.<kind>(graph_outputs=…)``).
These are ``output=True`` params — excluded from the cache key and emitted in STEP_FINISHED,
so setting them never affects resume caching.
lsdtools.StepContext.input_artifact#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:227.
input_artifact(self, port: str='main') -> InputArtifact
port: str
self: (unannotated)
Source docstring:
Return a declared bound input without reading its Parquet contents.
Artifact metadata is cache-visible because every bound input is included
in the owning step's parameter hash. A clear error is raised when the
port is not explicitly bound or its upstream output is unavailable.
lsdtools.StepContext.input_path#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:240.
input_path(self, port: str='main') -> str
port: str
self: (unannotated)
Source docstring:
Convenience spelling for ``input_artifact(port).path``.
lsdtools.StepContext.emit#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:245.
emit(self, topic: str, **data: Any) -> None
data: Any
self: (unannotated)
topic: str
Source docstring:
Emit an event on the engine's bus (e.g. ``viewer/chart/set``) — a cache-neutral side effect.
Routes through the canonical sync→async bridge; best-effort (never fails the step).
lsdtools.StepContext.output_dir#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:258.
output_dir(self) -> str
self: (unannotated)
Source docstring:
The step's workspace output directory (where a deliver writes its artifacts).
lsdtools.StepContext.scratch_dir#
Kind: method. Source: core/lsd/src/lsd/tools/context.py:263.
scratch_dir(self) -> str
self: (unannotated)
Source docstring:
A private temporary directory for this step (created lazily).
lsdtools.StyleAssignment#
Kind: class. Source: core/lsd/src/lsd/project_semantics.py:590.
Source docstring:
One shared variable-to-style binding and its explicit domain policy.
The mapping itself lives in the style's canonical document (literal breaks, stops or
categories); the domain policy records which range authority those breaks were fitted to.
Implementation alias: lsd.project_semantics.StyleAssignment.
lsdtools.StyleAssignment.assignment_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:597.
assignment_id: str
lsdtools.StyleAssignment.variable_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:598.
variable_id: str
lsdtools.StyleAssignment.style_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:599.
style_id: str
lsdtools.StyleAssignment.domain#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:600.
domain: DomainPolicy | Mapping[str, Any]
lsdtools.StyleAssignment.version#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:601.
version: int
version = 1
lsdtools.StyleAssignment.from_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:616.
from_dict(cls, data: Mapping[str, Any]) -> 'StyleAssignment'
cls: (unannotated)
data: Mapping[str, Any]
lsdtools.StyleAssignment.to_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:626.
to_dict(self) -> dict[str, Any]
self: (unannotated)
lsdtools.StyleDefinition#
Kind: class. Source: core/lsd/src/lsd/project_semantics.py:538.
Source docstring:
Named project appearance: one complete canonical symbology document.
Implementation alias: lsd.project_semantics.StyleDefinition.
lsdtools.StyleDefinition.style_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:541.
style_id: str
lsdtools.StyleDefinition.label#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:542.
label: str
lsdtools.StyleDefinition.symbology#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:543.
symbology: Mapping[str, Any] | Symbology
lsdtools.StyleDefinition.version#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:544.
version: int
version = 1
lsdtools.StyleDefinition.symbology_document#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:565.
symbology_document(self) -> Symbology
self: (unannotated)
lsdtools.StyleDefinition.from_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:571.
from_dict(cls, data: Mapping[str, Any]) -> 'StyleDefinition'
cls: (unannotated)
data: Mapping[str, Any]
lsdtools.StyleDefinition.to_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:580.
to_dict(self) -> dict[str, Any]
self: (unannotated)
lsdtools.SymbologyUse#
Kind: class. Source: core/lsd/src/lsd/project_semantics.py:637.
Source docstring:
One visualization's field and the shared assignment it draws through.
Implementation alias: lsd.project_semantics.SymbologyUse.
lsdtools.SymbologyUse.use_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:640.
use_id: str
lsdtools.SymbologyUse.field_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:641.
field_id: str
lsdtools.SymbologyUse.assignment_id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:642.
assignment_id: str
lsdtools.SymbologyUse.version#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:643.
version: int
version = 1
lsdtools.SymbologyUse.from_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:652.
from_dict(cls, data: Mapping[str, Any]) -> 'SymbologyUse'
cls: (unannotated)
data: Mapping[str, Any]
lsdtools.SymbologyUse.to_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:661.
to_dict(self) -> dict[str, Any]
self: (unannotated)
lsdtools.Table#
Kind: class. Source: core/lsd/src/lsd/table/table.py:121.
Table(self, data: Any=None, /, **columns: Any) -> None
Source docstring:
An immutable, zero-copy view over one ``pyarrow.Table``.
Every verb returns a new ``Table`` (or a ``Column``); nothing mutates in place and nothing
iterates rows in Python. Reach the raw table with :attr:`arrow`.
Implementation alias: lsd.table.table.Table.
lsdtools.Table.__init__#
Kind: method. Source: core/lsd/src/lsd/table/table.py:130.
__init__(self, data: Any=None, /, **columns: Any) -> None
columns: Any
data: Any
self: (unannotated)
Source docstring:
Build a Table from *data* — a dict of columns, a ``pa.Table``, a list of row dicts, a
pandas ``DataFrame``, or another ``Table`` (rewrapped, sharing its arrow table). With no
positional arg, keyword columns are used: ``Table(x=[1, 2], y=[3, 4])``.
lsdtools.Table.read_csv#
Kind: method. Source: core/lsd/src/lsd/table/table.py:156.
read_csv(cls, path, delimiter: str=',', header: bool=True) -> 'Table'
cls: (unannotated)
delimiter: str
header: bool
path: (unannotated)
Source docstring:
Read a CSV/TSV file into a :class:`Table`.
lsdtools.Table.read_parquet#
Kind: method. Source: core/lsd/src/lsd/table/table.py:164.
read_parquet(cls, path) -> 'Table'
cls: (unannotated)
path: (unannotated)
Source docstring:
Read a Parquet file into a :class:`Table`.
lsdtools.Table.arrow#
Kind: method. Source: core/lsd/src/lsd/table/table.py:171.
arrow(self)
self: (unannotated)
Source docstring:
The underlying ``pyarrow.Table`` (zero-copy).
lsdtools.Table.schema#
Kind: method. Source: core/lsd/src/lsd/table/table.py:176.
schema(self)
self: (unannotated)
lsdtools.Table.columns#
Kind: method. Source: core/lsd/src/lsd/table/table.py:180.
columns(self) -> list
self: (unannotated)
lsdtools.Table.__getitem__#
Kind: method. Source: core/lsd/src/lsd/table/table.py:189.
__getitem__(self, name: str) -> Column
name: str
self: (unannotated)
lsdtools.Table.with_column#
Kind: method. Source: core/lsd/src/lsd/table/table.py:193.
with_column(self, name: str, value: Any) -> 'Table'
name: str
self: (unannotated)
value: Any
Source docstring:
Add or replace column *name* with *value* (a ``Column`` or a pyarrow array).
lsdtools.Table.filter#
Kind: method. Source: core/lsd/src/lsd/table/table.py:200.
filter(self, mask: Any) -> 'Table'
mask: Any
self: (unannotated)
Source docstring:
Keep rows where *mask* (a bool ``Column``) is True.
lsdtools.Table.select#
Kind: method. Source: core/lsd/src/lsd/table/table.py:204.
select(self, *names: Any) -> 'Table'
names: Any
self: (unannotated)
Source docstring:
Keep only the named columns (in the given order).
lsdtools.Table.drop#
Kind: method. Source: core/lsd/src/lsd/table/table.py:209.
drop(self, *names: str) -> 'Table'
names: str
self: (unannotated)
Source docstring:
Drop the named columns.
lsdtools.Table.rename#
Kind: method. Source: core/lsd/src/lsd/table/table.py:214.
rename(self, mapping: Mapping[str, str]) -> 'Table'
mapping: Mapping[str, str]
self: (unannotated)
Source docstring:
Rename columns via ``{old: new}`` (unlisted columns are unchanged).
lsdtools.Table.sort#
Kind: method. Source: core/lsd/src/lsd/table/table.py:218.
sort(self, by: Any, descending: bool=False) -> 'Table'
by: Any
descending: bool
self: (unannotated)
Source docstring:
Sort by one column name or a list of them.
lsdtools.Table.head#
Kind: method. Source: core/lsd/src/lsd/table/table.py:224.
head(self, n: int=5) -> 'Table'
n: int
self: (unannotated)
Source docstring:
The first *n* rows.
lsdtools.Table.join#
Kind: method. Source: core/lsd/src/lsd/table/table.py:228.
join(self, other: 'Table', on: Any, how: str='inner') -> 'Table'
how: str
on: Any
other: 'Table'
self: (unannotated)
Source docstring:
Join with *other* on a key column (or list of them).
lsdtools.Table.group_by#
Kind: method. Source: core/lsd/src/lsd/table/table.py:233.
group_by(self, *keys: Any) -> _GroupBy
keys: Any
self: (unannotated)
Source docstring:
Group by one or more columns; chain :meth:`_GroupBy.agg`.
lsdtools.Table.null_report#
Kind: method. Source: core/lsd/src/lsd/table/table.py:238.
null_report(self) -> 'Table'
self: (unannotated)
Source docstring:
A small table of ``column | nulls | pct`` — one row per column.
lsdtools.Table.to_pylist#
Kind: method. Source: core/lsd/src/lsd/table/table.py:249.
to_pylist(self) -> list
self: (unannotated)
Source docstring:
A list of row dicts (materializes into Python — preview/small tables only).
lsdtools.Table.to_dicts#
Kind: attribute. Source: core/lsd/src/lsd/table/table.py:253.
to_dicts = to_pylist
lsdtools.Table.write_parquet#
Kind: method. Source: core/lsd/src/lsd/table/table.py:255.
write_parquet(self, path, compression: str='snappy')
compression: str
path: (unannotated)
self: (unannotated)
lsdtools.Table.write_csv#
Kind: method. Source: core/lsd/src/lsd/table/table.py:260.
write_csv(self, path)
path: (unannotated)
self: (unannotated)
lsdtools.Table.print#
Kind: method. Source: core/lsd/src/lsd/table/table.py:265.
print(self, n: int=20) -> 'Table'
n: int
self: (unannotated)
Source docstring:
Print a compact preview of the first *n* rows to the console; returns self.
lsdtools.Table.preview#
Kind: method. Source: core/lsd/src/lsd/table/table.py:270.
preview(self, n: int=20) -> str
n: int
self: (unannotated)
Source docstring:
The aligned-ASCII preview of the first *n* rows (header + rule + rows + "… N more rows").
The canonical headless/text form of a table — used by the console ``print()`` and by the
table widget's ``to_text()``.
lsdtools.ToDisk#
Kind: class. Source: core/lsd/src/lsd/flow/trip_steps.py:407.
Source docstring:
Project a Trip back to a table (the tier's explicit exit -- profiled and written).
A plain Shape: its output is an ordinary table port, profiled and written to parquet exactly
like any Shape, so everything downstream sees an ordinary table again. It reads the Trip off
the sequential ``trip`` port; vector components become scalar columns (``name.0`` ...).
Named for the boundary, not the conversion: what matters to a reader is that the data stops
being resident here. A deliver reading the Trip directly is the other exit, and does not.
Implementation alias: lsd.flow.trip_steps.ToDisk.
Declared bases: ShapeStep.
lsdtools.ToDisk.input_ports#
Kind: attribute. Source: core/lsd/src/lsd/flow/trip_steps.py:418.
input_ports: ClassVar[List[str]]
input_ports = [TRIP_PORT]
lsdtools.ToDisk.output_ports#
Kind: attribute. Source: core/lsd/src/lsd/flow/trip_steps.py:419.
output_ports: ClassVar[List[str]]
output_ports = [OUTPUT_KEY]
lsdtools.ToDisk.columns#
Kind: attribute. Source: core/lsd/src/lsd/flow/trip_steps.py:421.
columns = param(str, default='', label='Columns', description='Comma-separated components to project (blank = all).')
lsdtools.ToDisk.run#
Kind: method. Source: core/lsd/src/lsd/flow/trip_steps.py:424.
run(self, inputs: Tables) -> Any
inputs: Tables
self: (unannotated)
lsdtools.ToMemory#
Kind: class. Source: core/lsd/src/lsd/flow/trip_steps.py:354.
Source docstring:
Bridge a loaded table into an in-memory Trip (the tier's entry point).
Its input is an ordinary ``main`` table (not a Trip); it declares no component access. It
reads the table, mints a Trip, and hands it on -- so ``Load -> ToMemory -> System* -> ToDisk``
is one ordinary entity whose middle steps never touch the disk.
Implementation alias: lsd.flow.trip_steps.ToMemory.
Declared bases: SystemStep.
lsdtools.ToMemory.input_ports#
Kind: attribute. Source: core/lsd/src/lsd/flow/trip_steps.py:363.
input_ports: ClassVar[List[str]]
input_ports = ['main']
lsdtools.ToMemory.output_ports#
Kind: attribute. Source: core/lsd/src/lsd/flow/trip_steps.py:364.
output_ports: ClassVar[List[str]]
output_ports = [TRIP_PORT]
lsdtools.ToMemory.id_column#
Kind: attribute. Source: core/lsd/src/lsd/flow/trip_steps.py:366.
id_column = param(str, default='', label='Id column', description='Integer column to use as the entity id (blank = the row index).')
lsdtools.ToMemory.components#
Kind: attribute. Source: core/lsd/src/lsd/flow/trip_steps.py:368.
components = param(str, default='', label='Components', description='Comma-separated columns to carry (blank = all).')
lsdtools.Tool#
Kind: class. Source: core/lsd/src/lsd/tools/tool.py:826.
Tool(self, name: str, *, label: Optional[str]=None) -> None
Source docstring:
Declares a package's node types via decorators. Create one at module scope.
Implementation alias: lsd.tools.tool.Tool.
lsdtools.Tool.__init__#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:829.
__init__(self, name: str, *, label: Optional[str]=None) -> None
label: Optional[str]
name: str
self: (unannotated)
lsdtools.Tool.load#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:928.
load(self, fn: Optional[Callable]=None, *, outputs: Optional[List[str]]=None, graph_outputs: Optional[dict]=None, source_kinds: Optional[tuple]=None, overrides: Optional[str]=None, override_mode: str='replace', addable: bool=True, capabilities: tuple[str, ...]=())
addable: bool
capabilities: tuple[str, ...]
fn: Optional[Callable]
graph_outputs: Optional[dict]
outputs: Optional[List[str]]
override_mode: str
overrides: Optional[str]
self: (unannotated)
source_kinds: Optional[tuple]
Source docstring:
Declare a data-loading step (produces a ``Table`` from nothing / a file / a source).
``outputs=["a", "b"]`` declares named output ports (the function returns ``{"a": Table, …}``,
selected downstream via ``step.output("a")``). ``graph_outputs={"n_rows": int}`` declares
read-only scalars set via ``ctx.set_output(...)``. A ``src: Source`` parameter injects a reader;
``source_kinds=("file", "sql", …)`` narrows the source picker to those kinds.
``overrides="pkg.node"`` makes this a drop-in variant of another package's node (``override_mode``
``"replace"`` = win the identity by default; ``"coexist"`` = both stay available).
``addable=False`` keeps an internal node registered for restore/run while omitting it from
shared Add Step catalogs.
lsdtools.Tool.source#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:949.
source(self, kind: str, *, label: str='', config: Any=None)
config: Any
kind: str
label: str
self: (unannotated)
Source docstring:
Register a custom source kind on ``read(cfg)``::
@tool.source("rest-api", config={"url": param(str), "token": param(str, widget="password")})
def read_rest(cfg): ... # cfg is {"url": ..., "token": ...}
``config`` is a ``{name: param(...)}`` mapping (or a ``Configurable`` subclass); its field
values are passed to the function as a dict, and it returns a ``Table``. The kind then appears
in every source picker (and a load can offer it via ``source_kinds=(...)``).
lsdtools.Tool.shape#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:964.
shape(self, fn: Optional[Callable]=None, *, outputs: Optional[List[str]]=None, graph_outputs: Optional[dict]=None, overrides: Optional[str]=None, override_mode: str='replace', addable: bool=True)
addable: bool
fn: Optional[Callable]
graph_outputs: Optional[dict]
outputs: Optional[List[str]]
override_mode: str
overrides: Optional[str]
self: (unannotated)
Source docstring:
Declare a transform step (one or more ``Table`` input ports → a ``Table`` or named outputs).
``overrides="pkg.node"`` makes this a drop-in variant of another package's node
(``override_mode`` ``"replace"`` wins the identity by default; ``"coexist"`` keeps both).
``addable=False`` keeps an internal node registered for restore/run while omitting it from
shared Add Step catalogs.
lsdtools.Tool.deliver#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:980.
deliver(self, fn: Optional[Callable]=None, *, outputs: Optional[List[str]]=None, graph_outputs: Optional[dict]=None, overrides: Optional[str]=None, override_mode: str='replace', addable: bool=True, capabilities: tuple[str, ...]=())
addable: bool
capabilities: tuple[str, ...]
fn: Optional[Callable]
graph_outputs: Optional[dict]
outputs: Optional[List[str]]
override_mode: str
overrides: Optional[str]
self: (unannotated)
Source docstring:
Declare a delivery/export step (a ``Table`` input port → a side effect or artifact).
A deliver may return a :class:`~lsd.flow.payload.FileSetPayload` to content-hash and
cache-track exported files/directories. It may instead return a
:class:`~lsd.flow.payload.ViewerPayload` to SHOW a result: the framework persists it (a
``*_payload.json`` sidecar) and emits it to whatever view
:meth:`~lsd.core.view.View.watch`\es the entity. The three viewer built-ins are
``LayerPayload`` (3-D geometry), ``ChartPayload`` (a chart), and ``LegendPayload`` (a
legend); an untracked side-effect deliver returns nothing.
``overrides="pkg.node"`` makes this a drop-in variant of another package's node.
``addable=False`` keeps an internal node registered for restore/run while omitting it from
shared Add Step catalogs.
lsdtools.Tool.system#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1003.
system(self, fn: Optional[Callable]=None, *, reads: 'tuple | list | str'=(), writes: 'tuple | list | str'=(), creates: 'tuple | list'=(), inplace: bool=False, chunk_rows: int=65536, parallel: str='none', addable: bool=True)
addable: bool
chunk_rows: int
creates: 'tuple | list'
fn: Optional[Callable]
inplace: bool
parallel: str
reads: 'tuple | list | str'
self: (unannotated)
writes: 'tuple | list | str'
Source docstring:
Declare a high-performance **Trip system** (``lsd.trip``): the advanced tier.
A system transforms declared components of an in-memory Trip with no parquet between
systems. The first parameter is the surface::
@tool.system(reads=("x", "vx"), writes=("x",), parallel="threads")
def integrate(c: Chunk, dt: float = 0.1) -> None:
c.out["x"][:] = c["x"] + dt * c["vx"] # a chunk kernel, run chunk-parallel
@tool.system(reads=("x",), writes=("x",))
def clamp(view: TripView) -> None: # a whole-Trip system
view.out("x")[:] = view["x"].clip(0.0, 1.0)
``reads``/``writes`` name existing components; ``creates`` declares new ones (each a
:class:`Component`, e.g. a float32 render mirror); ``inplace=True`` writes the Trip's own
buffer. Wire it into an entity between the two bridge steps — ``ToMemory`` after a
``@tool.load``, then any number of systems, then ``ToDisk`` (or a ``@tool.deliver`` that
takes a ``Trip`` parameter, which reads it straight from memory and never writes it).
``parallel`` defaults to ``"none"`` **on purpose**. A streaming kernel (the common ECS
shape: read a couple of components, write one) is memory-bandwidth bound, and one core
already saturates most of the bus -- measured, threads make it *2.4x slower*. Pass
``parallel="threads"`` only when the kernel does heavy arithmetic per byte (transcendental
or iterative math), where it measures ~2.9x faster. See ``lsd.trip.scheduler`` for the
numbers and ``benchmarks/trip_v1.py`` to re-measure on your machine.
lsdtools.Tool.group#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1066.
group(self, *members: Any, name: str='system_group', label: Optional[str]=None, addable: bool=True)
addable: bool
label: Optional[str]
members: Any
name: str
self: (unannotated)
Source docstring:
Compose member systems into one :class:`SystemGroupStep` (DOTS' SystemGroup).
``physics = tool.group(integrate, mirror)`` builds a step that runs ``integrate`` then
``mirror`` once per ``tick`` over one Trip. The members are ``@tool.system`` factories.
EXPERIMENTAL, and not part of the published Trip surface: nothing in the product
authors a group yet, so this verb and :class:`SystemGroupStep` (its only constructor)
are unreleased. It is deliberately absent from ``lsd``'s and ``lsdtools``' exports —
the live-preview path (``preview_every``) in particular has never had a subscriber.
Treat the shape as provisional until a Trip lane adopts it.
lsdtools.Tool.entity#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1100.
entity(self, target: Any=None, *, label: Optional[str]=None, icon: str='lsd-folder-symbolic')
icon: str
label: Optional[str]
self: (unannotated)
target: Any
Source docstring:
Declare a creatable entity type.
On a **builder function** ``def drillholes(collar: str, survey: str) -> <terminal step>`` the
signature becomes the entity's declarative parameters; the body runs once at creation to wire
the child steps. On a **hand-written ``Entity`` subclass** it just registers the type
(attribution + wizard interop), returning it unchanged.
lsdtools.Tool.command#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1126.
command(self, name: str, *, help: str='')
help: str
name: str
self: (unannotated)
Source docstring:
Declare a global ``lsd <name>`` CLI command from a typed function (zero argparse).
lsdtools.Tool.action#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1133.
action(self, route: str)
route: str
self: (unannotated)
Source docstring:
Register a semantic Tool route (``entity/<type>/<verb>`` or a private route).
The function is ``(ctx: Context, **values)`` and is reachable through
:meth:`dispatch`. A :class:`TreeCommandSpec` may bind the route into an
entity-tree surface; compact app-logo commands use :meth:`menu_item`, and
wire actions use ``lsd_actions``.
lsdtools.Tool.template#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1147.
template(self, template_id: str, *, label: str, extensions: tuple, roles: Any=(), params: Optional[type]=None, preview: str='auto', priority: int=0, icon: Optional[str]=None, sniff: Optional[Callable]=None, present_in: Optional[str]=None, present_command: Optional[str]=None)
extensions: tuple
icon: Optional[str]
label: str
params: Optional[type]
present_command: Optional[str]
present_in: Optional[str]
preview: str
priority: int
roles: Any
self: (unannotated)
sniff: Optional[Callable]
template_id: str
Source docstring:
Declare a data-import template: dropped file(s) → a pre-wired entity (the wizard's unit).
The build function is ``(ctx: Context, files, name=None) -> Entity`` — ``files["role"]`` /
``files.main`` are the dropped files; typically it calls an ``@tool.entity`` factory's
``.build(...)``. ``roles=[FileRole(...)]`` declares the data slots (columns the wizard maps).
``present_in`` optionally names a stable main-view kind for best-effort Desktop presentation
after commit; it has no effect on headless imports and never activates that view's package.
``present_command`` optionally names a command action owned by that view. Desktop invokes it
once, after the imported entity's first geometry layer is present in the exact bound view.
lsdtools.Tool.viewer_extension#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1172.
viewer_extension(self, spec: ViewerExtensionSpec) -> ViewerExtensionSpec
self: (unannotated)
spec: ViewerExtensionSpec
Source docstring:
Contribute one frozen viewer-extension contract.
This is intentionally a direct declaration rather than a decorator:
factories and handlers belong inside ``spec``, and the qualified ids make
its package ownership explicit. :meth:`mount` validates that ownership
against the package manifest before anything reaches the live registry.
lsdtools.Tool.dataset_editor#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1190.
dataset_editor(self, spec: DatasetEditorSpec) -> DatasetEditorSpec
self: (unannotated)
spec: DatasetEditorSpec
Source docstring:
Contribute one frozen, callback-free dataset editor contract.
Packages declare entity/output identity, typed columns, stable keys,
and an adapter operation. Desktop and data views own the editing
runtime; this Tool only mounts the declaration into the project-scoped
contribution catalog.
lsdtools.Tool.object_type#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1208.
object_type(self, spec: ObjectTypeSpec) -> ObjectTypeSpec
self: (unannotated)
spec: ObjectTypeSpec
Source docstring:
Contribute one canonical, renderer-neutral selected-object type.
lsdtools.Tool.object_property_section#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1221.
object_property_section(self, spec: ObjectPropertySectionSpec) -> ObjectPropertySectionSpec
self: (unannotated)
spec: ObjectPropertySectionSpec
Source docstring:
Contribute one callback-free section to an exact object type.
The target object type may be owned by a dependency. The section id
itself must belong to this Tool's mounting package, which is validated
by :meth:`mount`.
lsdtools.Tool.object_explorer#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1242.
object_explorer(self, spec: ObjectExplorerSpec) -> ObjectExplorerSpec
self: (unannotated)
spec: ObjectExplorerSpec
Source docstring:
Contribute one callback-free tab for an exact object type.
lsdtools.Tool.object_context_action#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1255.
object_context_action(self, spec: ObjectContextActionSpec) -> ObjectContextActionSpec
self: (unannotated)
spec: ObjectContextActionSpec
Source docstring:
Contribute a context placement for an exact same-package Viewer command.
The declaration remains callback-free. The active Viewer extension
plan resolves the exact command id before the Object Explorer exposes
it, so declaration order does not select a winner.
lsdtools.Tool.tree_extension#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1276.
tree_extension(self, spec: TreeExtensionSpec) -> TreeExtensionSpec
self: (unannotated)
spec: TreeExtensionSpec
Source docstring:
Contribute one frozen entity-tree extension contract.
A tree command may name an existing :meth:`action` route instead of
carrying a presentation callback. It is bound here once to the Tool's
semantic handler, leaving ``Entity`` free of UI placement metadata.
lsdtools.Tool.status_extension#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1321.
status_extension(self, spec: StatusExtensionSpec) -> StatusExtensionSpec
self: (unannotated)
spec: StatusExtensionSpec
Source docstring:
Contribute one frozen, renderer-neutral status/content contract.
lsdtools.Tool.main_view#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1333.
main_view(self, kind: str, title: Optional[str]=None, *, icon: Optional[str]=None, instance_policy: str='reusable', binding_cardinality: str='none', accepts_entity: Optional[Callable[[Any], bool]]=None, route_parameter: Optional[str]=None, default_open: bool=False, deliver_entity: Optional[Callable[..., Any]]=None)
accepts_entity: Optional[Callable[[Any], bool]]
binding_cardinality: str
default_open: bool
deliver_entity: Optional[Callable[..., Any]]
icon: Optional[str]
instance_policy: str
kind: str
route_parameter: Optional[str]
self: (unannotated)
title: Optional[str]
Source docstring:
Contribute a main-view **kind** (an editor-area view template) → a :class:`MainViewType`.
The decorated factory is ``(host, *, entity=None, view_id: str) -> widget | View |``
``ViewPresentation`` (gui-side; it
imports GTK lazily in its body — the sanctioned escape hatch, like :meth:`contribute`). Unlike
:meth:`view`, this returns a raw toolkit widget, not a ``View`` — it is how a package registers
a whole main-view kind (a 3-D viewer, a code editor). ``ViewPresentation`` pairs a bespoke
widget with the ordinary ``View`` parameter/action model. ``instance_policy`` is ``"single"``,
``"reusable"`` (the default), or ``"per_entity"``; it is the complete identity/reuse
contract. A ``per_entity`` view may declare one required ``route_parameter``; the manager
encodes that string after the entity id and passes it to the factory by keyword.
``accepts_entity`` is the sole entity-applicability predicate and is independent
of binding cardinality. A non-``"none"`` ``binding_cardinality`` enables live-binding drops;
``deliver_entity=(widget, entity) -> None`` is the mutually exclusive one-shot drop hook for
cardinality-``"none"`` views. ``default_open`` is the only activation-time opening signal.
Active non-``"per_entity"`` kinds appear as plain Activity Bar **Add View** commands;
repeated additions allocate fresh instances only when the declared policy is ``"reusable"``.
lsdtools.Tool.sidebar_view#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1371.
sidebar_view(self, view_id: str, title: Optional[str]=None, *, icon: Optional[str]=None, position: int=0, primary: bool=False, default_open: bool=True, side: str='left', accepts_entity: Optional[Callable[[Any], bool]]=None, deliver_entity: Optional[Callable[..., Any]]=None)
accepts_entity: Optional[Callable[[Any], bool]]
default_open: bool
deliver_entity: Optional[Callable[..., Any]]
icon: Optional[str]
position: int
primary: bool
self: (unannotated)
side: str
title: Optional[str]
view_id: str
Source docstring:
Contribute a docked **sidebar view** (RFC-0002) → a :class:`SidebarViewContribution`.
The decorated factory is ``(host) -> widget | View | ViewPresentation`` (gui-side; imports
GTK lazily in its body — the
sanctioned escape hatch, like :meth:`contribute`). Sidebar views always belong to the
shell sidebar; ``side`` selects its initial ``"left"`` or ``"right"`` dock and
``position`` orders sections on that side. Every active declaration is a plain
command in the Activity Bar's right-click **Add View** catalog independently of attachment;
invoking it reopens/focuses the exact singleton section and never shows checked state.
Supplying ``deliver_entity(target, entity)`` makes the exact sidebar id a tree-selection
route; ``accepts_entity`` optionally filters which entities it receives.
lsdtools.Tool.menu_item#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1402.
menu_item(self, command_id: str, label: Optional[str]=None, *, menu: str, section: str='', order: int=0, icon: Optional[str]=None, accelerator: Optional[str]=None)
accelerator: Optional[str]
command_id: str
icon: Optional[str]
label: Optional[str]
menu: str
order: int
section: str
self: (unannotated)
Source docstring:
Contribute a stable **app-logo command** → a :class:`MenuItem`.
The decorated callback is invoked when the item fires; it may take a ``Context`` (built from
the host) or no argument. ``command_id`` is package-local semantic identity; labels and menu
placement may change without retargeting the command. ``menu`` names a group inside
Desktop's compact contribution-only app-logo popover; ``section``/``order`` place it within
that group and ``accelerator`` binds a key. Empty groups are absent, so this decorator never
creates a classic menu bar or permanent command skeleton. The shell-owned Settings gear is
the package-management bootstrap and is intentionally not a contribution.
lsdtools.Tool.contribute#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1443.
contribute(self, *items: Any) -> 'Tool'
items: Any
self: (unannotated)
Source docstring:
Register hand-built contribution objects the declarative API can't express — the escape
hatch for a custom main/sidebar declaration. Flushed and attributed at :meth:`mount`.
lsdtools.Tool.view#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1450.
view(self, view_id: str, title: Optional[str]=None, *, location: str='editor', icon: Optional[str]=None, instance_policy: str='single', binding_cardinality: str='none', accepts_entity: Optional[Callable[[Any], bool]]=None, default_open: bool=False)
accepts_entity: Optional[Callable[[Any], bool]]
binding_cardinality: str
default_open: bool
icon: Optional[str]
instance_policy: str
location: str
self: (unannotated)
title: Optional[str]
view_id: str
Source docstring:
Contribute a **view**: the decorated factory is ``(ctx)`` or ``(ctx, entity=None) -> View``.
A View is a params-and-actions **panel** or a **data view** (``views.table`` / ``chart`` /
``flowchart`` or a custom ``View`` subclass). ``location`` places it in the desktop shell:
``"editor"`` (a tab) or ``"sidebar"`` (docked). Content inside a viewer is declared through
:meth:`viewer_extension` with ``ViewerExtensionSpec.surfaces``. The front-end resolves the
GTK shell (a data view's ``gtk`` module) or the generic form (a panel); a headless host uses
``to_text()`` / ``to_image()``. Editor views become ``MainViewType`` declarations and use the
same explicit ``instance_policy`` and entity-acceptance/binding contract. ``default_open`` is
the only activation-time opening signal for an editor view. Sidebar views are one docked
surface and cannot use entity acceptance or bindings.
lsdtools.Tool.mount#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1498.
mount(self, host: Any=None, *, package: Optional[str]=None) -> list
host: Any
package: Optional[str]
self: (unannotated)
Source docstring:
Register this Tool's declared surfaces into the host catalog.
Each contribution is attributed to *package* (default ``self.name``) so
``remove_package(...)`` cleanly unmounts it — the loader passes the manifest's package id.
Steps/entities are already registered at decoration time. Runtime callbacks capture this
mount's host; the Tool itself remains a host-neutral declaration catalog.
lsdtools.Tool.dispatch#
Kind: method. Source: core/lsd/src/lsd/tools/tool.py:1666.
dispatch(self, route: str, ctx: Any=None, **values: Any) -> Any
ctx: Any
route: str
self: (unannotated)
values: Any
Source docstring:
Invoke an action with an explicit Context, or headlessly when none is supplied.
lsdtools.Tool.name#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:830.
name: (unannotated)
name = str(name)
lsdtools.Tool.label#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:831.
label: (unannotated)
label = label or self.name
lsdtools.Tool.factories#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:832.
factories: List[_StepFactory]
factories = []
lsdtools.Tool.commands#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:834.
commands: List[dict]
commands = []
lsdtools.Tool.templates#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:835.
templates: List[dict]
templates = []
lsdtools.Tool.views#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:836.
views: List[dict]
views = []
lsdtools.Tool.dataset_editors#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:837.
dataset_editors: List[DatasetEditorSpec]
dataset_editors = []
lsdtools.Tool.object_types#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:838.
object_types: List[ObjectTypeSpec]
object_types = []
lsdtools.Tool.object_property_sections#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:839.
object_property_sections: List[ObjectPropertySectionSpec]
object_property_sections = []
lsdtools.Tool.object_explorers#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:840.
object_explorers: List[ObjectExplorerSpec]
object_explorers = []
lsdtools.Tool.object_context_actions#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:841.
object_context_actions: List[ObjectContextActionSpec]
object_context_actions = []
lsdtools.Tool.viewer_extensions#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:842.
viewer_extensions: List[ViewerExtensionSpec]
viewer_extensions = []
lsdtools.Tool.tree_extensions#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:843.
tree_extensions: List[TreeExtensionSpec]
tree_extensions = []
lsdtools.Tool.status_extensions#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:844.
status_extensions: List[StatusExtensionSpec]
status_extensions = []
lsdtools.Tool.main_views#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:845.
main_views: List[dict]
main_views = []
lsdtools.Tool.sidebar_views#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:846.
sidebar_views: List[dict]
sidebar_views = []
lsdtools.Tool.menu_items#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:847.
menu_items: List[dict]
menu_items = []
lsdtools.Tool.raw_contributions#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:848.
raw_contributions: List[Any]
raw_contributions = []
lsdtools.Tool.routes#
Kind: attribute. Source: core/lsd/src/lsd/tools/tool.py:849.
routes: Dict[str, _HandlerSpec]
routes = {}
lsdtools.Trip#
Kind: class. Source: core/lsd/src/lsd/trip/model.py:468.
Trip(self, table: Any, components: Sequence[Component], *, trip_id: str, versions: Mapping[str, int], layout: int, origin: Optional[str], next_eid: int, attrs: Mapping[str, Any], mirrors: Mapping[str, Mapping[str, int]], owned: Mapping[str, Any], lineage: _Lineage) -> None
Source docstring:
One immutable value of a Trip: a single-chunk table plus versions, identity, and lineage.
Build one with :meth:`from_table` (the bridge from a step's table), :meth:`build` (from numpy
arrays -- the fast path for a loader or a test), or :func:`lsd.trip.snapshot.read_snapshot`.
Transform it through a :class:`lsd.trip.view.TripView`, whose ``commit`` returns the next
value. Values sharing a lineage share the staging pool, attachments, and component homes.
Implementation alias: lsd.trip.model.Trip.
lsdtools.Trip.__init__#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:482.
__init__(self, table: Any, components: Sequence[Component], *, trip_id: str, versions: Mapping[str, int], layout: int, origin: Optional[str], next_eid: int, attrs: Mapping[str, Any], mirrors: Mapping[str, Mapping[str, int]], owned: Mapping[str, Any], lineage: _Lineage) -> None
attrs: Mapping[str, Any]
components: Sequence[Component]
layout: int
lineage: _Lineage
mirrors: Mapping[str, Mapping[str, int]]
next_eid: int
origin: Optional[str]
owned: Mapping[str, Any]
self: (unannotated)
table: Any
trip_id: str
versions: Mapping[str, int]
lsdtools.Trip.from_table#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:508.
from_table(cls, table: Any, *, id_column: Optional[str]=None, components: Optional[Sequence[str]]=None, fill: Optional[Mapping[str, Any]]=None, trip_id: Optional[str]=None, coordinate: Optional[Tuple[str, str]]=None, declared: Optional[Sequence[Component]]=None) -> 'Trip'
cls: (unannotated)
components: Optional[Sequence[str]]
coordinate: Optional[Tuple[str, str]]
declared: Optional[Sequence[Component]]
fill: Optional[Mapping[str, Any]]
id_column: Optional[str]
table: Any
trip_id: Optional[str]
Source docstring:
Bridge a table into a Trip (the ``ToMemory`` step's core).
``id_column`` names an integer column to become ``eid`` (must be unique); otherwise
``eid`` is the row index. ``components`` selects columns (default: all). ``fill`` maps a
column name to the value that replaces its nulls; a column with nulls and no fill is
refused. Field identities are reused from the table's profile stamp when present and
minted at ``coordinate`` (``(entity_id, step_id)``) otherwise. ``declared`` lets the
caller fix ``frozen``/``mirror_of`` on known components.
lsdtools.Trip.build#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:600.
build(cls, columns: Mapping[str, Any], *, components: Optional[Sequence[Component]]=None, eid: Optional[Any]=None, trip_id: Optional[str]=None, coordinate: Optional[Tuple[str, str]]=None, attrs: Optional[Mapping[str, Any]]=None) -> 'Trip'
attrs: Optional[Mapping[str, Any]]
cls: (unannotated)
columns: Mapping[str, Any]
components: Optional[Sequence[Component]]
coordinate: Optional[Tuple[str, str]]
eid: Optional[Any]
trip_id: Optional[str]
Source docstring:
Build a Trip from numpy arrays (owned, writable buffers -- the zero-copy fast path).
Each numeric array becomes a component whose buffer the Trip owns, so in-place systems
may write it without a copy. ``components`` declares dtypes/shapes/flags explicitly;
otherwise they are inferred from the arrays. Strings/categoricals are accepted as Arrow
arrays or Python lists.
lsdtools.Trip.trip_id#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:696.
trip_id(self) -> str
self: (unannotated)
lsdtools.Trip.layout#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:700.
layout(self) -> int
self: (unannotated)
lsdtools.Trip.versions#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:704.
versions(self) -> Mapping[str, int]
self: (unannotated)
lsdtools.Trip.version_key#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:708.
version_key(self) -> str
self: (unannotated)
lsdtools.Trip.handle#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:712.
handle(self) -> str
self: (unannotated)
lsdtools.Trip.origin#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:716.
origin(self) -> Optional[str]
self: (unannotated)
Source docstring:
The snapshot id of the table this Trip was bridged from, if it had one.
lsdtools.Trip.next_eid#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:721.
next_eid(self) -> int
self: (unannotated)
lsdtools.Trip.attrs#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:725.
attrs(self) -> Mapping[str, Any]
self: (unannotated)
Source docstring:
Small JSON-safe values that travel with the Trip (a render origin, a frame id).
lsdtools.Trip.components#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:730.
components(self) -> Mapping[str, Component]
self: (unannotated)
lsdtools.Trip.names#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:734.
names(self) -> Tuple[str, ...]
self: (unannotated)
lsdtools.Trip.num_rows#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:738.
num_rows(self) -> int
self: (unannotated)
lsdtools.Trip.arrow#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:745.
arrow(self) -> 'pa.Table'
self: (unannotated)
Source docstring:
The underlying single-chunk ``pa.Table`` (read-only by convention).
Vector components are ``fixed_size_list`` columns here; use :meth:`to_table` for a flat
scalar table a profiler or an ordinary table consumer can read.
lsdtools.Trip.to_table#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:753.
to_table(self, columns: Optional[Sequence[str]]=None) -> 'pa.Table'
columns: Optional[Sequence[str]]
self: (unannotated)
Source docstring:
A flat ``pa.Table`` with vector components split into scalar columns (``name.0`` ...).
``eid`` is always included. This is the table form a Trip presents when it leaves the
tier (``ToDisk``) or is inspected -- the profile layer measures scalars.
lsdtools.Trip.nbytes#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:784.
nbytes(self) -> int
self: (unannotated)
lsdtools.Trip.lineage#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:788.
lineage(self) -> _Lineage
self: (unannotated)
lsdtools.Trip.record#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:791.
record(self, *, snapshot: Optional[str]=None, snapshot_id: Optional[str]=None) -> TripRecord
self: (unannotated)
snapshot: Optional[str]
snapshot_id: Optional[str]
lsdtools.Trip.component#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:802.
component(self, name: str) -> Component
name: str
self: (unannotated)
lsdtools.Trip.column#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:808.
column(self, name: str) -> 'pa.Array'
name: str
self: (unannotated)
Source docstring:
The single Arrow chunk of one component.
lsdtools.Trip.numpy#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:813.
numpy(self, name: str) -> 'np.ndarray'
name: str
self: (unannotated)
Source docstring:
A read-only, zero-copy numpy view of one numeric component (``(n,)`` or ``(n, k)``).
lsdtools.Trip.eid#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:831.
eid(self) -> 'np.ndarray'
self: (unannotated)
lsdtools.Trip.owns#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:834.
owns(self, name: str) -> bool
name: str
self: (unannotated)
Source docstring:
Whether this value holds a writable buffer for *name* (in-place writes are legal).
lsdtools.Trip.mirrored_versions#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:838.
mirrored_versions(self, name: str) -> Mapping[str, int]
name: str
self: (unannotated)
lsdtools.Trip.mirror_is_current#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:841.
mirror_is_current(self, name: str) -> bool
name: str
self: (unannotated)
Source docstring:
Whether a mirror component still reflects the versions of the components it mirrors.
lsdtools.Trip.home#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:853.
home(self, name: str) -> str
name: str
self: (unannotated)
Source docstring:
Where the authoritative copy of a component lives: ``"host"`` or a device name.
lsdtools.Trip.set_home#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:858.
set_home(self, name: str, where: str) -> None
name: str
self: (unannotated)
where: str
lsdtools.Trip.attach#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:862.
attach(self, key: str, value: Any) -> Any
key: str
self: (unannotated)
value: Any
Source docstring:
Attach an opaque object to the Trip's lineage (a device session); closed with it.
lsdtools.Trip.attachment#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:868.
attachment(self, key: str, factory: Any=None) -> Any
factory: Any
key: str
self: (unannotated)
lsdtools.Trip.close#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:878.
close(self) -> None
self: (unannotated)
Source docstring:
Close every attachment that has a ``close()``; the values themselves stay readable.
lsdtools.Trip.with_attrs#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:909.
with_attrs(self, **attrs: Any) -> 'Trip'
attrs: Any
self: (unannotated)
Source docstring:
A new value with these attrs set (JSON-safe values only); versions are untouched.
lsdtools.Trip.append#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:1003.
append(self, columns: Mapping[str, Any]) -> 'Trip'
columns: Mapping[str, Any]
self: (unannotated)
Source docstring:
A new value with rows appended (fresh eids); bumps ``layout`` and every version.
Every non-``eid`` component must be supplied with the same number of rows. Vector
components take ``(m, k)`` arrays. This copies every component once; it is the rare
structural operation, not a per-tick one.
lsdtools.Trip.compact#
Kind: method. Source: core/lsd/src/lsd/trip/model.py:1062.
compact(self, alive: str='alive') -> 'Trip'
alive: str
self: (unannotated)
Source docstring:
A new value without the rows whose *alive* component is zero; bumps ``layout``.
lsdtools.TripView#
Kind: class. Source: core/lsd/src/lsd/trip/view.py:139.
TripView(self, trip: Trip, *, reads: Any=(), writes: Any=(), creates: Any=(), inplace: bool=False, chunk_rows: int=DEFAULT_CHUNK_ROWS, coordinate: Optional[Tuple[str, str]]=None) -> None
Source docstring:
A system's declared window onto one Trip value.
``reads``/``writes`` name existing components; ``creates`` declares new ones. Reads and
writes overlap freely (a system that integrates ``x`` reads it too). ``eid`` is always
readable, never writable; frozen components are never writable. Every array the view returns
is a zero-copy view of the Trip's buffers or of a pooled staging buffer.
Implementation alias: lsd.trip.view.TripView.
lsdtools.TripView.__init__#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:148.
__init__(self, trip: Trip, *, reads: Any=(), writes: Any=(), creates: Any=(), inplace: bool=False, chunk_rows: int=DEFAULT_CHUNK_ROWS, coordinate: Optional[Tuple[str, str]]=None) -> None
chunk_rows: int
coordinate: Optional[Tuple[str, str]]
creates: Any
inplace: bool
reads: Any
self: (unannotated)
trip: Trip
writes: Any
lsdtools.TripView.trip#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:213.
trip(self) -> Trip
self: (unannotated)
lsdtools.TripView.count#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:217.
count(self) -> int
self: (unannotated)
lsdtools.TripView.reads#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:221.
reads(self) -> frozenset
self: (unannotated)
lsdtools.TripView.writes#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:225.
writes(self) -> Tuple[str, ...]
self: (unannotated)
lsdtools.TripView.creates#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:229.
creates(self) -> Tuple[Component, ...]
self: (unannotated)
lsdtools.TripView.inplace#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:233.
inplace(self) -> bool
self: (unannotated)
lsdtools.TripView.chunk_rows#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:237.
chunk_rows(self) -> int
self: (unannotated)
lsdtools.TripView.eid#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:241.
eid(self) -> 'np.ndarray'
self: (unannotated)
lsdtools.TripView.__getitem__#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:244.
__getitem__(self, name: str) -> Any
name: str
self: (unannotated)
Source docstring:
A read-only view of a declared read or write (``pa.Array`` for non-numeric).
lsdtools.TripView.out#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:255.
out(self, name: str) -> 'np.ndarray'
name: str
self: (unannotated)
Source docstring:
The writable array for a declared write (staging, or live when in place) or create.
lsdtools.TripView.stage_all#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:279.
stage_all(self) -> None
self: (unannotated)
Source docstring:
Acquire every declared write/create buffer now (before chunk threads start).
lsdtools.TripView.chunk_bounds#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:312.
chunk_bounds(self, rows: Optional[int]=None) -> List[Tuple[int, int]]
rows: Optional[int]
self: (unannotated)
lsdtools.TripView.chunks#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:319.
chunks(self, rows: Optional[int]=None) -> Iterator[Chunk]
rows: Optional[int]
self: (unannotated)
lsdtools.TripView.reductions#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:327.
reductions(self, key: str) -> List[Any]
key: str
self: (unannotated)
Source docstring:
Every partial recorded under *key*, in chunk order (a fixed reduction order).
lsdtools.TripView.commit#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:335.
commit(self) -> Trip
self: (unannotated)
Source docstring:
Fold the staged arrays into the next Trip value; a view commits exactly once.
lsdtools.ValidationError#
Kind: class. Source: core/lsd/src/lsd/core/configurable.py:191.
Implementation alias: lsd.core.configurable.ValidationError.
lsdtools.ValidationError.parameter#
Kind: attribute. Source: core/lsd/src/lsd/core/configurable.py:192.
parameter: str
lsdtools.ValidationError.message#
Kind: attribute. Source: core/lsd/src/lsd/core/configurable.py:193.
message: str
lsdtools.ValidationError.value#
Kind: attribute. Source: core/lsd/src/lsd/core/configurable.py:194.
value: Any
lsdtools.VariableConcept#
Kind: class. Source: core/lsd/src/lsd/project_semantics.py:145.
Source docstring:
One stable project meaning, independent of any physical Arrow column.
Implementation alias: lsd.project_semantics.VariableConcept.
lsdtools.VariableConcept.id#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:148.
id: str
lsdtools.VariableConcept.label#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:149.
label: str
lsdtools.VariableConcept.kind#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:150.
kind: str
lsdtools.VariableConcept.unit#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:151.
unit: str | None
unit = None
lsdtools.VariableConcept.description#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:152.
description: str
description = ''
lsdtools.VariableConcept.version#
Kind: attribute. Source: core/lsd/src/lsd/project_semantics.py:153.
version: int
version = 1
lsdtools.VariableConcept.from_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:166.
from_dict(cls, data: Mapping[str, Any]) -> 'VariableConcept'
cls: (unannotated)
data: Mapping[str, Any]
lsdtools.VariableConcept.to_dict#
Kind: method. Source: core/lsd/src/lsd/project_semantics.py:177.
to_dict(self) -> dict[str, Any]
self: (unannotated)
lsdtools.View#
Kind: class. Source: core/lsd/src/lsd/core/view.py:449.
View(self, *, name: str='', icon: Optional[str]=None, **config: Any) -> None
Source docstring:
A presentable surface: ``param()`` fields + ``@action`` operations + optional data.
Subclass it for a **panel** (params + actions). Set a ``kind`` and override ``feed`` /
``to_text`` / ``to_image`` for a **data view** (table / chart / flowchart / custom).
Implementation alias: lsd.core.view.View.
Declared bases: Configurable.
lsdtools.View.kind#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:455.
kind: ClassVar[str]
kind = ''
lsdtools.View.ctx#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:461.
ctx: ClassVar[Any]
ctx = None
lsdtools.View.title#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:463.
title = param(str, default='', label='Title')
lsdtools.View.location#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:464.
location = param(str, default='editor', choices=['editor', 'sidebar'], label='Location', visibility='hidden')
lsdtools.View.__init__#
Kind: method. Source: core/lsd/src/lsd/core/view.py:485.
__init__(self, *, name: str='', icon: Optional[str]=None, **config: Any) -> None
config: Any
icon: Optional[str]
name: str
self: (unannotated)
lsdtools.View.engine#
Kind: method. Source: core/lsd/src/lsd/core/view.py:506.
engine(self) -> Any
self: (unannotated)
Source docstring:
The :class:`~lsd.runtime.engine.Engine` this view is attached to (``engine.add(view)``),
or ``None`` — the symmetry partner of :attr:`Entity.engine`.
lsdtools.View.watch#
Kind: method. Source: core/lsd/src/lsd/core/view.py:512.
watch(self, *targets: Any) -> 'View'
self: (unannotated)
targets: Any
Source docstring:
Hold the output of each :class:`~lsd.tree.entity.Entity` in *targets*, and refresh on re-run.
Each target is an ``Entity``, a stable entity id, or an unambiguous display name (sugar).
Returns ``self``, so
``views.table().watch(assays)`` reads as one phrase. **Any order works**:
* *add-then-watch*, *watch-then-add* (view or entity first) — all equivalent;
* a missing string reference is kept **pending** and resolves when that entity is added;
* **auto-pull** — watching an entity that has *already* run delivers its output immediately,
which is what makes drag-and-drop and reopened projects feel instant.
Watches are stored by entity **id**, so they survive a rename and a project reload; removal
from the Workspace auto-unwatches them. Delivery goes through :meth:`on_output` (default:
``feed(output)``) on ``engine/entity/finished`` with ``ok=True``.
lsdtools.View.watch_output#
Kind: method. Source: core/lsd/src/lsd/core/view.py:551.
watch_output(self, *references: OutputRef) -> 'View'
references: OutputRef
self: (unannotated)
Source docstring:
Watch exact named step outputs and refresh them after successful runs.
Each reference contains only stable ``entity_id`` + ``step_id`` +
declared ``output_port`` coordinates. A structurally valid reference
may be registered before its entity is attached; once the entity is
present, a missing step or undeclared port is rejected and never falls
back to :attr:`Entity.output`.
lsdtools.View.unwatch_output#
Kind: method. Source: core/lsd/src/lsd/core/view.py:629.
unwatch_output(self, *references: OutputRef) -> 'View'
references: OutputRef
self: (unannotated)
Source docstring:
Stop watching exact output references; unknown references are ignored.
lsdtools.View.unwatch#
Kind: method. Source: core/lsd/src/lsd/core/view.py:637.
unwatch(self, *targets: Any) -> 'View'
self: (unannotated)
targets: Any
Source docstring:
Stop watching each entity (or entity name) in *targets*. Unknown targets are ignored.
Already-delivered data stays — unwatching breaks the link, it does not clear the view.
lsdtools.View.watched#
Kind: method. Source: core/lsd/src/lsd/core/view.py:660.
watched(self) -> List[str]
self: (unannotated)
Source docstring:
The names of the entities this view watches — live (a renamed entity reports its new name),
plus any names still pending an entity. Watch order is preserved.
lsdtools.View.watched_outputs#
Kind: method. Source: core/lsd/src/lsd/core/view.py:671.
watched_outputs(self) -> List[OutputRef]
self: (unannotated)
Source docstring:
Exact output references in watch order (a detached copy).
lsdtools.View.on_output#
Kind: method. Source: core/lsd/src/lsd/core/view.py:675.
on_output(self, entity: Any, output: Any) -> None
entity: Any
output: Any
self: (unannotated)
Source docstring:
Called with a watched *entity*'s fresh output. The default hands it to :meth:`feed`.
Override for a view that watches several entities at once (e.g. a 3-D viewer keying layers by
``entity.id``), where last-write-wins ``feed`` is not what you want.
lsdtools.View.on_output_ref#
Kind: method. Source: core/lsd/src/lsd/core/view.py:682.
on_output_ref(self, entity: Any, reference: OutputRef, output: Any) -> None
entity: Any
output: Any
reference: OutputRef
self: (unannotated)
Source docstring:
Receive one exact named output; defaults to :meth:`on_output`.
Multi-output views may override this method to retain ``reference`` as
the semantic key while legacy views continue to override ``on_output``.
lsdtools.View.get_actions#
Kind: method. Source: core/lsd/src/lsd/core/view.py:988.
get_actions(self) -> List[ActionInfo]
self: (unannotated)
Source docstring:
Snapshot of all actions, in declaration order — for a renderer / CLI to build controls.
lsdtools.View.set_action_input_initial#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1013.
set_action_input_initial(self, name: str, value: Mapping[str, Any] | None) -> None
name: str
self: (unannotated)
value: Mapping[str, Any] | None
Source docstring:
Replace one complete action-form snapshot, or make that form unavailable.
This is runtime presentation state, never persisted View configuration. A caller must
supply every declared field, including hidden versions and optimistic fences. Removing a
snapshot disables the form; it never turns an input action into a zero-input command.
lsdtools.View.set_action_input_initials#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1037.
set_action_input_initials(self, values: Mapping[str, Mapping[str, Any]]) -> None
self: (unannotated)
values: Mapping[str, Mapping[str, Any]]
Source docstring:
Atomically replace every currently available typed-action form snapshot.
lsdtools.View.invoke#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1064.
invoke(self, name: str, *, input: Any=_NO_ACTION_INPUT) -> Any
input: Any
name: str
self: (unannotated)
Source docstring:
Run an action by name and return its result. The single dispatch entry for every
front-end. Emits ``view/action/invoked``. Unknown name → ``AttributeError``; a disabled
action is a logged no-op.
lsdtools.View.feed#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1096.
feed(self, data: Any) -> 'View'
data: Any
self: (unannotated)
Source docstring:
Give the view its data (a Table, a payload dict, a graph…). Data views store it and call
:meth:`_data_changed`; a params-and-actions panel has no data, so the base raises.
lsdtools.View.on_view_event#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1119.
on_view_event(self, event: str, cb: Callable[..., None]) -> None
cb: Callable[..., None]
event: str
self: (unannotated)
lsdtools.View.off_view_event#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1122.
off_view_event(self, event: str, cb: Callable[..., None]) -> None
cb: Callable[..., None]
event: str
self: (unannotated)
lsdtools.View.emit_view_event#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1127.
emit_view_event(self, event: str, **data: Any) -> None
data: Any
event: str
self: (unannotated)
lsdtools.View.to_text#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1135.
to_text(self) -> str
self: (unannotated)
Source docstring:
A plain-text rendering (agents / CLI / logs). Data views override; the base (a panel) is a
params + actions summary.
lsdtools.View.to_image#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1148.
to_image(self, path: Optional[str]=None, *, width: int=1024, height: int=768) -> 'bytes | str'
height: int
path: Optional[str]
self: (unannotated)
width: int
Source docstring:
Render to a PNG — returns the bytes, or writes to *path* and returns it. Data views that
can draw override this (lazily importing cairo); the base signals it is unsupported.
lsdtools.View.get_state#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1155.
get_state(self) -> dict
self: (unannotated)
Source docstring:
A JSON-able snapshot: the config param values plus the ``watch`` links (data views extend
with data/selection). ``watch`` is ``{"ids": {entity id: name}, "pending": [name]}`` — ids,
so a restored view re-links to the same entities across a rename and a project reload.
lsdtools.View.apply_state#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1174.
apply_state(self, state: dict) -> None
self: (unannotated)
state: dict
lsdtools.View.show#
Kind: method. Source: core/lsd/src/lsd/core/view.py:1271.
show(self, mode: str='auto') -> Any
mode: str
self: (unannotated)
Source docstring:
Present the view. ``mode``: ``"window"`` opens a front-end window (needs a presenter),
``"text"`` prints the console rendering, ``"auto"`` (default) is a window if a presenter is
registered (a front-end is loaded), else text.
lsdtools.ViewPresentation#
Kind: class. Source: core/lsd/src/lsd/core/view.py:1287.
Source docstring:
Pair one native front-end widget with its renderer-neutral :class:`View` model.
A package sometimes needs a purpose-built GTK editor while still exposing the same typed
parameters and semantic actions as an abstract ``View``. Returning this immutable value from
a main/sidebar view factory keeps those responsibilities explicit: ``widget`` is mounted and
painted by the owning application, while ``model`` is the only capability surface read by
generic control planes. The widget is never inspected for callbacks or reverse-engineered
from pointer/pixel events.
``ViewPresentation`` is deliberately declaration-neutral. The ordinary Desktop manager and
the authority-side participant runtime normalize it through the same realization function, so
it does not create a collaboration-specific package contract.
``input_targets`` optionally names up to 256 actual native child widgets with stable ids.
The front end validates their ownership at realization and publishes their current native
bounds for input automation. This is an immutable identity declaration, not a callback or
a second UI. Hidden, insensitive, or detached targets are unavailable until they return.
Implementation alias: lsd.core.view.ViewPresentation.
lsdtools.ViewPresentation.widget#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:1307.
widget: Any
lsdtools.ViewPresentation.model#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:1308.
model: View
lsdtools.ViewPresentation.input_targets#
Kind: attribute. Source: core/lsd/src/lsd/core/view.py:1309.
input_targets: Mapping[str, Any]
input_targets = field(default_factory=dict)
lsdtools.ViewerPayload#
Kind: class. Source: core/lsd/src/lsd/flow/payload.py:385.
ViewerPayload(self, spec: Optional[Dict[str, Any]]=None, tables: Optional[Dict[str, Any]]=None) -> None
Source docstring:
A viewer artifact a deliver step returns: a JSON ``spec`` plus zero or more data ``tables``.
* ``spec`` — any JSON-serializable mapping (``kind`` / ``style`` / ``title`` / … — anything the
target viewer understands). It is persisted verbatim and carried on the emitted event under the
``"spec"`` key.
* ``tables`` — ``{name: pa.Table | InputArtifact}``; **may be empty** (a spec-only
chart/legend). Arrow tables are written to Parquet in the step's workspace. An
``InputArtifact`` aliases the exact output of a Shape/Load step in the same entity so the
viewer and downstream bound consumers share one editable materialization. The
emitted/persisted payload always carries the *paths*, not the tables/descriptors.
Subclass to define a new viewer topic (set the class attribute ``topic`` and, optionally, a
convenience constructor), then :func:`register_payload` it so generic restore can find it.
Implementation alias: lsd.flow.payload.ViewerPayload.
lsdtools.ViewerPayload.topic#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:402.
topic: str
topic = ''
lsdtools.ViewerPayload.__init__#
Kind: method. Source: core/lsd/src/lsd/flow/payload.py:404.
__init__(self, spec: Optional[Dict[str, Any]]=None, tables: Optional[Dict[str, Any]]=None) -> None
self: (unannotated)
spec: Optional[Dict[str, Any]]
tables: Optional[Dict[str, Any]]
lsdtools.ViewerPayload.payload_dict#
Kind: method. Source: core/lsd/src/lsd/flow/payload.py:414.
payload_dict(self, paths: Dict[str, str], *, entity_id: str='', step_id: str='', layer: str='', view: str='', target: str='') -> Dict[str, Any]
entity_id: str
layer: str
paths: Dict[str, str]
self: (unannotated)
step_id: str
target: str
view: str
Source docstring:
The dict that is both emitted (as event data) and persisted.
*paths* maps each ``tables`` key to the Parquet file written for it. Routing (``layer`` /
``view`` / ``target``) and the stamped ``entity_id`` / ``step_id`` are included only when
non-empty — an empty value would defeat the central ``_emit_event`` set-default backstop.
lsdtools.ViewerPayload.from_persisted#
Kind: method. Source: core/lsd/src/lsd/flow/payload.py:442.
from_persisted(cls, spec_json: Dict[str, Any]) -> 'ViewerPayload'
cls: (unannotated)
spec_json: Dict[str, Any]
Source docstring:
Rebuild a typed payload from a persisted ``*_payload.json`` dict.
``tables`` come back empty — the data lives on disk at the ``"paths"`` in the dict — so this is
for callers that want the typed object + its ``spec``; the raw persisted dict (with paths) is
what :meth:`lsd.tree.entity.Entity.viewer_payloads` yields for the front-end.
lsdtools.ViewerPayload.spec#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:406.
spec: Dict[str, Any]
spec = dict(spec or {})
lsdtools.ViewerPayload.tables#
Kind: attribute. Source: core/lsd/src/lsd/flow/payload.py:409.
tables: Dict[str, Any]
tables = {k: getattr(v, 'arrow', v) for k, v in (tables or {}).items()}
lsdtools.Writes#
Kind: class. Source: core/lsd/src/lsd/trip/view.py:52.
Writes(self, *names: str, inplace: bool=False) -> None
Source docstring:
Components a system writes; ``inplace=True`` writes the Trip's own buffer.
Implementation alias: lsd.trip.view.Writes.
lsdtools.Writes.names#
Kind: attribute. Source: core/lsd/src/lsd/trip/view.py:54.
names: Tuple[str, ...]
lsdtools.Writes.inplace#
Kind: attribute. Source: core/lsd/src/lsd/trip/view.py:55.
inplace: bool
inplace = False
lsdtools.Writes.__init__#
Kind: method. Source: core/lsd/src/lsd/trip/view.py:57.
__init__(self, *names: str, inplace: bool=False) -> None
inplace: bool
names: str
self: (unannotated)
lsdtools.action#
Kind: function. Source: core/lsd/src/lsd/core/view.py:422.
action(fn: Optional[Callable]=None, *, label: str='', icon: Optional[str]=None, style: Optional[str]=None, enabled: bool=True, description: str='', input_schema: ActionInputSchema | None=None) -> ActionDescriptor
description: str
enabled: bool
fn: Optional[Callable]
icon: Optional[str]
input_schema: ActionInputSchema | None
label: str
style: Optional[str]
Source docstring:
Declare a zero-input or typed-input action on a :class:`View`.
Bare/configured actions receive only the View. Supplying ``input_schema`` declares a form and
the handler receives ``(view, immutable_input)``. The action is unavailable until the instance
publishes a complete initial document with :meth:`View.set_action_input_initial`. ``style`` is
``None`` | ``"suggested"`` | ``"destructive"``.
Implementation alias: lsd.core.view.action.
lsdtools.apply_column_map#
Kind: function. Source: core/lsd/src/lsd/core/columnmap.py:134.
apply_column_map(table: pa.Table, resolved: Mapping[str, str], *, keep_unmapped: bool=False) -> pa.Table
keep_unmapped: bool
resolved: Mapping[str, str]
table: pa.Table
Source docstring:
Select the mapped source columns and rename them to their targets.
With *keep_unmapped*, source columns not referenced by the map are appended unchanged (after the
mapped ones), skipping any whose name would collide with a target.
Implementation alias: lsd.core.columnmap.apply_column_map.
lsdtools.autoselect_largecsv_source#
Kind: function. Source: core/lsd/src/lsd/core/largecsv.py:43.
autoselect_largecsv_source(source_json: str, *, accepted_kinds, threshold_bytes: Optional[int]=None) -> str
accepted_kinds: (unannotated)
source_json: str
threshold_bytes: Optional[int]
Source docstring:
Rewrite a single-file CSV/TSV ``file`` source → a ``largecsv`` source when the file is big enough.
Returns *source_json* unchanged unless: the loader accepts ``largecsv``; the source is a ``file`` kind
resolving to exactly one ``.csv``/``.tsv``; and that file is ≥ the size threshold. The streamed file's
delimiter is inferred from its extension. Centralised so every loader/template auto-picks uniformly.
Implementation alias: lsd.core.largecsv.autoselect_largecsv_source.
lsdtools.columnmap_param#
Kind: function. Source: core/lsd/src/lsd/core/columnmap.py:30.
columnmap_param(targets: Sequence[str]=(), **kwargs) -> ParameterDescriptor
kwargs: (unannotated)
targets: Sequence[str]
Source docstring:
A ``str`` param carrying a column map. *targets* seed the editor's rows (e.g. ``["x","y","z"]``).
The widget hint is ``"columnmap:<t1,t2,…>"`` so the UI can pre-list the expected target columns;
blank ``targets`` gives a free-form editor.
Implementation alias: lsd.core.columnmap.columnmap_param.
lsdtools.describe_api#
Kind: function. Source: core/lsd/src/lsd/describe.py:53.
describe_api() -> Dict[str, Any]
Source docstring:
Describe the registered steps/entities/views + the public surface as a JSON-ready dict.
Shape::
{
"api_version": "1.0",
"lsd_version": "1.0.0",
"public_api": ["Engine", "Table", "Tool", "View", ...], # lsdtools.__all__
"steps": {"MyShape": {"kind": "shape", "params": [...], "input_ports": [...], ...}},
"entities": {"package.Dataset": {"title": "Dataset", "params": [...], ...}},
"views": {"table": {"class": "TableView", "params": [...], ...}}, # data-view kinds
}
Implementation alias: lsd.describe.describe_api.
lsdtools.extend#
Kind: module. Source: sdk/src/lsdtools/extend.py:1.
Source docstring:
``lsdtools.extend`` — the extension surface: the registries and substrate a package calls to
teach the product a new capability without forking it.
The top-level :mod:`lsdtools` names (``Tool``, ``Context``, ``Table``, ``View``, ``param`` …) are all
a package needs to *build a pipeline and a panel*. This module is the door to the *extension seams* —
the component registries the charter puts on every view kind (``register_chart_kind``,
``register_cell_renderer``, ``register_param_control``, ``register_layer_kind``, the diagram
``register_diagram_layout`` / ``register_diagram_preset``), the symbology seams (contributed
style assets through ``register_style_asset`` / ``StyleAssetSpec`` and the standard style for a
package's own data through ``register_default_style``), the data-format
registry (``register_table_reader``), the file-import template/source seams — plus the raw engine
substrate (``LoadStep`` / ``EventBus`` / ``ParameterInfo`` / contribution plumbing …) the declarative
``@tool.*`` API sits on.
It replaces the old ``lsdtools.advanced``: same surface (the substrate below the curated top level) but
an honest name and — unlike ``advanced`` — **declared and charter-enforced**. Every seam that lives in a
view/service package is reached lazily through a whitelisted bridge (see ``LAZY_BRIDGES`` in
``core/lsd/tests/test_architecture_charter.py``); the ``_EXPORTS`` table below IS that surface, and the
charter asserts each entry maps to a foundation (`lsd`) or a bridge. Importing this module loads
nothing; resolving a name imports its owner on demand.
One law still holds: a package imports ``lsdtools`` and its submodules — never a product-internal
package directly. ``from lsd_view_chart import register_chart_kind`` is the old, ungoverned path;
``from lsdtools.extend import register_chart_kind`` is the governed one.
lsdtools.generate_step#
Kind: function. Source: sdk/src/lsdtools/__init__.py:155.
generate_step(prompt: str, **kwargs)
kwargs: (unannotated)
prompt: str
Source docstring:
Generate an LSD step from a natural-language *prompt* using AI.
The public entry point to AI step generation. It bridges to the private ``lsd-agent``
engine (which calls Claude) and, by default, writes the step into your project's
``steps.py`` so the desktop hot-reloads it. Requires the ``lsd-agent`` package and an
``ANTHROPIC_API_KEY`` (or pass a ``completer=`` for testing/custom backends).
from lsdtools import generate_step
generate_step("a deliver step that writes its input Table to a parquet file",
project_dir=".")
Keyword args (forwarded): ``project_dir`` (default "."), ``into`` (default "steps.py"),
``apply`` (default True), ``completer``, ``context``. Returns the generated code.
lsdtools.geostats#
Kind: module. Source: sdk/src/lsdtools/geostats.py:1.
Source docstring:
Lazy public facade for LSD deterministic geostatistical estimation.
Importing this module does not import NumPy, load native artifacts, initialize
CUDA, or import the product runtime. External packages should use this module
instead of importing ``lsd_geostats_runtime`` directly.
lsdtools.groundwater#
Kind: module. Source: sdk/src/lsdtools/groundwater.py:1.
Source docstring:
Lazy public facade for LSD saturated-groundwater execution.
Importing this module does not import NumPy, initialize CUDA, or import the
scientific runtime. First-party and Store packages exchange versioned,
JSON-safe documents through this boundary instead of importing
``lsd_groundwater`` directly.
lsdtools.integeragent#
Kind: module. Source: sdk/src/lsdtools/integeragent.py:1.
Source docstring:
Lazy public facade for LSD integer-agent deployment and inference.
Importing this module does not import NumPy, the private inference engine, a
gym, CUDA, a mine adapter, or the product runtime.
lsdtools.models#
Kind: module. Source: sdk/src/lsdtools/models.py:1.
Source docstring:
Lazy public access to LSD's SDF, block-model, and field-model services.
Domain packages should import this module through ``from lsdtools import models``
instead of naming product service distributions directly. The bridge is deliberately
lazy: importing :mod:`lsdtools` or :mod:`lsdtools.models` does not import NumPy,
PyArrow, or any model service.
The services meet at one backend-neutral regional contract::
from lsdtools import models
candidate = models.oriented_box(
center=(1000, 2000, -300),
half_size=(15, 30, 4),
axes=((1, 0, 0), (0, 0, 1), (0, -1, 0)),
)
query = models.regional_query(
query_id="trial-17",
region_id="study-worker-0",
sdf=candidate,
value_field="nsr_per_m3",
)
result = models.evaluate_region(backend, query)
Scalar service objects and result records are returned unchanged. Batched
evaluation is normalized into :class:`RegionalBatchEvaluation`, so optimizers
can use native page-major block-model execution or an ordered scalar fallback
without importing either implementation package. Optional services remain lazy
and missing or incompatible installations are mapped to
:class:`ModelServiceUnavailable`.
Structural discovery is normalized too: :func:`source_fields` returns typed
numeric field metadata without exposing Arrow, while
:func:`source_support_region` returns one validated physical-support frame.
lsdtools.neural#
Kind: module. Source: sdk/src/lsdtools/neural.py:1.
Source docstring:
Lazy public facade for authenticated neural execution.
Importing this module does not import NumPy, load a native artifact, initialize
CUDA, or import the product runtime. Domain packages use this facade instead of
importing :mod:`lsd_neural_engine` directly.
lsdtools.open_parquet_dataset#
Kind: function. Source: core/lsd/src/lsd/core/parquet.py:570.
open_parquet_dataset(source: Any, *, scan_options: ParquetScanOptions=ParquetScanOptions(), filesystem: Any=None, partitioning: Any=None, source_fingerprint: Optional[str]=None) -> ParquetDataset
filesystem: Any
partitioning: Any
scan_options: ParquetScanOptions
source: Any
source_fingerprint: Optional[str]
Source docstring:
Open the public bounded Parquet contract for a path or InputArtifact.
Implementation alias: lsd.core.parquet.open_parquet_dataset.
lsdtools.param#
Kind: function. Source: core/lsd/src/lsd/core/configurable.py:260.
param(param_type: type, *, default: Any=_MISSING, default_factory: Optional[Callable[[], Any]]=None, label: str='', description: str='', required: bool=False, choices: Optional[List[Any]]=None, min: Optional[Any]=None, max: Optional[Any]=None, step: Optional[float]=None, digits: Optional[int]=None, widget: Optional[str]=None, visibility: str='normal', group: str='General', graph: bool=False, output: bool=False, hashed: bool=True, validators: Optional[List[Callable[[Any], Optional[str]]]]=None) -> ParameterDescriptor
choices: Optional[List[Any]]
default: Any
default_factory: Optional[Callable[[], Any]]
description: str
digits: Optional[int]
graph: bool
group: str
hashed: bool
label: str
max: Optional[Any]
min: Optional[Any]
output: bool
param_type: type
required: bool
step: Optional[float]
validators: Optional[List[Callable[[Any], Optional[str]]]]
visibility: str
widget: Optional[str]
Source docstring:
Declare a configurable parameter on a Configurable subclass.
Examples::
class LoadFromDB(LoadStep):
param_group_order = ["Connection", "Query"]
host = param(str, default="localhost", group="Connection")
port = param(int, default=5432, group="Connection")
query = param(str, required=True, group="Query")
Implementation alias: lsd.core.configurable.param.
lsdtools.parquet_write_policy#
Kind: function. Source: core/lsd/src/lsd/core/parquet.py:202.
parquet_write_policy(policy: Union[str, ParquetWritePolicy, None]=None) -> ParquetWritePolicy
policy: Union[str, ParquetWritePolicy, None]
Source docstring:
Resolve the current runtime policy, a stable policy id, or an instance.
Implementation alias: lsd.core.parquet.parquet_write_policy.
lsdtools.parse_column_map#
Kind: function. Source: core/lsd/src/lsd/core/columnmap.py:43.
parse_column_map(spec: str) -> Dict[str, str]
spec: str
Source docstring:
Parse ``"x=Easting, y=Northing"`` (or ``:`` separators) → ``{"x": "Easting", "y": "Northing"}``.
Blank entries are ignored so a trailing comma is harmless, but an entry that is not a
``target=source`` pair raises. Dropping it instead would build a *partial* map and import
fewer columns than the user asked for, with nothing to distinguish that from a map they
wrote correctly — in a coordinate map, a silently truncated geometry.
Two different sources for one target likewise raise: that is a contradiction in the spec,
not a preference for whichever was written last.
Implementation alias: lsd.core.columnmap.parse_column_map.
lsdtools.parse_source#
Kind: function. Source: core/lsd/src/lsd/core/source.py:297.
parse_source(spec: str, *, base_dir: Optional[str]=None) -> ResolvedSource
base_dir: Optional[str]
spec: str
Source docstring:
Parse source JSON into the runtime value used by a load step.
When *base_dir* is supplied, explicit relative paths in the built-in file
source are resolved against it. The parsed config is ephemeral, so the
project keeps its portable spelling while reads, watches and fingerprints
all address the same absolute file. Callers without a persisted project
omit *base_dir* and retain process-CWD semantics.
Implementation alias: lsd.core.source.parse_source.
lsdtools.profiling#
Kind: module. Source: sdk/src/lsdtools/profiling.py:1.
Source docstring:
Stable package-author facade for LSD profiling.
Package code should import this module instead of reaching into product internals. The
implementation is the stdlib-only :mod:`lsd_profiler` leaf, so importing this facade
does not construct an Engine, UI, worker, or sampler thread.
lsdtools.publish#
Kind: module. Source: sdk/src/lsdtools/publish.py:1.
Source docstring:
Immutable, transport-neutral descriptors for published LSD sites.
Package code owns the bytes in a static site directory. This module validates and hashes those
bytes into the exact ``lsd.publish/v1`` manifest understood by the publish service, but deliberately
does not select a URL, implement HTTP, or start infrastructure. Uploading is delegated to a public
client supplied by the caller (or, when the product provides one, by
``lsdtools.server.publish_client``).
The directory walk is fail-closed: only regular files and ordinary directories are accepted;
symbolic links, junctions/reparse points, traversal paths, and special files are rejected. Limits
mirror the v1 service defaults so a package cannot spend unbounded work constructing a manifest the
service will refuse.
lsdtools.resolve_column_map#
Kind: function. Source: core/lsd/src/lsd/core/columnmap.py:94.
resolve_column_map(columns: Sequence[str], mapping: Mapping[str, str], *, required: Iterable[str]=(), aliases: Optional[Mapping[str, Sequence[str]]]=None, keep_unmapped: bool=False) -> Tuple[Dict[str, str], List[str]]
aliases: Optional[Mapping[str, Sequence[str]]]
columns: Sequence[str]
keep_unmapped: bool
mapping: Mapping[str, str]
required: Iterable[str]
Source docstring:
Resolve a (possibly partial) column map against the actual *columns*.
Explicit *mapping* entries win; any *required* / *aliases* target not mapped is auto-detected via
:func:`_match`. Returns ``(resolved {target: source}, missing_required)``. Explicit sources that
don't exist in *columns* are dropped from the result and (if required) reported as missing.
With *keep_unmapped*, source columns no target claimed are added to the result under their own
names, so applying this map preserves them — the same intent as the flag of the same name on
:func:`apply_column_map`, and setting either one produces the same table.
Implementation alias: lsd.core.columnmap.resolve_column_map.
lsdtools.server#
Kind: module. Source: sdk/src/lsdtools/server.py:1.
Source docstring:
Public package-facing access to LSD server services.
Packages use this module instead of selecting localhost/production URLs or
starting infrastructure themselves. In a source checkout the application
runtime asks the sibling ``lsd-server`` checkout to ensure its local gateway;
an installed runtime is locked to ``https://lsd.tools``.
lsdtools.validators#
Kind: module. Source: core/lsd/src/lsd/core/validators.py:1.
Source docstring:
Reusable parameter validators — the checks that don't map onto a ``ParameterDef`` field.
``required`` / ranges / choices are already expressed by ``param(required=…, min=…, max=…,
choices=…)``; these cover the rest. Each factory returns a validator with the ``ParameterDef``
contract — ``Callable[[Any], Optional[str]]``: return ``None`` when the value is acceptable, else a
human-readable error string. Like the built-in checks, an empty value passes (pair with
``required=True`` to forbid blanks)::
from lsdtools import param, validators
email = param(str, validators=[validators.matches(r"[^@]+@[^@]+")])
out = param(str, validators=[validators.suffix(".csv", ".parquet")])
Implementation alias: lsd.core.validators.
lsdtools.views#
Kind: module. Source: sdk/src/lsdtools/views.py:1.
Source docstring:
``lsdtools.views`` — the data-view façade. Lazy imports (the ``generate_step`` pattern): importing
``lsdtools`` never drags a view package (or cairo/GTK) into the process; each factory imports its
package on first use and raises a clear error if it is not installed.
from lsdtools import views
v = views.table(my_table) # a TableView, fed
c = views.chart(kind="line", title="Loss")
f = views.flowchart("A\n B\n C")
print(v.to_text()); c.to_image("chart.png")
A custom data view registers its GTK drawing shell here — the one sanctioned place a package writes
GTK. In your view's ``gtk`` module (loaded via the ``lsd.view_gtk`` entry point)::
from lsdtools.views import set_view_shell
set_view_shell("my.kind", build_my_shell) # build_my_shell(view) -> a Gtk.Widget
lsdtools.write_parquet_table#
Kind: function. Source: core/lsd/src/lsd/core/parquet.py:270.
write_parquet_table(table: Any, where: Any, *, policy: Union[str, ParquetWritePolicy, None]=None, **overrides: Any) -> Any
overrides: Any
policy: Union[str, ParquetWritePolicy, None]
table: Any
where: Any
Source docstring:
Write one Arrow table under a centralized physical-layout policy.
``overrides`` exists for compatibility at established APIs such as
``Table.write_parquet(..., compression=...)``. New runtime writers should
select a policy and avoid ad-hoc option sets.
Implementation alias: lsd.core.parquet.write_parquet_table.