agedi.api._display ================== .. py:module:: agedi.api._display .. autoapi-nested-parse:: Rich UI / console display utilities. Functions --------- .. autoapisummary:: agedi.api._display._fmt_target agedi.api._display._extract_data_info agedi.api._display._check_head_dimensions agedi.api._display._render_config_tree agedi.api._display._extract_diffusion_display_info agedi.api._display._get_device_info agedi.api._display._print_training_config agedi.api._display._print_log_path agedi.api._display._print_loaded_model_info agedi.api._display._print_sampling_config Module Contents --------------- .. py:function:: _fmt_target(target: str) -> str Return the short class name from a dotted ``_target_`` string. .. py:function:: _extract_data_info(data: Sequence[Atoms]) -> Dict Extract summary information from a list of ASE Atoms objects. :param data: List of ASE :class:`~ase.Atoms` objects to inspect. :type data: Sequence[Atoms] :returns: A dictionary with the following keys: * ``"cell"`` – flattened 9-element list of the (shared) unit-cell matrix, or ``None`` if cells differ between structures. * ``"symbols"`` – list of unique chemical symbols present in the data. * ``"n_training_data"`` – total number of structures. :rtype: dict .. py:function:: _check_head_dimensions(diffusion_cfg: dict) -> list Validate that head input dimensions match feature_size + conditioning output dims. :param diffusion_cfg: The ``diffusion`` sub-dict from ``hparams.yaml``. :type diffusion_cfg: dict :returns: Warning messages for any dimension mismatches, empty if all match. :rtype: list of str .. py:function:: _render_config_tree(data, tree: rich.tree.Tree) -> None Recursively populate a Rich :class:`~rich.tree.Tree` with config key/values. * Dicts: each key becomes a leaf (scalar) or sub-branch (dict/list). The ``_target_`` key is skipped — callers show it as the branch label. * Lists: each item becomes a sub-branch labelled by its ``_target_`` class name (or a numeric index for plain scalars). * Scalars and ``None``: shown as ``key value``; ``None`` is omitted. .. py:function:: _extract_diffusion_display_info(diffusion_cfg: dict) -> dict Extract human-readable display values from a nested Hydra diffusion config. :param diffusion_cfg: The ``diffusion`` sub-dict from ``hparams.yaml``, as returned by :meth:`~agedi.diffusion.agedi.Agedi.get_hparams`. :type diffusion_cfg: dict :returns: Flat dict with display-friendly keys: ``model``, ``feature_size``, ``n_blocks``, ``cutoff``, ``noisers``, ``conditionings``, ``lr``, ``lr_factor``, ``lr_patience``, ``weight_decay``. :rtype: dict .. py:function:: _get_device_info() -> str Return a human-readable string describing the available compute device. .. py:function:: _print_training_config(hparams: dict) -> None Print a Rich-formatted training configuration panel. :param hparams: The hparams dict as saved to ``hparams.yaml``. Must contain a ``"diffusion"`` key with the nested Hydra config. Metadata keys (``n_train``, ``n_val``, ``batch_size``, etc.) are read directly. :type hparams: dict .. py:function:: _print_log_path(trainer: Trainer) -> None Print the resolved log directory for this training run. .. py:function:: _print_loaded_model_info(params: dict, checkpoint_path: pathlib.Path, device) -> None Print a Rich-formatted summary of a loaded diffusion model. .. py:function:: _print_sampling_config(n_samples: int, steps: int, eps: float, batch_size: int, formula=None, n_atoms=None, template=None, cell=None, confinement=None, property=None, force_field_guidance: float = 0.0) -> None Print a Rich-formatted sampling configuration panel.