tfx.orchestration.interactive.notebook_formatters.NotebookFormatter

View source on GitHub

Class NotebookFormatter

Formats a TFX component in the context of an interactive notebook.

__init__

View source

__init__(
    cls,
    attributes=None,
    title_format=None
)

Constructs a NotebookFormatter.

Args:

  • cls: The TFX class to be formated by this NotebookFormatter instance.
  • attributes: A list of string attributes that are to be displayed by this formatter. Can be a nested field specifier with nested attribute names separated by "." (e.g. to get obj.a.b, specify the attribute string "a.b").
  • title_format: A 2-tuple consisting of (1) a format string and (2) a list of either string attribute names (possible of nested field specifiers as in "attributes" above) or callback callable objects taking as input the object to be formatted and returning the value for that position of the format string. If not specified, the default title format will be used.

Methods

render

View source

render(
    obj,
    expanded=True,
    seen_elements=None
)

Render a given object as an HTML string.

Args:

  • obj: The object to be rendered.
  • expanded: Whether the object is to be expanded by default.
  • seen_elements: Optionally, a set of seen elements to not re-render to prevent a rendering cycle.

Returns:

Formatted HTML string representing the object, for notebook display.

render_attributes

View source

render_attributes(
    obj,
    seen_elements
)

Render the attributes section of an object.

render_dict

View source

render_dict(
    obj,
    seen_elements
)

Render a dictionary table.

render_list

View source

render_list(
    obj,
    seen_elements
)

Render a list table.

render_title

View source

render_title(obj)

Render the title section of an object.

render_value

View source

render_value(
    value,
    seen_elements
)

Render the value section of an object.