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
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ all = [

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py312"

# Exclude directories
extend-exclude = [
Expand Down Expand Up @@ -98,6 +98,8 @@ ignore = [
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
"UP006", # Use 'dict' instead of 'Dict' type annotation
"UP018", # Unnecessary `float` call (rewrite as a literal)
"UP040", # TypeAlias annotation → `type` keyword (PEP 695, migrate later)
"UP047", # Generic function → type parameters (PEP 695, migrate later)
]

[tool.ruff.lint.per-file-ignores]
Expand Down
2 changes: 1 addition & 1 deletion scripts/reinforcement_learning/rl_games/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import sys
import time
from datetime import datetime
from distutils.util import strtobool

import gymnasium as gym
from rl_games.common import env_configurations, vecenv
Expand All @@ -36,6 +35,7 @@
from isaaclab.utils.dict import print_dict
from isaaclab.utils.io import dump_yaml
from isaaclab.utils.seed import configure_seed
from isaaclab.utils.string import strtobool

from isaaclab_rl.rl_games import MultiObserver, PbtAlgoObserver, RlGamesGpuEnv, RlGamesVecEnvWrapper

Expand Down
3 changes: 2 additions & 1 deletion scripts/reinforcement_learning/rl_games/train_rl_games.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import random
import time
from datetime import datetime
from distutils.util import strtobool

from common import (
add_common_train_args,
Expand All @@ -30,6 +29,8 @@
wrap_record_video,
)

from isaaclab.utils.string import strtobool

import isaaclab_tasks # noqa: F401

logger = logging.getLogger(__name__)
Expand Down
Empty file.
3 changes: 1 addition & 2 deletions source/isaaclab/isaaclab/cli/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
import re
import shutil
import sys
from pathlib import Path

import tomllib
from pathlib import Path

from ..utils import (
ISAACLAB_ROOT,
Expand Down
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/devices/haply/se3_haply.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ async def _websocket_loop(self):

await asyncio.sleep(1.0 / self.data_rate)

except asyncio.TimeoutError:
except TimeoutError:
self.consecutive_timeouts += 1

# Check if timeout
Expand Down
24 changes: 24 additions & 0 deletions source/isaaclab/isaaclab/utils/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,3 +546,27 @@ def list_intersection(list1: list[Any], list2: list[Any] | None) -> list[Any]:
return list1
set2 = set(list2)
return [x for x in list1 if x in set2]


def strtobool(val: str) -> bool:
"""Convert a string representation of truth to True/False.

True values are ``y``, ``yes``, ``t``, ``true``, ``on``, and ``1``.
False values are ``n``, ``no``, ``f``, ``false``, ``off``, and ``0``.

Args:
val: The string to convert.

Returns:
The boolean interpretation of *val*.

Raises:
ValueError: If *val* is not a recognised truth string.
"""
v = val.lower()
if v in ("y", "yes", "t", "true", "on", "1"):
return True
elif v in ("n", "no", "f", "false", "off", "0"):
return False
else:
raise ValueError(f"invalid truth value {val!r}")
3 changes: 1 addition & 2 deletions source/isaaclab/test/cli/test_uv_run_pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
from __future__ import annotations

import re
from pathlib import Path

import tomllib
from pathlib import Path


def _repo_root() -> Path:
Expand Down
3 changes: 1 addition & 2 deletions source/isaaclab/test/cli/test_wheel_builder_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
from __future__ import annotations

import ast
from pathlib import Path

import tomllib
from pathlib import Path


def _repo_root() -> Path:
Expand Down
1 change: 0 additions & 1 deletion tools/wheel_builder/gen_pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""Generate pyproject.toml for the isaaclab wheel from python_packages.toml."""

import sys

import tomllib

if len(sys.argv) != 4:
Expand Down
Loading