Skip to main content

classy.utils.rich_config

Functions

get_rich_tree_config

def get_rich_tree_config(
    cfg: omegaconf.dictconfig.DictConfig,
    blames: Optional[List[Tuple[List[str], ConfigBlame]]] = None,
    tree_label: str = '<root>',
)
def print_config(
    cfg: omegaconf.dictconfig.DictConfig,
    blames: Optional[List[Tuple[List[str], ConfigBlame]]] = None,
    tree_label: str = '<root>',
)

rich_to_html

def rich_to_html(
    renderable,
    print_to_console: bool = False,
    width: int = 230,
)

Classes

ConfigPrinter

class ConfigPrinter()

__init__

def __init__(
    cfg: Union[dict, omegaconf.dictconfig.DictConfig],
    fields_order: Iterable[str] = ('training', 'model', 'data', 'prediction', 'callbacks', 'logging'),
    skip_remaining: bool = False,
    additional_blames: Optional[List[Tuple[List[str], ForwardRef('ConfigBlame')]]] = None,
    label: str = '<root>',
)

get_rich_tree

def get_rich_tree(
    self,
) ‑> rich.tree.Tree

walk_config

def walk_config(
    self,
    key,
    sort: bool = True,
) ‑> List[rich.tree.Tree]

join_keys

@classmethod
def join_keys(
    parent: Optional[str],
    key: str,
)

RichNodeInfo

class RichNodeInfo()

render_value

def render_value(
    self,
) ‑> rich.text.Text