# builders.domain.renderability

Domain specification

Domain

# Renderable

A domain must inherit this class if it can be rendered with any kind of visualization.

# render Renderable

render(
  self,
memory: Optional[Memory[D.T_state]] = None,
**kwargs: Any
) -> Any

Compute a visual render of the given memory (state or history), or the internal one if omitted.

By default, Renderable.render() provides some boilerplate code and internally calls Renderable._render(). The boilerplate code automatically passes the _memory attribute instead of the memory parameter whenever the latter is None.

# Parameters

  • memory: The memory to consider (if None, the internal memory attribute _memory is used instead).

# Returns

A render (e.g. image) or nothing (if the function handles the display directly).

# _render Renderable

_render(
  self,
memory: Optional[Memory[D.T_state]] = None,
**kwargs: Any
) -> Any

Compute a visual render of the given memory (state or history), or the internal one if omitted.

By default, Renderable._render() provides some boilerplate code and internally calls Renderable._render_from(). The boilerplate code automatically passes the _memory attribute instead of the memory parameter whenever the latter is None.

# Parameters

  • memory: The memory to consider (if None, the internal memory attribute _memory is used instead).

# Returns

A render (e.g. image) or nothing (if the function handles the display directly).

# _render_from Renderable

_render_from(
  self,
memory: Memory[D.T_state],
**kwargs: Any
) -> Any

Compute a visual render of the given memory (state or history).

This is a helper function called by default from Renderable._render(), the difference being that the memory parameter is mandatory here.

# Parameters

  • memory: The memory to consider.

# Returns

A render (e.g. image) or nothing (if the function handles the display directly).