nemo_gym.cli.utils

View as Markdown

Module Contents

Functions

NameDescription
exit_cleanly_on_config_errorDecorator: turn user-facing ConfigError into a clean message + non-zero exit.
print_rich_tablePrint a Rich table without the 80-col truncation Rich applies when stdout is piped.

API

nemo_gym.cli.utils.exit_cleanly_on_config_error(
fn
)

Decorator: turn user-facing ConfigError into a clean message + non-zero exit.

Config mistakes (missing/typo’d config_paths, malformed config_paths, nothing configured to run) should fail fast with an actionable message, not a Python traceback. Unexpected errors still propagate normally.

nemo_gym.cli.utils.print_rich_table(
table
) -> None

Print a Rich table without the 80-col truncation Rich applies when stdout is piped.

On a TTY, Rich sizes the console to the terminal. When stdout is redirected (e.g. gym list benchmarks | cat), Rich falls back to an 80-column console and truncates cells with an ellipsis, silently losing data. We measure the table’s natural width and render at that width so piped output is lossless, while leaving interactive terminal output unchanged.