tisserande.tracking.inspector

Argument introspection for classifying function inputs/outputs into node types.

Classes

ArgumentInspector

Inspects function signatures and runtime args to create node specifications.

Module Contents

class tisserande.tracking.inspector.ArgumentInspector(func: collections.abc.Callable[Ellipsis, Any])[source]

Inspects function signatures and runtime args to create node specifications.

property function_name: str[source]
property function_module: str[source]
classify_argument(param_name: str, value: Any) tisserande.models.types.NodeType | None[source]

Determine NodeType for a parameter from annotation or value heuristics.

Returns None if the argument is marked as Untracked.

classify_return(value: Any) tisserande.models.types.NodeType | None[source]

Classify the return value.

build_node_kwargs(param_name: str, node_type: tisserande.models.types.NodeType, value: Any) dict[str, Any][source]

Build kwargs dict for creating a Node row.

build_input_specs(args: tuple[Any, Ellipsis], kwargs: dict[str, Any]) list[dict[str, Any]][source]

Build node creation specs for all tracked input arguments.

build_output_specs(result: Any) list[dict[str, Any]][source]

Build node creation specs for the return value.