agedi.api._display

Rich UI / console display utilities.

Functions

_fmt_target(→ str)

Return the short class name from a dotted _target_ string.

_extract_data_info(→ Dict)

Extract summary information from a list of ASE Atoms objects.

_check_head_dimensions(→ list)

Validate that head input dimensions match feature_size + conditioning output dims.

_render_config_tree(→ None)

Recursively populate a Rich Tree with config key/values.

_extract_diffusion_display_info(→ dict)

Extract human-readable display values from a nested Hydra diffusion config.

_get_device_info(→ str)

Return a human-readable string describing the available compute device.

_print_training_config(→ None)

Print a Rich-formatted training configuration panel.

_print_log_path(→ None)

Print the resolved log directory for this training run.

_print_loaded_model_info(→ None)

Print a Rich-formatted summary of a loaded diffusion model.

_print_sampling_config(→ None)

Print a Rich-formatted sampling configuration panel.

Module Contents

agedi.api._display._fmt_target(target: str) str

Return the short class name from a dotted _target_ string.

agedi.api._display._extract_data_info(data: Sequence[Atoms]) Dict

Extract summary information from a list of ASE Atoms objects.

Parameters:

data (Sequence[Atoms]) – List of ASE Atoms objects to inspect.

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.

Return type:

dict

agedi.api._display._check_head_dimensions(diffusion_cfg: dict) list

Validate that head input dimensions match feature_size + conditioning output dims.

Parameters:

diffusion_cfg (dict) – The diffusion sub-dict from hparams.yaml.

Returns:

Warning messages for any dimension mismatches, empty if all match.

Return type:

list of str

agedi.api._display._render_config_tree(data, tree: rich.tree.Tree) None

Recursively populate a Rich 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.

agedi.api._display._extract_diffusion_display_info(diffusion_cfg: dict) dict

Extract human-readable display values from a nested Hydra diffusion config.

Parameters:

diffusion_cfg (dict) – The diffusion sub-dict from hparams.yaml, as returned by get_hparams().

Returns:

Flat dict with display-friendly keys: model, feature_size, n_blocks, cutoff, noisers, conditionings, lr, lr_factor, lr_patience, weight_decay.

Return type:

dict

agedi.api._display._get_device_info() str

Return a human-readable string describing the available compute device.

agedi.api._display._print_training_config(hparams: dict) None

Print a Rich-formatted training configuration panel.

Parameters:

hparams (dict) – 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.

agedi.api._display._print_log_path(trainer: Trainer) None

Print the resolved log directory for this training run.

agedi.api._display._print_loaded_model_info(params: dict, checkpoint_path: pathlib.Path, device) None

Print a Rich-formatted summary of a loaded diffusion model.

agedi.api._display._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.