Commit 779107fc authored by Mayank Mittal's avatar Mayank Mittal Committed by Mayank Mittal

Fixes building of documentation due to illegal unions (#506)

With remove of many future imports, it seems Sphinx doc generation was
sensitive to it. Hence, the docs were not building anymore. This MR
makes sure that those issues are resolved properly.

Built the docs locally and they work fine.

- Bug fix (non-breaking change which fixes an issue)

- [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 91f8a03e
...@@ -17,7 +17,7 @@ This guide is accompanied by a sample script ``markers.py`` in the ``orbit/sourc ...@@ -17,7 +17,7 @@ This guide is accompanied by a sample script ``markers.py`` in the ``orbit/sourc
.. literalinclude:: ../../../source/standalone/demos/markers.py .. literalinclude:: ../../../source/standalone/demos/markers.py
:language: python :language: python
:emphasize-lines: 49-97, 112-113, 142-148 :emphasize-lines: 45-90, 106-107, 136-142
:linenos: :linenos:
...@@ -43,7 +43,7 @@ configured from USD files. ...@@ -43,7 +43,7 @@ configured from USD files.
.. literalinclude:: ../../../source/standalone/demos/markers.py .. literalinclude:: ../../../source/standalone/demos/markers.py
:language: python :language: python
:lines: 49-97 :lines: 45-90
:dedent: :dedent:
...@@ -55,7 +55,7 @@ as arguments the pose of the markers and the corresponding marker prototypes to ...@@ -55,7 +55,7 @@ as arguments the pose of the markers and the corresponding marker prototypes to
.. literalinclude:: ../../../source/standalone/demos/markers.py .. literalinclude:: ../../../source/standalone/demos/markers.py
:language: python :language: python
:lines: 142-148 :lines: 136-142
:dedent: :dedent:
......
...@@ -46,7 +46,7 @@ The last two parameters are optional. If not specified, they are kept at their d ...@@ -46,7 +46,7 @@ The last two parameters are optional. If not specified, they are kept at their d
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_assets/omni/isaac/orbit_assets/cartpole.py .. literalinclude:: ../../../source/extensions/omni.isaac.orbit_assets/omni/isaac/orbit_assets/cartpole.py
:language: python :language: python
:lines: 17-33 :lines: 15-31
:dedent: :dedent:
To import articulation from a URDF file instead of a USD file, you can replace the To import articulation from a URDF file instead of a USD file, you can replace the
...@@ -74,7 +74,7 @@ Meanwhile, the joint positions and velocities are set to 0.0. ...@@ -74,7 +74,7 @@ Meanwhile, the joint positions and velocities are set to 0.0.
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_assets/omni/isaac/orbit_assets/cartpole.py .. literalinclude:: ../../../source/extensions/omni.isaac.orbit_assets/omni/isaac/orbit_assets/cartpole.py
:language: python :language: python
:lines: 34-36 :lines: 32-34
:dedent: :dedent:
Defining the actuator configuration Defining the actuator configuration
...@@ -96,7 +96,7 @@ to combine them into a single actuator model. ...@@ -96,7 +96,7 @@ to combine them into a single actuator model.
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_assets/omni/isaac/orbit_assets/cartpole.py .. literalinclude:: ../../../source/extensions/omni.isaac.orbit_assets/omni/isaac/orbit_assets/cartpole.py
:language: python :language: python
:lines: 37-47 :lines: 35-45
:dedent: :dedent:
......
...@@ -23,7 +23,7 @@ directory. ...@@ -23,7 +23,7 @@ directory.
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py .. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_articulation.py
:language: python :language: python
:emphasize-lines: 60-71, 93-106, 110-113, 118-119 :emphasize-lines: 58-69, 91-104, 108-111, 116-117
:linenos: :linenos:
......
...@@ -20,7 +20,7 @@ The tutorial corresponds to the ``run_rigid_object.py`` script in the ``orbit/so ...@@ -20,7 +20,7 @@ The tutorial corresponds to the ``run_rigid_object.py`` script in the ``orbit/so
.. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_rigid_object.py .. literalinclude:: ../../../../source/standalone/tutorials/01_assets/run_rigid_object.py
:language: python :language: python
:emphasize-lines: 57-76, 78-80, 100-110, 113-114, 120-121, 134-136, 141-142 :emphasize-lines: 55-74, 76-78, 98-108, 111-112, 118-119, 132-134, 139-140
:linenos: :linenos:
......
...@@ -40,7 +40,7 @@ This tutorial corresponds to the ``create_scene.py`` script within ...@@ -40,7 +40,7 @@ This tutorial corresponds to the ``create_scene.py`` script within
.. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py .. literalinclude:: ../../../../source/standalone/tutorials/02_scene/create_scene.py
:language: python :language: python
:emphasize-lines: 52-65, 70-72, 93-94, 101-102, 107-108, 118-120 :emphasize-lines: 50-63, 68-70, 91-92, 99-100, 105-106, 116-118
:linenos: :linenos:
......
...@@ -32,7 +32,7 @@ directory. ...@@ -32,7 +32,7 @@ directory.
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/create_cartpole_base_env.py .. literalinclude:: ../../../../source/standalone/tutorials/03_envs/create_cartpole_base_env.py
:language: python :language: python
:emphasize-lines: 49-53, 56-73, 76-109, 112-131, 136-140, 145, 149, 154-155, 161-162 :emphasize-lines: 47-51, 54-71, 74-108, 111-130, 135-139, 144, 148, 153-154, 160-161
:linenos: :linenos:
......
...@@ -49,7 +49,7 @@ The script for running the environment ``run_cartpole_rl_env.py`` is present in ...@@ -49,7 +49,7 @@ The script for running the environment ``run_cartpole_rl_env.py`` is present in
.. literalinclude:: ../../../../source/standalone/tutorials/03_envs/run_cartpole_rl_env.py .. literalinclude:: ../../../../source/standalone/tutorials/03_envs/run_cartpole_rl_env.py
:language: python :language: python
:emphasize-lines: 43-47, 61-62 :emphasize-lines: 38-42, 56-57
:linenos: :linenos:
......
...@@ -26,7 +26,7 @@ the :meth:`gymnasium.make` function. ...@@ -26,7 +26,7 @@ the :meth:`gymnasium.make` function.
.. literalinclude:: ../../../../source/standalone/environments/random_agent.py .. literalinclude:: ../../../../source/standalone/environments/random_agent.py
:language: python :language: python
:lines: 40-51 :lines: 36-47
The Code The Code
...@@ -39,7 +39,7 @@ The tutorial corresponds to the ``random_agent.py`` script in the ``orbit/source ...@@ -39,7 +39,7 @@ The tutorial corresponds to the ``random_agent.py`` script in the ``orbit/source
.. literalinclude:: ../../../../source/standalone/environments/random_agent.py .. literalinclude:: ../../../../source/standalone/environments/random_agent.py
:language: python :language: python
:emphasize-lines: 39-41, 46-51 :emphasize-lines: 36-37, 42-47
:linenos: :linenos:
......
...@@ -40,7 +40,7 @@ For this tutorial, we use the training script from `Stable-Baselines3`_ workflow ...@@ -40,7 +40,7 @@ For this tutorial, we use the training script from `Stable-Baselines3`_ workflow
.. literalinclude:: ../../../../source/standalone/workflows/sb3/train.py .. literalinclude:: ../../../../source/standalone/workflows/sb3/train.py
:language: python :language: python
:emphasize-lines: 58, 61, 67-69, 78, 92-96, 98-99, 102-110, 112, 117-125, 127-128, 135-138 :emphasize-lines: 57, 66, 68-70, 81, 90-98, 100, 105-113, 115-116, 121-126, 133-136
:linenos: :linenos:
The Code Explained The Code Explained
......
...@@ -37,7 +37,7 @@ The tutorial corresponds to the ``add_sensors_on_robot.py`` script in the ...@@ -37,7 +37,7 @@ The tutorial corresponds to the ``add_sensors_on_robot.py`` script in the
.. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py .. literalinclude:: ../../../../source/standalone/tutorials/04_sensors/add_sensors_on_robot.py
:language: python :language: python
:emphasize-lines: 74-97, 145-155, 169-170 :emphasize-lines: 72-95, 143-153, 167-168
:linenos: :linenos:
......
...@@ -25,7 +25,7 @@ The tutorial corresponds to the ``run_diff_ik.py`` script in the ...@@ -25,7 +25,7 @@ The tutorial corresponds to the ``run_diff_ik.py`` script in the
.. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py .. literalinclude:: ../../../../source/standalone/tutorials/05_controllers/run_diff_ik.py
:language: python :language: python
:emphasize-lines: 100-102, 123-138, 157-159, 163-173 :emphasize-lines: 98-100, 121-136, 155-157, 161-171
:linenos: :linenos:
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# needed to import for allowing type-hinting: np.ndarray | None
from __future__ import annotations
import gymnasium as gym import gymnasium as gym
import math import math
import numpy as np import numpy as np
......
...@@ -16,6 +16,9 @@ The marker prototypes can be configured with the :class:`VisualizationMarkersCfg ...@@ -16,6 +16,9 @@ The marker prototypes can be configured with the :class:`VisualizationMarkersCfg
.. _UsdGeom.PointInstancer: https://graphics.pixar.com/usd/dev/api/class_usd_geom_point_instancer.html .. _UsdGeom.PointInstancer: https://graphics.pixar.com/usd/dev/api/class_usd_geom_point_instancer.html
""" """
# needed to import for allowing type-hinting: np.ndarray | torch.Tensor | None
from __future__ import annotations
import numpy as np import numpy as np
import torch import torch
from dataclasses import MISSING from dataclasses import MISSING
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
"""Helper functions to project between pointcloud and depth images.""" """Helper functions to project between pointcloud and depth images."""
# needed to import for allowing type-hinting: torch.device | str | None
from __future__ import annotations
import math import math
import numpy as np import numpy as np
import torch import torch
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# needed to import for allowing type-hinting: torch.Tensor | None
from __future__ import annotations
import torch import torch
from dataclasses import dataclass from dataclasses import dataclass
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# All rights reserved. # All rights reserved.
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# needed to import for allowing type-hinting: Usd.Stage | None
from __future__ import annotations
import carb import carb
import omni.isaac.core.utils.stage as stage_utils import omni.isaac.core.utils.stage as stage_utils
from pxr import PhysxSchema, Usd, UsdPhysics from pxr import PhysxSchema, Usd, UsdPhysics
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# needed to import for allowing type-hinting: np.ndarray | torch.Tensor | None
from __future__ import annotations
import numpy as np import numpy as np
import torch import torch
import trimesh import trimesh
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
"""Sub-module containing utilities for working with different array backends.""" """Sub-module containing utilities for working with different array backends."""
# needed to import for allowing type-hinting: torch.device | str | None
from __future__ import annotations
import numpy as np import numpy as np
import torch import torch
from typing import Union from typing import Union
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
"""Sub-module containing utilities for various math operations.""" """Sub-module containing utilities for various math operations."""
# needed to import for allowing type-hinting: torch.Tensor | np.ndarray
from __future__ import annotations
import numpy as np import numpy as np
import torch import torch
import torch.nn.functional import torch.nn.functional
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
"""Wrapping around warp kernels for compatibility with torch tensors.""" """Wrapping around warp kernels for compatibility with torch tensors."""
# needed to import for allowing type-hinting: torch.Tensor | None
from __future__ import annotations
import numpy as np import numpy as np
import torch import torch
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# needed to import for allowing type-hinting: torch.Tensor | None
from __future__ import annotations
"""Launch Isaac Sim Simulator first.""" """Launch Isaac Sim Simulator first."""
from omni.isaac.orbit.app import AppLauncher, run_tests from omni.isaac.orbit.app import AppLauncher, run_tests
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
"""Interface to collect and store data from the environment using format from `robomimic`.""" """Interface to collect and store data from the environment using format from `robomimic`."""
# needed to import for allowing type-hinting: np.ndarray | torch.Tensor
from __future__ import annotations
import h5py import h5py
import json import json
......
...@@ -31,6 +31,8 @@ for RL-Games :class:`Runner` class: ...@@ -31,6 +31,8 @@ for RL-Games :class:`Runner` class:
""" """
# needed to import for allowing type-hinting:gym.spaces.Box | None
from __future__ import annotations
import gym.spaces # needed for rl-games incompatibility: https://github.com/Denys88/rl_games/issues/261 import gym.spaces # needed for rl-games incompatibility: https://github.com/Denys88/rl_games/issues/261
import gymnasium import gymnasium
......
...@@ -15,6 +15,8 @@ The following example shows how to wrap an environment for Stable-Baselines3: ...@@ -15,6 +15,8 @@ The following example shows how to wrap an environment for Stable-Baselines3:
""" """
# needed to import for allowing type-hinting: torch.Tensor | dict[str, torch.Tensor]
from __future__ import annotations
import gymnasium as gym import gymnasium as gym
import numpy as np import numpy as np
......
...@@ -23,6 +23,9 @@ Or, equivalently, by directly calling the skrl library API as follows: ...@@ -23,6 +23,9 @@ Or, equivalently, by directly calling the skrl library API as follows:
""" """
# needed to import for type hinting: Agent | list[Agent]
from __future__ import annotations
import copy import copy
import torch import torch
import tqdm import tqdm
......
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