nemo_gym

View as Markdown

Subpackages

Submodules

Package Contents

Functions

NameDescription
_resolve_under_cwd_or_installResolve a possibly-relative path for reading a built-in or user-supplied file.
print_always_flushes-

Data

CACHE_DIR

OLD_PRINT

PARENT_DIR

RESULTS_DIR

ROOT_DIR

WORKING_DIR

_is_editable_install

API

nemo_gym._resolve_under_cwd_or_install(
path
) -> pathlib.Path

Resolve a possibly-relative path for reading a built-in or user-supplied file.

Absolute paths are returned unchanged. A relative path is tried first under the current working directory (the user’s project), then under the Gym install root (PARENT_DIR) where built-in assets live in both editable and wheel installs. This mirrors config_paths resolution, so a repo-relative path like resources_servers/<env>/data/example.jsonl resolves by name from any cwd. If neither exists the cwd candidate is returned so error messages point at the user’s cwd.

Use this for read paths only — never for write targets (e.g. metrics written next to a dataset), which must stay relative to the user’s writable cwd rather than the install root.

nemo_gym.print_always_flushes(
args = (),
kwargs = {}
) -> None
nemo_gym.CACHE_DIR = WORKING_DIR / 'cache'
nemo_gym.OLD_PRINT = print
nemo_gym.PARENT_DIR = ROOT_DIR.parent
nemo_gym.RESULTS_DIR = WORKING_DIR / 'results'
nemo_gym.ROOT_DIR = Path(__file__).absolute().parent
nemo_gym.WORKING_DIR = PARENT_DIR if _is_editable_install else Path.cwd()
nemo_gym._is_editable_install = (PARENT_DIR / 'pyproject.toml').exists()