mufasa.graph_svg.spec#
Graph descriptions: nodes with their data types, and edges. Built from a Graph or from example code.
Exceptions#
Inappropriate argument value (of correct type). |
Classes#
Functions#
|
Describe a built Graph, with the data types its nodes resolved at construction and wiring. |
|
Data types declared by a node class. |
|
Describe the graph that example code builds, without running it. |
Module Contents#
- class mufasa.graph_svg.spec.NodeSpec#
- id: str#
- cls: type#
- input_types: list[type]#
- output_type: type | None#
- property is_input: bool#
- Return type:
bool
- property is_output: bool#
- Return type:
bool
- exception mufasa.graph_svg.spec.FusionGraphCodeError(message: str, lineno: int | None = None)#
Bases:
ValueErrorInappropriate argument value (of correct type).
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
message (str)
lineno (int | None)
- mufasa.graph_svg.spec.spec_from_graph(graph) GraphSpec#
Describe a built Graph, with the data types its nodes resolved at construction and wiring.
- Return type:
- mufasa.graph_svg.spec.class_types(cls: type) tuple[list[type], type | None]#
Data types declared by a node class.
Nodes that resolve their types later (at construction or wiring) declare their broadest valid types on the class, so a graph drawn from code shows what a class accepts and produces in general.
- Parameters:
cls (type)
- Return type:
tuple[list[type], type | None]
- mufasa.graph_svg.spec.spec_from_code(source: str) GraphSpec#
Describe the graph that example code builds, without running it.
Understands
from module import NodeClassand assignmentsname = NodeClass(...)(a source) orname = NodeClass(...)(input, ...). Everything else, such asGraph(...)orgraph.run(), is ignored.- Parameters:
source (str)
- Return type: