nodes#

Classes#

AbstractNode

Abstract node model use to represent different components of a Spark model.

SourceNode

Node representing the input to the system.

SinkNode

Node representing the output of the system.

SparkModuleNode

Abstract node representing a SparkModule.

Functions#

module_to_nodegraph(entry)

Factory function that creates a new NodeGraphQt node class from an Spark module class.

Module Contents#

class nodes.AbstractNode#

Bases: NodeGraphQt.BaseNode, abc.ABC

Abstract node model use to represent different components of a Spark model.

__identifier__ = 'spark'#
NODE_NAME = 'Abstract Node'#
input_specs: dict[str, spark.core.specs.InputSpec]#
output_specs: dict[str, spark.core.specs.OutputSpec]#
graph: spark.graph_editor.models.graph.SparkNodeGraph#
update_io_spec(spec, port_name, payload_type=None, shape=None, dtype=None, description=None)#

Method to update node IO specs. Valid updates are broadcasted.

Parameters:
  • spec (str) – str, target spec {input, output}

  • port_name (str) – str, the name of the port to update

  • payload_type (type[spark.core.payloads.SparkPayload] | None) – type[SparkPayload] | None, the new payload_type

  • shape (tuple[int, Ellipsis] | None) – tuple[int, …] | None, the new shape

  • dtype (jax.typing.DTypeLike | None) – DTypeLike | None, the new dtype

  • description (str | None) – str | None, the new description

property node_config_metadata: dict#
Abstractmethod:

Return type:

dict

class nodes.SourceNode#

Bases: AbstractNode

Node representing the input to the system.

NODE_NAME = 'Source Node'#
output_specs#
property node_config_metadata: dict#
Return type:

dict

class nodes.SinkNode#

Bases: AbstractNode

Node representing the output of the system.

NODE_NAME = 'Sink Node'#
input_specs#
property node_config_metadata: dict#
Return type:

dict

class nodes.SparkModuleNode#

Bases: AbstractNode, abc.ABC

Abstract node representing a SparkModule.

NODE_NAME = 'SparkModule'#
module_cls: type[spark.core.module.SparkModule]#
node_config: spark.core.config.BaseSparkConfig#
input_specs#
output_specs#
property node_config_metadata: dict#
Return type:

dict

nodes.module_to_nodegraph(entry)#

Factory function that creates a new NodeGraphQt node class from an Spark module class.

Parameters:

entry (spark.core.registry.RegistryEntry)

Return type:

type[SparkModuleNode]