Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/tools-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ jobs:
# The tests import the modules under test (crash_journal, _device_split) directly.
PYTHONPATH: tools
# Files are listed explicitly rather than collected from tools/: test_settings.py is a
# configuration module, not a test, and tools/test/ needs the full Isaac Lab install.
# configuration module, not a test, and most of tools/test/ needs the full Isaac Lab
# install. test_task_discovery.py is the exception - task_discovery.py defers every
# isaaclab import into a function body, so its unit tests run on pytest alone.
#
# --noconftest keeps tools/conftest.py out of the session. That file is the CI test
# orchestrator - its pytest_sessionstart scans source/ and scripts/ and runs the whole
# suite, so loading it here would ignore the files named below.
run: python3 -m pytest tools/test_crash_journal.py tools/test_device_split.py -v --noconftest
run: >-
python3 -m pytest tools/test_crash_journal.py tools/test_device_split.py
tools/test/test_task_discovery.py -v --noconftest
43 changes: 17 additions & 26 deletions tools/environ_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

import gymnasium as gym

from isaaclab_tasks.utils.preset_cli import enumerate_task_presets
# ``is_training_task`` is re-exported for callers that import it from here.
from task_discovery import RL_LIBRARY_PRIORITY, discover_tasks, is_training_task # noqa: F401

from isaaclab_tasks.utils.preset_target import PresetTarget

if TYPE_CHECKING:
Expand All @@ -48,13 +50,9 @@
}
)

# RL libraries listed in a stable order across generated docs.
_RL_LIBRARY_ORDER = ("rl_games", "rsl_rl", "skrl", "sb3", "rlinf")

# Gym IDs excluded from the training list. The ``-Eval`` suffix marks dedicated
# evaluation variants (e.g. ``IsaacContrib-Assemble-Trocar-G129-Dex3-Eval``, an alias
# registered for RLinf eval configs) that should not appear as their own training row.
_EVAL_TASK_SUFFIXES = ("-Eval",)
# RL libraries listed in a stable order across generated docs. Owned by
# ``task_discovery`` so the tables and the task matrix cannot drift apart.
_RL_LIBRARY_ORDER = RL_LIBRARY_PRIORITY

# RL libraries not discoverable from Gym ``kwargs`` (e.g. RLinf YAML-based workflows).
RL_LIBRARY_OVERRIDES: dict[str, dict[str, list[str]]] = {
Expand Down Expand Up @@ -117,17 +115,6 @@ def _supports_warp_frontend(task_name: str, workflow: str, presets: dict[PresetT
return False


def is_training_task(task_id: str) -> bool:
"""Return ``True`` when *task_id* is a training (non-inference) Isaac task."""
if "Isaac" not in task_id:
return False
if any(task_id.endswith(suffix) for suffix in _EVAL_TASK_SUFFIXES):
return False
if "-Benchmark-" in task_id:
return False
return True


def parse_rl_libraries_from_kwargs(kwargs: dict) -> dict[str, list[str]]:
"""Parse RL-library and algorithm labels from Gym registry kwargs.

Expand Down Expand Up @@ -527,13 +514,17 @@ def collect_environment_doc_rows(

rows: list[EnvironmentDocRow] = []

for spec in specs:
if not is_training_task(spec.id) or spec.kwargs.get("deprecated"):
continue

preset_map = enumerate_task_presets(spec.id)
if preset_map is not None:
preset_map = dict(preset_map)
specs_by_id = {spec.id: spec for spec in specs}
for task in discover_tasks(specs, resolve=False):
spec = specs_by_id[task.task_id]

preset_map = None
if task.declared is not None:
preset_map = {
PresetTarget.PHYSICS: list(task.declared["physics"]),
PresetTarget.RENDERER: list(task.declared["renderer"]),
PresetTarget.DOMAIN: list(task.declared["presets"]),
}
preset_map[PresetTarget.PHYSICS] = _physics_names_for_docs(spec.id, preset_map)
agents = apply_rl_library_overrides(spec.id, parse_rl_libraries_from_kwargs(spec.kwargs))

Expand Down
Loading
Loading