Unverified Commit 259cc9d3 authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Updates pre-commit and setup.py to require Python 3.10 (#389)

# Description

As we are dropping support for Isaac Sim 2022.2, this MR updates the
pre-commit and setup.py to check for Python 3.10 language. Notable
changes when the formatter was run:

* `typing-extensions` has been merged to `typing`
* `collections.abc` is favored over `typing` for importing generic
types. The latter will be deprecated in future Python releases.

## Type of change

- New feature (non-breaking change which adds functionality)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] I have run all the tests with `./orbit.sh --test` and they pass
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
parent 9c3db10e
repos: repos:
- repo: https://github.com/python/black - repo: https://github.com/python/black
rev: 23.10.1 rev: 24.1.1
hooks: hooks:
- id: black - id: black
args: ["--line-length", "120", "--preview"] args: ["--line-length", "120", "--preview"]
- repo: https://github.com/pycqa/flake8 - repo: https://github.com/pycqa/flake8
rev: 6.1.0 rev: 7.0.0
hooks: hooks:
- id: flake8 - id: flake8
additional_dependencies: [flake8-simplify, flake8-return] additional_dependencies: [flake8-simplify, flake8-return]
...@@ -25,7 +25,7 @@ repos: ...@@ -25,7 +25,7 @@ repos:
- id: detect-private-key - id: detect-private-key
- id: debug-statements - id: debug-statements
- repo: https://github.com/pycqa/isort - repo: https://github.com/pycqa/isort
rev: 5.12.0 rev: 5.13.2
hooks: hooks:
- id: isort - id: isort
name: isort (python) name: isort (python)
...@@ -34,7 +34,7 @@ repos: ...@@ -34,7 +34,7 @@ repos:
rev: v3.15.0 rev: v3.15.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: ["--py37-plus"] args: ["--py310-plus"]
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.2.6 rev: v2.2.6
hooks: hooks:
......
[tool.isort] [tool.isort]
py_version = 37 py_version = 310
line_length = 120 line_length = 120
group_by_package = true group_by_package = true
...@@ -36,7 +36,6 @@ extra_standard_library = [ ...@@ -36,7 +36,6 @@ extra_standard_library = [
"toml", "toml",
"trimesh", "trimesh",
"tqdm", "tqdm",
"typing_extensions",
] ]
# Imports from Isaac Sim and Omniverse # Imports from Isaac Sim and Omniverse
known_third_party = [ known_third_party = [
...@@ -71,7 +70,7 @@ exclude = [ ...@@ -71,7 +70,7 @@ exclude = [
] ]
typeCheckingMode = "basic" typeCheckingMode = "basic"
pythonVersion = "3.7" pythonVersion = "3.10"
pythonPlatform = "Linux" pythonPlatform = "Linux"
enableTypeIgnoreComments = true enableTypeIgnoreComments = true
......
...@@ -26,12 +26,13 @@ setup( ...@@ -26,12 +26,13 @@ setup(
description=EXTENSION_TOML_DATA["package"]["description"], description=EXTENSION_TOML_DATA["package"]["description"],
keywords=EXTENSION_TOML_DATA["package"]["keywords"], keywords=EXTENSION_TOML_DATA["package"]["keywords"],
include_package_data=True, include_package_data=True,
python_requires=">=3.7", python_requires=">=3.10",
packages=["omni.isaac.contrib_tasks"], packages=["omni.isaac.contrib_tasks"],
classifiers=[ classifiers=[
"Natural Language :: English", "Natural Language :: English",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Isaac Sim :: 2023.1.0-hotfix.1", "Isaac Sim :: 2023.1.0-hotfix.1",
"Isaac Sim :: 2023.1.1",
], ],
zip_safe=False, zip_safe=False,
) )
...@@ -7,7 +7,8 @@ from __future__ import annotations ...@@ -7,7 +7,8 @@ from __future__ import annotations
import torch import torch
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
from omni.isaac.core.utils.types import ArticulationActions from omni.isaac.core.utils.types import ArticulationActions
...@@ -57,7 +58,7 @@ class ActuatorBase(ABC): ...@@ -57,7 +58,7 @@ class ActuatorBase(ABC):
self, self,
cfg: ActuatorBaseCfg, cfg: ActuatorBaseCfg,
joint_names: list[str], joint_names: list[str],
joint_ids: Sequence[int], joint_ids: slice | Sequence[int],
num_envs: int, num_envs: int,
device: str, device: str,
stiffness: torch.Tensor | float = 0.0, stiffness: torch.Tensor | float = 0.0,
...@@ -144,7 +145,7 @@ class ActuatorBase(ABC): ...@@ -144,7 +145,7 @@ class ActuatorBase(ABC):
return self._joint_names return self._joint_names
@property @property
def joint_indices(self) -> Sequence[int]: def joint_indices(self) -> slice | Sequence[int]:
"""Articulation's joint indices that are part of the group. """Articulation's joint indices that are part of the group.
Note: Note:
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Iterable
from dataclasses import MISSING from dataclasses import MISSING
from typing import Iterable from typing import Literal
from typing_extensions import Literal
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
...@@ -32,16 +32,16 @@ class ActuatorBaseCfg: ...@@ -32,16 +32,16 @@ class ActuatorBaseCfg:
This can be a list of joint names or a list of regex expressions (e.g. ".*"). This can be a list of joint names or a list of regex expressions (e.g. ".*").
""" """
effort_limit: float | None = None effort_limit: dict[str, float] | float | None = None
"""Force/Torque limit of the joints in the group. Defaults to None. """Force/Torque limit of the joints in the group. Defaults to None.
If None, the limit is set to the value specified in the USD joint prim. If None, the limit is set to the value specified in the USD joint prim.
""" """
velocity_limit: float | None = None velocity_limit: dict[str, float] | float | None = None
"""Velocity limit of the joints in the group. Defaults to None. """Velocity limit of the joints in the group. Defaults to None.
If None, the limit is set to infinity. If None, the limit is set to the value specified in the USD joint prim.
""" """
stiffness: dict[str, float] | float | None = MISSING stiffness: dict[str, float] | float | None = MISSING
......
...@@ -15,7 +15,8 @@ Currently, the following models are supported: ...@@ -15,7 +15,8 @@ Currently, the following models are supported:
from __future__ import annotations from __future__ import annotations
import torch import torch
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
from omni.isaac.core.utils.types import ArticulationActions from omni.isaac.core.utils.types import ArticulationActions
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
from omni.isaac.core.utils.types import ArticulationActions from omni.isaac.core.utils.types import ArticulationActions
......
...@@ -116,6 +116,7 @@ The following snippet shows how use the :class:`AppLauncher` in different ways: ...@@ -116,6 +116,7 @@ The following snippet shows how use the :class:`AppLauncher` in different ways:
.. _`Native Livestream`: https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/manual_livestream_clients.html#isaac-sim-setup-kit-remote .. _`Native Livestream`: https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/manual_livestream_clients.html#isaac-sim-setup-kit-remote
.. _`Websocket Livestream`: https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/manual_livestream_clients.html#isaac-sim-setup-livestream-webrtc .. _`Websocket Livestream`: https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/manual_livestream_clients.html#isaac-sim-setup-livestream-webrtc
.. _`WebRTC Livestream`: https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/manual_livestream_clients.html#isaac-sim-setup-livestream-websocket .. _`WebRTC Livestream`: https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/manual_livestream_clients.html#isaac-sim-setup-livestream-websocket
""" """
from __future__ import annotations from __future__ import annotations
...@@ -125,8 +126,7 @@ import faulthandler ...@@ -125,8 +126,7 @@ import faulthandler
import os import os
import re import re
import sys import sys
from typing import Any from typing import Any, Literal
from typing_extensions import Literal
from omni.isaac.kit import SimulationApp from omni.isaac.kit import SimulationApp
......
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Sequence
from prettytable import PrettyTable from prettytable import PrettyTable
from typing import TYPE_CHECKING, Sequence from typing import TYPE_CHECKING
import carb import carb
import omni.physics.tensors.impl.api as physx import omni.physics.tensors.impl.api as physx
...@@ -729,8 +730,7 @@ class Articulation(RigidObject): ...@@ -729,8 +730,7 @@ class Articulation(RigidObject):
table.align["Name"] = "l" table.align["Name"] = "l"
# add info on each term # add info on each term
for index, name in enumerate(self.joint_names): for index, name in enumerate(self.joint_names):
table.add_row( table.add_row([
[
index, index,
name, name,
stiffnesses[index], stiffnesses[index],
...@@ -740,7 +740,6 @@ class Articulation(RigidObject): ...@@ -740,7 +740,6 @@ class Articulation(RigidObject):
position_limits[index], position_limits[index],
velocity_limits[index], velocity_limits[index],
effort_limits[index], effort_limits[index],
] ])
)
# convert table to string # convert table to string
carb.log_info(f"Simulation parameters for joints in {self.cfg.prim_path}:\n" + table.get_string()) carb.log_info(f"Simulation parameters for joints in {self.cfg.prim_path}:\n" + table.get_string())
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
from dataclasses import MISSING from dataclasses import MISSING
from typing import Dict
from omni.isaac.orbit.actuators import ActuatorBaseCfg from omni.isaac.orbit.actuators import ActuatorBaseCfg
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
...@@ -24,9 +23,9 @@ class ArticulationCfg(RigidObjectCfg): ...@@ -24,9 +23,9 @@ class ArticulationCfg(RigidObjectCfg):
"""Initial state of the articulation.""" """Initial state of the articulation."""
# root position # root position
joint_pos: Dict[str, float] = {".*": 0.0} joint_pos: dict[str, float] = {".*": 0.0}
"""Joint positions of the joints. Defaults to 0.0 for all joints.""" """Joint positions of the joints. Defaults to 0.0 for all joints."""
joint_vel: Dict[str, float] = {".*": 0.0} joint_vel: dict[str, float] = {".*": 0.0}
"""Joint velocities of the joints. Defaults to 0.0 for all joints.""" """Joint velocities of the joints. Defaults to 0.0 for all joints."""
## ##
...@@ -38,5 +37,5 @@ class ArticulationCfg(RigidObjectCfg): ...@@ -38,5 +37,5 @@ class ArticulationCfg(RigidObjectCfg):
soft_joint_pos_limit_factor: float = 1.0 soft_joint_pos_limit_factor: float = 1.0
"""Fraction specifying the range of DOF position limits (parsed from the asset) to use. """Fraction specifying the range of DOF position limits (parsed from the asset) to use.
Defaults to 1.0.""" Defaults to 1.0."""
actuators: Dict[str, ActuatorBaseCfg] = MISSING actuators: dict[str, ActuatorBaseCfg] = MISSING
"""Actuators for the robot with corresponding joint names.""" """Actuators for the robot with corresponding joint names."""
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
import torch import torch
from dataclasses import dataclass from dataclasses import dataclass
from typing import List
from ..rigid_object import RigidObjectData from ..rigid_object import RigidObjectData
...@@ -18,7 +17,7 @@ class ArticulationData(RigidObjectData): ...@@ -18,7 +17,7 @@ class ArticulationData(RigidObjectData):
# Properties. # Properties.
## ##
joint_names: List[str] = None joint_names: list[str] = None
"""Joint names in the order parsed by the simulation view.""" """Joint names in the order parsed by the simulation view."""
## ##
......
...@@ -9,7 +9,8 @@ import inspect ...@@ -9,7 +9,8 @@ import inspect
import re import re
import weakref import weakref
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Any, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING, Any
import omni.kit.app import omni.kit.app
import omni.timeline import omni.timeline
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
from __future__ import annotations from __future__ import annotations
from dataclasses import MISSING from dataclasses import MISSING
from typing_extensions import Literal from typing import Literal
from omni.isaac.orbit.sim import SpawnerCfg from omni.isaac.orbit.sim import SpawnerCfg
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
import carb import carb
import omni.physics.tensors.impl.api as physx import omni.physics.tensors.impl.api as physx
......
...@@ -9,7 +9,7 @@ from __future__ import annotations ...@@ -9,7 +9,7 @@ from __future__ import annotations
import numpy as np import numpy as np
import torch import torch
from typing import Sequence from collections.abc import Sequence
import omni.isaac.core.utils.prims as prim_utils import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils import omni.isaac.core.utils.stage as stage_utils
......
...@@ -9,7 +9,7 @@ from __future__ import annotations ...@@ -9,7 +9,7 @@ from __future__ import annotations
import numpy as np import numpy as np
import torch import torch
from typing import Sequence from collections.abc import Sequence
import omni.isaac.core.utils.prims as prim_utils import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils import omni.isaac.core.utils.stage as stage_utils
......
...@@ -11,8 +11,9 @@ import builtins ...@@ -11,8 +11,9 @@ import builtins
import math import math
import numpy as np import numpy as np
import scipy.spatial.transform as tf import scipy.spatial.transform as tf
from collections.abc import Sequence
from dataclasses import dataclass from dataclasses import dataclass
from typing import Any, Sequence from typing import Any
import omni.isaac.core.utils.prims as prim_utils import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils import omni.isaac.core.utils.stage as stage_utils
......
...@@ -7,8 +7,8 @@ from __future__ import annotations ...@@ -7,8 +7,8 @@ from __future__ import annotations
import numpy as np import numpy as np
import scipy.spatial.transform as tf import scipy.spatial.transform as tf
from collections.abc import Sequence
from dataclasses import dataclass from dataclasses import dataclass
from typing import Sequence
import omni import omni
import omni.isaac.core.utils.prims as prim_utils import omni.isaac.core.utils.prims as prim_utils
......
...@@ -9,7 +9,7 @@ from __future__ import annotations ...@@ -9,7 +9,7 @@ from __future__ import annotations
import numpy as np import numpy as np
import torch import torch
from typing import Sequence from collections.abc import Sequence
import omni.isaac.core.utils.prims as prim_utils import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils import omni.isaac.core.utils.stage as stage_utils
......
...@@ -7,7 +7,7 @@ from __future__ import annotations ...@@ -7,7 +7,7 @@ from __future__ import annotations
import contextlib import contextlib
import math import math
from typing import Sequence from collections.abc import Sequence
import carb import carb
import omni.isaac.core.utils.nucleus as nucleus_utils import omni.isaac.core.utils.nucleus as nucleus_utils
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
from __future__ import annotations from __future__ import annotations
from dataclasses import MISSING from dataclasses import MISSING
from typing_extensions import Literal from typing import Literal
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Sequence
from dataclasses import MISSING from dataclasses import MISSING
from typing import Sequence
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Sequence
from dataclasses import MISSING from dataclasses import MISSING
from typing import Sequence
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit.utils.math import apply_delta_pose, compute_pose_error from omni.isaac.orbit.utils.math import apply_delta_pose, compute_pose_error
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
from __future__ import annotations from __future__ import annotations
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import Any, Callable from collections.abc import Callable
from typing import Any
class DeviceBase(ABC): class DeviceBase(ABC):
......
...@@ -9,7 +9,7 @@ from __future__ import annotations ...@@ -9,7 +9,7 @@ from __future__ import annotations
import numpy as np import numpy as np
import weakref import weakref
from typing import Callable from collections.abc import Callable
import carb import carb
import omni import omni
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
import numpy as np import numpy as np
import weakref import weakref
from collections.abc import Callable
from scipy.spatial.transform.rotation import Rotation from scipy.spatial.transform.rotation import Rotation
from typing import Callable, Tuple
import carb import carb
import omni import omni
...@@ -127,7 +127,7 @@ class Se3Gamepad(DeviceBase): ...@@ -127,7 +127,7 @@ class Se3Gamepad(DeviceBase):
""" """
self._additional_callbacks[key] = func self._additional_callbacks[key] = func
def advance(self) -> Tuple[np.ndarray, bool]: def advance(self) -> tuple[np.ndarray, bool]:
"""Provides the result from gamepad event state. """Provides the result from gamepad event state.
Returns: Returns:
......
...@@ -9,7 +9,7 @@ from __future__ import annotations ...@@ -9,7 +9,7 @@ from __future__ import annotations
import numpy as np import numpy as np
import weakref import weakref
from typing import Callable from collections.abc import Callable
import carb import carb
import omni import omni
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
import numpy as np import numpy as np
import weakref import weakref
from collections.abc import Callable
from scipy.spatial.transform.rotation import Rotation from scipy.spatial.transform.rotation import Rotation
from typing import Callable, Tuple
import carb import carb
import omni import omni
...@@ -117,7 +117,7 @@ class Se3Keyboard(DeviceBase): ...@@ -117,7 +117,7 @@ class Se3Keyboard(DeviceBase):
""" """
self._additional_callbacks[key] = func self._additional_callbacks[key] = func
def advance(self) -> Tuple[np.ndarray, bool]: def advance(self) -> tuple[np.ndarray, bool]:
"""Provides the result from keyboard event state. """Provides the result from keyboard event state.
Returns: Returns:
......
...@@ -11,7 +11,7 @@ import hid ...@@ -11,7 +11,7 @@ import hid
import numpy as np import numpy as np
import threading import threading
import time import time
from typing import Callable from collections.abc import Callable
from ..device_base import DeviceBase from ..device_base import DeviceBase
from .utils import convert_buffer from .utils import convert_buffer
......
...@@ -11,8 +11,8 @@ import hid ...@@ -11,8 +11,8 @@ import hid
import numpy as np import numpy as np
import threading import threading
import time import time
from collections.abc import Callable
from scipy.spatial.transform.rotation import Rotation from scipy.spatial.transform.rotation import Rotation
from typing import Callable
from ..device_base import DeviceBase from ..device_base import DeviceBase
from .utils import convert_buffer from .utils import convert_buffer
......
...@@ -7,7 +7,8 @@ from __future__ import annotations ...@@ -7,7 +7,8 @@ from __future__ import annotations
import builtins import builtins
import torch import torch
from typing import Any, Dict, Sequence, Union from collections.abc import Sequence
from typing import Any
import omni.isaac.core.utils.torch as torch_utils import omni.isaac.core.utils.torch as torch_utils
...@@ -18,7 +19,7 @@ from omni.isaac.orbit.utils.timer import Timer ...@@ -18,7 +19,7 @@ from omni.isaac.orbit.utils.timer import Timer
from .base_env_cfg import BaseEnvCfg from .base_env_cfg import BaseEnvCfg
VecEnvObs = Dict[str, Union[torch.Tensor, Dict[str, torch.Tensor]]] VecEnvObs = dict[str, torch.Tensor | dict[str, torch.Tensor]]
"""Observation returned by the environment. """Observation returned by the environment.
The observations are stored in a dictionary. The keys are the group to which the observations belong. The observations are stored in a dictionary. The keys are the group to which the observations belong.
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
from omni.isaac.orbit.managers import CommandTerm from omni.isaac.orbit.managers import CommandTerm
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
from omni.isaac.orbit.assets import Articulation from omni.isaac.orbit.assets import Articulation
from omni.isaac.orbit.managers import CommandTerm from omni.isaac.orbit.managers import CommandTerm
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
from omni.isaac.orbit.assets import Articulation from omni.isaac.orbit.assets import Articulation
from omni.isaac.orbit.managers import CommandTerm from omni.isaac.orbit.managers import CommandTerm
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
import omni.isaac.orbit.utils.math as math_utils import omni.isaac.orbit.utils.math as math_utils
from omni.isaac.orbit.assets import Articulation from omni.isaac.orbit.assets import Articulation
......
...@@ -11,7 +11,8 @@ the curriculum introduced by the function. ...@@ -11,7 +11,8 @@ the curriculum introduced by the function.
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
from omni.isaac.orbit.envs import RLTaskEnv from omni.isaac.orbit.envs import RLTaskEnv
......
...@@ -9,7 +9,8 @@ import gymnasium as gym ...@@ -9,7 +9,8 @@ import gymnasium as gym
import math import math
import numpy as np import numpy as np
import torch import torch
from typing import Any, ClassVar, Dict, Sequence, Tuple from collections.abc import Sequence
from typing import Any, ClassVar
from omni.isaac.version import get_version from omni.isaac.version import get_version
...@@ -18,7 +19,7 @@ from omni.isaac.orbit.managers import CommandManager, CurriculumManager, RewardM ...@@ -18,7 +19,7 @@ from omni.isaac.orbit.managers import CommandManager, CurriculumManager, RewardM
from .base_env import BaseEnv, VecEnvObs from .base_env import BaseEnv, VecEnvObs
from .rl_task_env_cfg import RLTaskEnvCfg from .rl_task_env_cfg import RLTaskEnvCfg
VecEnvStepReturn = Tuple[VecEnvObs, torch.Tensor, torch.Tensor, torch.Tensor, Dict] VecEnvStepReturn = tuple[VecEnvObs, torch.Tensor, torch.Tensor, torch.Tensor, dict]
"""The environment signals processed at the end of each step. """The environment signals processed at the end of each step.
The tuple contains batched information for each sub-environment. The information is stored in the following order: The tuple contains batched information for each sub-environment. The information is stored in the following order:
...@@ -286,12 +287,10 @@ class RLTaskEnv(BaseEnv, gym.Env): ...@@ -286,12 +287,10 @@ class RLTaskEnv(BaseEnv, gym.Env):
if has_concatenated_obs: if has_concatenated_obs:
self.single_observation_space[group_name] = gym.spaces.Box(low=-np.inf, high=np.inf, shape=group_dim) self.single_observation_space[group_name] = gym.spaces.Box(low=-np.inf, high=np.inf, shape=group_dim)
else: else:
self.single_observation_space[group_name] = gym.spaces.Dict( self.single_observation_space[group_name] = gym.spaces.Dict({
{
term_name: gym.spaces.Box(low=-np.inf, high=np.inf, shape=term_dim) term_name: gym.spaces.Box(low=-np.inf, high=np.inf, shape=term_dim)
for term_name, term_dim in zip(group_term_names, group_term_dim) for term_name, term_dim in zip(group_term_names, group_term_dim)
} })
)
# action space (unbounded since we don't impose any limits) # action space (unbounded since we don't impose any limits)
action_dim = sum(self.action_manager.action_term_dim) action_dim = sum(self.action_manager.action_term_dim)
self.single_action_space = gym.spaces.Box(low=-np.inf, high=np.inf, shape=(action_dim,)) self.single_action_space = gym.spaces.Box(low=-np.inf, high=np.inf, shape=(action_dim,))
......
...@@ -9,8 +9,9 @@ from __future__ import annotations ...@@ -9,8 +9,9 @@ from __future__ import annotations
import torch import torch
from abc import abstractmethod from abc import abstractmethod
from collections.abc import Sequence
from prettytable import PrettyTable from prettytable import PrettyTable
from typing import TYPE_CHECKING, Sequence from typing import TYPE_CHECKING
from omni.isaac.orbit.assets import AssetBase from omni.isaac.orbit.assets import AssetBase
......
...@@ -11,8 +11,9 @@ import inspect ...@@ -11,8 +11,9 @@ import inspect
import torch import torch
import weakref import weakref
from abc import abstractmethod from abc import abstractmethod
from collections.abc import Sequence
from prettytable import PrettyTable from prettytable import PrettyTable
from typing import TYPE_CHECKING, Sequence from typing import TYPE_CHECKING
import omni.kit.app import omni.kit.app
......
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Sequence
from prettytable import PrettyTable from prettytable import PrettyTable
from typing import TYPE_CHECKING, Sequence from typing import TYPE_CHECKING
from .manager_base import ManagerBase, ManagerTermBase from .manager_base import ManagerBase, ManagerTermBase
from .manager_term_cfg import CurriculumTermCfg from .manager_term_cfg import CurriculumTermCfg
......
...@@ -8,7 +8,8 @@ from __future__ import annotations ...@@ -8,7 +8,8 @@ from __future__ import annotations
import copy import copy
import inspect import inspect
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Any, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING, Any
import carb import carb
......
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Callable
from dataclasses import MISSING from dataclasses import MISSING
from typing import TYPE_CHECKING, Any, Callable from typing import TYPE_CHECKING, Any
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit.utils.noise import NoiseCfg from omni.isaac.orbit.utils.noise import NoiseCfg
......
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Sequence
from prettytable import PrettyTable from prettytable import PrettyTable
from typing import TYPE_CHECKING, Sequence from typing import TYPE_CHECKING
from .manager_base import ManagerBase, ManagerTermBase from .manager_base import ManagerBase, ManagerTermBase
from .manager_term_cfg import ObservationGroupCfg, ObservationTermCfg from .manager_term_cfg import ObservationGroupCfg, ObservationTermCfg
......
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Sequence
from prettytable import PrettyTable from prettytable import PrettyTable
from typing import TYPE_CHECKING, Sequence from typing import TYPE_CHECKING
import carb import carb
......
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Sequence
from prettytable import PrettyTable from prettytable import PrettyTable
from typing import TYPE_CHECKING, Sequence from typing import TYPE_CHECKING
from .manager_base import ManagerBase, ManagerTermBase from .manager_base import ManagerBase, ManagerTermBase
from .manager_term_cfg import RewardTermCfg from .manager_term_cfg import RewardTermCfg
......
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Sequence
from prettytable import PrettyTable from prettytable import PrettyTable
from typing import TYPE_CHECKING, Sequence from typing import TYPE_CHECKING
from .manager_base import ManagerBase, ManagerTermBase from .manager_base import ManagerBase, ManagerTermBase
from .manager_term_cfg import TerminationTermCfg from .manager_term_cfg import TerminationTermCfg
......
...@@ -7,7 +7,8 @@ from __future__ import annotations ...@@ -7,7 +7,8 @@ from __future__ import annotations
import builtins import builtins
import torch import torch
from typing import Any, Sequence from collections.abc import Sequence
from typing import Any
import carb import carb
import omni.usd import omni.usd
......
...@@ -9,9 +9,9 @@ import math ...@@ -9,9 +9,9 @@ import math
import numpy as np import numpy as np
import re import re
import torch import torch
from collections.abc import Sequence
from tensordict import TensorDict from tensordict import TensorDict
from typing import TYPE_CHECKING, Any, Sequence from typing import TYPE_CHECKING, Any, Literal
from typing_extensions import Literal
import omni.kit.commands import omni.kit.commands
import omni.usd import omni.usd
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
from __future__ import annotations from __future__ import annotations
from dataclasses import MISSING from dataclasses import MISSING
from typing_extensions import Literal from typing import Literal
from omni.isaac.orbit.sim import FisheyeCameraCfg, PinholeCameraCfg from omni.isaac.orbit.sim import FisheyeCameraCfg, PinholeCameraCfg
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -11,8 +11,8 @@ import math ...@@ -11,8 +11,8 @@ import math
import numpy as np import numpy as np
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F
from typing import Sequence from collections.abc import Sequence
from typing_extensions import Literal from typing import Literal
import omni.isaac.core.utils.stage as stage_utils import omni.isaac.core.utils.stage as stage_utils
import warp as wp import warp as wp
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
import omni.physics.tensors.impl.api as physx import omni.physics.tensors.impl.api as physx
from pxr import PhysxSchema from pxr import PhysxSchema
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
import carb import carb
import omni.physics.tensors.impl.api as physx import omni.physics.tensors.impl.api as physx
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Callable, Sequence
from dataclasses import MISSING from dataclasses import MISSING
from typing import Callable, Sequence
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -8,7 +8,8 @@ from __future__ import annotations ...@@ -8,7 +8,8 @@ from __future__ import annotations
import numpy as np import numpy as np
import re import re
import torch import torch
from typing import TYPE_CHECKING, ClassVar, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING, ClassVar
import carb import carb
import omni.physics.tensors.impl.api as physx import omni.physics.tensors.impl.api as physx
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Sequence
from tensordict import TensorDict from tensordict import TensorDict
from typing import TYPE_CHECKING, ClassVar, Sequence from typing import TYPE_CHECKING, ClassVar, Literal
from typing_extensions import Literal
import omni.physics.tensors.impl.api as physx import omni.physics.tensors.impl.api as physx
from omni.isaac.core.prims import XFormPrimView from omni.isaac.core.prims import XFormPrimView
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
from __future__ import annotations from __future__ import annotations
from typing_extensions import Literal from typing import Literal
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -15,7 +15,8 @@ import inspect ...@@ -15,7 +15,8 @@ import inspect
import torch import torch
import weakref import weakref
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Any, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING, Any
import omni.kit.app import omni.kit.app
import omni.timeline import omni.timeline
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
from __future__ import annotations from __future__ import annotations
from dataclasses import MISSING from dataclasses import MISSING
from typing_extensions import Literal from typing import Literal
from omni.isaac.orbit.sim.converters.asset_converter_base_cfg import AssetConverterBaseCfg from omni.isaac.orbit.sim.converters.asset_converter_base_cfg import AssetConverterBaseCfg
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -11,7 +11,7 @@ configuring the environment instances, viewer settings, and simulation parameter ...@@ -11,7 +11,7 @@ configuring the environment instances, viewer settings, and simulation parameter
from __future__ import annotations from __future__ import annotations
from typing_extensions import Literal from typing import Literal
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import MISSING from dataclasses import MISSING
from typing import Callable
from omni.isaac.orbit.sim import converters, schemas from omni.isaac.orbit.sim import converters, schemas
from omni.isaac.orbit.sim.spawners import materials from omni.isaac.orbit.sim.spawners import materials
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import MISSING from dataclasses import MISSING
from typing import Callable from typing import Literal
from typing_extensions import Literal
from omni.isaac.orbit.sim.spawners.spawner_cfg import SpawnerCfg from omni.isaac.orbit.sim.spawners.spawner_cfg import SpawnerCfg
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import MISSING from dataclasses import MISSING
from typing import Callable from typing import Literal
from typing_extensions import Literal
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import MISSING from dataclasses import MISSING
from typing import Callable
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
from __future__ import annotations from __future__ import annotations
from typing import Callable from collections.abc import Callable
from typing_extensions import Literal from typing import Literal
from omni.isaac.orbit.sim.spawners.spawner_cfg import SpawnerCfg from omni.isaac.orbit.sim.spawners.spawner_cfg import SpawnerCfg
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import MISSING from dataclasses import MISSING
from typing import Callable from typing import Literal
from typing_extensions import Literal
from omni.isaac.orbit.sim.spawners import materials from omni.isaac.orbit.sim.spawners import materials
from omni.isaac.orbit.sim.spawners.spawner_cfg import RigidObjectSpawnerCfg from omni.isaac.orbit.sim.spawners.spawner_cfg import RigidObjectSpawnerCfg
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable
from dataclasses import MISSING from dataclasses import MISSING
from typing import Callable
from pxr import Usd from pxr import Usd
......
...@@ -10,7 +10,8 @@ from __future__ import annotations ...@@ -10,7 +10,8 @@ from __future__ import annotations
import functools import functools
import inspect import inspect
import re import re
from typing import TYPE_CHECKING, Any, Callable from collections.abc import Callable
from typing import TYPE_CHECKING, Any
import carb import carb
import omni.isaac.core.utils.stage as stage_utils import omni.isaac.core.utils.stage as stage_utils
......
...@@ -9,7 +9,8 @@ import copy ...@@ -9,7 +9,8 @@ import copy
import functools import functools
import numpy as np import numpy as np
import trimesh import trimesh
from typing import TYPE_CHECKING, Callable from collections.abc import Callable
from typing import TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
from .hf_terrains_cfg import HfTerrainBaseCfg from .hf_terrains_cfg import HfTerrainBaseCfg
......
...@@ -16,9 +16,9 @@ from __future__ import annotations ...@@ -16,9 +16,9 @@ from __future__ import annotations
import numpy as np import numpy as np
import trimesh import trimesh
from collections.abc import Callable
from dataclasses import MISSING from dataclasses import MISSING
from typing import Callable from typing import Literal
from typing_extensions import Literal
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -8,7 +8,8 @@ from __future__ import annotations ...@@ -8,7 +8,8 @@ from __future__ import annotations
import numpy as np import numpy as np
import torch import torch
import trimesh import trimesh
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
import warp import warp
from pxr import UsdGeom from pxr import UsdGeom
......
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
from __future__ import annotations from __future__ import annotations
from dataclasses import MISSING from dataclasses import MISSING
from typing import TYPE_CHECKING from typing import TYPE_CHECKING, Literal
from typing_extensions import Literal
import omni.isaac.orbit.sim as sim_utils import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -809,12 +809,10 @@ def repeated_objects_terrain( ...@@ -809,12 +809,10 @@ def repeated_objects_terrain(
meshes_list = list() meshes_list = list()
# compute quantities # compute quantities
origin = np.asarray((0.5 * cfg.size[0], 0.5 * cfg.size[1], 0.5 * height)) origin = np.asarray((0.5 * cfg.size[0], 0.5 * cfg.size[1], 0.5 * height))
platform_corners = np.asarray( platform_corners = np.asarray([
[
[origin[0] - cfg.platform_width / 2, origin[1] - cfg.platform_width / 2], [origin[0] - cfg.platform_width / 2, origin[1] - cfg.platform_width / 2],
[origin[0] + cfg.platform_width / 2, origin[1] + cfg.platform_width / 2], [origin[0] + cfg.platform_width / 2, origin[1] + cfg.platform_width / 2],
] ])
)
platform_corners[0, :] *= 1 - platform_clearance platform_corners[0, :] *= 1 - platform_clearance
platform_corners[1, :] *= 1 + platform_clearance platform_corners[1, :] *= 1 + platform_clearance
# sample center for objects # sample center for objects
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
from __future__ import annotations from __future__ import annotations
from dataclasses import MISSING from dataclasses import MISSING
from typing_extensions import Literal from typing import Literal
import omni.isaac.orbit.terrains.trimesh.mesh_terrains as mesh_terrains import omni.isaac.orbit.terrains.trimesh.mesh_terrains as mesh_terrains
import omni.isaac.orbit.terrains.trimesh.utils as mesh_utils_terrains import omni.isaac.orbit.terrains.trimesh.utils as mesh_utils_terrains
......
...@@ -17,7 +17,7 @@ from __future__ import annotations ...@@ -17,7 +17,7 @@ from __future__ import annotations
import io import io
import os import os
import tempfile import tempfile
from typing_extensions import Literal from typing import Literal
import carb import carb
import omni.client import omni.client
......
...@@ -8,10 +8,10 @@ from __future__ import annotations ...@@ -8,10 +8,10 @@ from __future__ import annotations
"""Sub-module that provides a wrapper around the Python 3.7 onwards ``dataclasses`` module.""" """Sub-module that provides a wrapper around the Python 3.7 onwards ``dataclasses`` module."""
import inspect import inspect
import sys from collections.abc import Callable
from copy import deepcopy from copy import deepcopy
from dataclasses import MISSING, Field, dataclass, field, replace from dataclasses import MISSING, Field, dataclass, field, replace
from typing import Any, Callable, ClassVar from typing import Any, ClassVar
from .dict import class_to_dict, update_class_from_dict from .dict import class_to_dict, update_class_from_dict
...@@ -228,9 +228,6 @@ def _add_annotation_types(cls): ...@@ -228,9 +228,6 @@ def _add_annotation_types(cls):
elif key != value.__name__: elif key != value.__name__:
# note: we don't want to add type annotations for nested configclass. Thus, we check if # note: we don't want to add type annotations for nested configclass. Thus, we check if
# the name of the type matches the name of the variable. # the name of the type matches the name of the variable.
if sys.version_info < (3, 10):
hints[key] = type[value]
else:
# since Python 3.10, type hints are stored as strings # since Python 3.10, type hints are stored as strings
hints[key] = f"type[{value.__name__}]" hints[key] = f"type[{value.__name__}]"
......
...@@ -10,7 +10,8 @@ from __future__ import annotations ...@@ -10,7 +10,8 @@ from __future__ import annotations
import collections.abc import collections.abc
import hashlib import hashlib
import json import json
from typing import Any, Iterable, Mapping from collections.abc import Iterable, Mapping
from typing import Any
from .array import TENSOR_TYPE_CONVERSIONS, TENSOR_TYPES from .array import TENSOR_TYPE_CONVERSIONS, TENSOR_TYPES
from .string import callable_to_string, string_to_callable from .string import callable_to_string, string_to_callable
......
...@@ -7,12 +7,11 @@ ...@@ -7,12 +7,11 @@
import os import os
import yaml import yaml
from typing import Dict, Union
from omni.isaac.orbit.utils import class_to_dict from omni.isaac.orbit.utils import class_to_dict
def load_yaml(filename: str) -> Dict: def load_yaml(filename: str) -> dict:
"""Loads an input PKL file safely. """Loads an input PKL file safely.
Args: Args:
...@@ -31,7 +30,7 @@ def load_yaml(filename: str) -> Dict: ...@@ -31,7 +30,7 @@ def load_yaml(filename: str) -> Dict:
return data return data
def dump_yaml(filename: str, data: Union[Dict, object], sort_keys: bool = False): def dump_yaml(filename: str, data: dict | object, sort_keys: bool = False):
"""Saves data into a YAML file safely. """Saves data into a YAML file safely.
Note: Note:
......
...@@ -10,7 +10,7 @@ from __future__ import annotations ...@@ -10,7 +10,7 @@ from __future__ import annotations
import numpy as np import numpy as np
import torch import torch
import torch.nn.functional import torch.nn.functional
from typing_extensions import Literal from typing import Literal
""" """
General General
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
from __future__ import annotations from __future__ import annotations
import torch import torch
from collections.abc import Callable
from dataclasses import MISSING from dataclasses import MISSING
from typing import Callable
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -11,7 +11,8 @@ import ast ...@@ -11,7 +11,8 @@ import ast
import importlib import importlib
import inspect import inspect
import re import re
from typing import Any, Callable, Sequence from collections.abc import Callable, Sequence
from typing import Any
""" """
String formatting. String formatting.
......
...@@ -28,8 +28,7 @@ INSTALL_REQUIRES = [ ...@@ -28,8 +28,7 @@ INSTALL_REQUIRES = [
"gymnasium==0.29.0", "gymnasium==0.29.0",
# procedural-generation # procedural-generation
"trimesh", "trimesh",
"pyglet==1.5.27; python_version < '3.8'", # pyglet 2.0 requires python 3.8 "pyglet",
"pyglet; python_version >= '3.8'",
] ]
# Installation operation # Installation operation
...@@ -44,13 +43,14 @@ setup( ...@@ -44,13 +43,14 @@ setup(
keywords=EXTENSION_TOML_DATA["package"]["keywords"], keywords=EXTENSION_TOML_DATA["package"]["keywords"],
license="BSD-3-Clause", license="BSD-3-Clause",
include_package_data=True, include_package_data=True,
python_requires=">=3.7", python_requires=">=3.10",
install_requires=INSTALL_REQUIRES, install_requires=INSTALL_REQUIRES,
packages=["omni.isaac.orbit"], packages=["omni.isaac.orbit"],
classifiers=[ classifiers=[
"Natural Language :: English", "Natural Language :: English",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Isaac Sim :: 2023.1.0-hotfix.1", "Isaac Sim :: 2023.1.0-hotfix.1",
"Isaac Sim :: 2023.1.1",
], ],
zip_safe=False, zip_safe=False,
) )
...@@ -19,12 +19,12 @@ simulation_app = app_launcher.app ...@@ -19,12 +19,12 @@ simulation_app = app_launcher.app
import copy import copy
import os import os
import sys
import traceback import traceback
import unittest import unittest
from collections.abc import Callable
from dataclasses import MISSING, asdict, field from dataclasses import MISSING, asdict, field
from functools import wraps from functools import wraps
from typing import Callable, ClassVar from typing import ClassVar
import carb import carb
...@@ -651,10 +651,7 @@ class TestConfigClass(unittest.TestCase): ...@@ -651,10 +651,7 @@ class TestConfigClass(unittest.TestCase):
cfg = DummyClassCfg() cfg = DummyClassCfg()
# since python 3.10, annotations are stored as strings # since python 3.10, annotations are stored as strings
if sys.version_info >= (3, 10):
annotations = {k: eval(v) for k, v in cfg.__annotations__.items()} annotations = {k: eval(v) for k, v in cfg.__annotations__.items()}
else:
annotations = cfg.__annotations__
# check types # check types
self.assertEqual(annotations["class_name_1"], type) self.assertEqual(annotations["class_name_1"], type)
self.assertEqual(annotations["class_name_2"], type[DummyClass]) self.assertEqual(annotations["class_name_2"], type[DummyClass])
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
"""Configuration for a simple Cartpole robot """Configuration for a simple Cartpole robot."""
"""
from __future__ import annotations from __future__ import annotations
......
...@@ -26,8 +26,13 @@ setup( ...@@ -26,8 +26,13 @@ setup(
description=EXTENSION_TOML_DATA["package"]["description"], description=EXTENSION_TOML_DATA["package"]["description"],
keywords=EXTENSION_TOML_DATA["package"]["keywords"], keywords=EXTENSION_TOML_DATA["package"]["keywords"],
include_package_data=True, include_package_data=True,
python_requires=">=3.7", python_requires=">=3.10",
packages=["omni.isaac.orbit_assets"], packages=["omni.isaac.orbit_assets"],
classifiers=["Natural Language :: English", "Programming Language :: Python :: 3.7"], classifiers=[
"Natural Language :: English",
"Programming Language :: Python :: 3.10",
"Isaac Sim :: 2023.1.0-hotfix.1",
"Isaac Sim :: 2023.1.1",
],
zip_safe=False, zip_safe=False,
) )
...@@ -2,7 +2,7 @@ Changelog ...@@ -2,7 +2,7 @@ Changelog
--------- ---------
0.5.5 (2024-02-05) 0.5.5 (2024-02-05)
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
Fixed Fixed
^^^^^ ^^^^^
......
...@@ -12,7 +12,8 @@ the curriculum introduced by the function. ...@@ -12,7 +12,8 @@ the curriculum introduced by the function.
from __future__ import annotations from __future__ import annotations
import torch import torch
from typing import TYPE_CHECKING, Sequence from collections.abc import Sequence
from typing import TYPE_CHECKING
from omni.isaac.orbit.assets import Articulation from omni.isaac.orbit.assets import Articulation
from omni.isaac.orbit.managers import SceneEntityCfg from omni.isaac.orbit.managers import SceneEntityCfg
......
...@@ -12,7 +12,7 @@ import json ...@@ -12,7 +12,7 @@ import json
import numpy as np import numpy as np
import os import os
import torch import torch
from typing import Iterable from collections.abc import Iterable
import carb import carb
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
from __future__ import annotations from __future__ import annotations
from dataclasses import MISSING from dataclasses import MISSING
from typing_extensions import Literal from typing import Literal
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
......
...@@ -247,12 +247,10 @@ class SkrlSequentialLogTrainer(Trainer): ...@@ -247,12 +247,10 @@ class SkrlSequentialLogTrainer(Trainer):
for timestep in tqdm.tqdm(range(self.initial_timestep, self.timesteps), disable=self.disable_progressbar): for timestep in tqdm.tqdm(range(self.initial_timestep, self.timesteps), disable=self.disable_progressbar):
# compute actions # compute actions
with torch.no_grad(): with torch.no_grad():
actions = torch.vstack( actions = torch.vstack([
[
agent.act(states[scope[0] : scope[1]], timestep=timestep, timesteps=self.timesteps)[0] agent.act(states[scope[0] : scope[1]], timestep=timestep, timesteps=self.timesteps)[0]
for agent, scope in zip(self.agents, self.agents_scope) for agent, scope in zip(self.agents, self.agents_scope)
] ])
)
# step the environments # step the environments
next_states, rewards, terminated, truncated, infos = self.env.step(actions) next_states, rewards, terminated, truncated, infos = self.env.step(actions)
......
...@@ -54,7 +54,7 @@ setup( ...@@ -54,7 +54,7 @@ setup(
description=EXTENSION_TOML_DATA["package"]["description"], description=EXTENSION_TOML_DATA["package"]["description"],
keywords=EXTENSION_TOML_DATA["package"]["keywords"], keywords=EXTENSION_TOML_DATA["package"]["keywords"],
include_package_data=True, include_package_data=True,
python_requires=">=3.7", python_requires=">=3.10",
install_requires=INSTALL_REQUIRES, install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE, extras_require=EXTRAS_REQUIRE,
packages=["omni.isaac.orbit_tasks"], packages=["omni.isaac.orbit_tasks"],
...@@ -62,6 +62,7 @@ setup( ...@@ -62,6 +62,7 @@ setup(
"Natural Language :: English", "Natural Language :: English",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Isaac Sim :: 2023.1.0-hotfix.1", "Isaac Sim :: 2023.1.0-hotfix.1",
"Isaac Sim :: 2023.1.1",
], ],
zip_safe=False, zip_safe=False,
) )
...@@ -39,7 +39,7 @@ simulation_app = app_launcher.app ...@@ -39,7 +39,7 @@ simulation_app = app_launcher.app
import gymnasium as gym import gymnasium as gym
import torch import torch
import traceback import traceback
from typing import Sequence from collections.abc import Sequence
import carb import carb
import warp as wp import warp as wp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment