Adds version output for Kit and isaac Sim for benchmark scripts#6196
Adds version output for Kit and isaac Sim for benchmark scripts#6196kellyguo11 wants to merge 1 commit into
Conversation
| try: | ||
| from isaaclab.utils.version import get_isaac_sim_version | ||
|
|
||
| return str(get_isaac_sim_version()) | ||
| except Exception: |
There was a problem hiding this comment.
get_isaac_sim_version() returns a packaging.version.Version object (never None), so str(...) is safe today. However, if the function signature ever relaxes to allow None (e.g. in offline/kitless environments), str(None) evaluates to the literal string "None", which passes the if version: guard in _record and would appear verbatim in benchmark output. A simple None check here makes the intent explicit and guards against future regressions.
| try: | |
| from isaaclab.utils.version import get_isaac_sim_version | |
| return str(get_isaac_sim_version()) | |
| except Exception: | |
| try: | |
| from isaaclab.utils.version import get_isaac_sim_version | |
| version = get_isaac_sim_version() | |
| return str(version) if version is not None else None | |
| except Exception: |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| def test_captures_kit_version_from_carb_settings(self, monkeypatch): | ||
| """Test that Kit version falls back to Carb settings.""" | ||
|
|
||
| class _Settings: | ||
| def get(self, key): | ||
| return {"/app/kit/version": "107.0.0"}.get(key) | ||
|
|
||
| monkeypatch.delitem(sys.modules, "omni.kit.app", raising=False) | ||
| monkeypatch.setitem(sys.modules, "carb.settings", types.SimpleNamespace(get_settings=lambda: _Settings())) | ||
|
|
||
| recorder = VersionInfoRecorder() | ||
|
|
||
| assert recorder.get_initial_data()["version_metadata"]["kit"] == "107.0.0" |
There was a problem hiding this comment.
Carb attribute-fallback path not exercised
_get_kit_settings_version has a secondary path — carb_settings = getattr(carb, "settings", None) — that is reached when carb is in sys.modules but carb.settings is not a separate module entry. The current test only covers the direct sys.modules["carb.settings"] lookup. A test that adds carb (with a .settings attribute) to sys.modules but leaves carb.settings absent would complete coverage of that branch.
Description
Adds logging of kit and isaac sim versions in the benchmark scripts.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there