Skip to content

Commit 03d30b5

Browse files
committed
update stubs
1 parent 93d5fed commit 03d30b5

File tree

8 files changed

+734
-337
lines changed

8 files changed

+734
-337
lines changed

python/py_package/__init__.pyi

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22
from _warnings import warn
33
import os as os
4-
from pathlib import Path
4+
from pathlib._local import Path
55
import pkg_resources as pkg_resources
66
import platform as platform
77
from sapien.pysapien import Component
@@ -14,10 +14,7 @@ from sapien.pysapien import math
1414
from sapien.pysapien.physx import PhysxSceneConfig as SceneConfig
1515
from sapien.pysapien import profile
1616
from sapien.pysapien import set_log_level
17-
18-
import platform
19-
if platform.system() != "Darwin":
20-
from sapien.pysapien import simsense
17+
from sapien.pysapien import simsense
2118
from sapien.pysapien_pinocchio import PinocchioModel
2219
from sapien.wrapper.actor_builder import ActorBuilder
2320
from sapien.wrapper.articulation_builder import ArticulationBuilder
@@ -36,10 +33,6 @@ from . import render
3633
from . import utils
3734
from . import version
3835
from . import wrapper
39-
40-
if platform.system() == "Darwin":
41-
__all__ = ['ActorBuilder', 'ArticulationBuilder', 'Component', 'CudaArray', 'Device', 'Engine', 'Entity', 'Path', 'PinocchioModel', 'Pose', 'SapienRenderer', 'Scene', 'SceneConfig', 'System', 'Widget', 'asset', 'internal_renderer', 'math', 'os', 'physx', 'pkg_resources', 'platform', 'profile', 'pysapien', 'pysapien_pinocchio', 'render', 'set_log_level', 'utils', 'version', 'warn', 'wrapper']
42-
else:
43-
__all__ = ['ActorBuilder', 'ArticulationBuilder', 'Component', 'CudaArray', 'Device', 'Engine', 'Entity', 'Path', 'PinocchioModel', 'Pose', 'SapienRenderer', 'Scene', 'SceneConfig', 'System', 'Widget', 'asset', 'internal_renderer', 'math', 'os', 'physx', 'pkg_resources', 'platform', 'profile', 'pysapien', 'pysapien_pinocchio', 'render', 'set_log_level', 'simsense', 'utils', 'version', 'warn', 'wrapper']
44-
__version__: str = '3.0.0.dev20240521+6b6d61d2'
45-
__warningregistry__: dict = {'version': 0}
36+
__all__ = ['ActorBuilder', 'ArticulationBuilder', 'Component', 'CudaArray', 'Device', 'Engine', 'Entity', 'Path', 'PinocchioModel', 'Pose', 'SapienRenderer', 'Scene', 'SceneConfig', 'System', 'Widget', 'asset', 'internal_renderer', 'math', 'os', 'physx', 'pkg_resources', 'platform', 'profile', 'pysapien', 'pysapien_pinocchio', 'render', 'set_log_level', 'simsense', 'utils', 'version', 'warn', 'wrapper']
37+
__version__: str = '3.0.0.dev20250717+93d5fedf'
38+
__warningregistry__: dict = {'version': 0, ('pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.', UserWarning, 18): True}

python/py_package/pysapien/__init__.pyi

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
from __future__ import annotations
22
import jax
33
import numpy
4+
import numpy.typing
45
import torch
56
import typing
67
from . import internal_renderer
78
from . import math
89
from . import physx
910
from . import render
10-
11-
import platform
12-
if platform.system() == "Darwin":
13-
__all__ = ['Component', 'CudaArray', 'Device', 'Entity', 'Pose', 'Profiler', 'Scene', 'System', 'abi_version', 'compiled_with_cxx11_abi', 'internal_renderer', 'math', 'physx', 'profile', 'pybind11_internals_id', 'pybind11_use_smart_holder', 'render', 'set_log_level']
14-
else:
15-
from . import simsense
16-
__all__ = ['Component', 'CudaArray', 'Device', 'Entity', 'Pose', 'Profiler', 'Scene', 'System', 'abi_version', 'compiled_with_cxx11_abi', 'internal_renderer', 'math', 'physx', 'profile', 'pybind11_internals_id', 'pybind11_use_smart_holder', 'render', 'set_log_level', 'simsense']
11+
from . import simsense
12+
__all__ = ['Component', 'CudaArray', 'Device', 'Entity', 'Pose', 'Profiler', 'Scene', 'System', 'abi_version', 'compiled_with_cxx11_abi', 'internal_renderer', 'math', 'physx', 'profile', 'pybind11_internals_id', 'pybind11_use_smart_holder', 'render', 'set_log_level', 'simsense']
1713
_T = typing.TypeVar("_T", Component)
1814
class Component:
1915
entity_pose: Pose
2016
name: str
2117
pose: Pose
18+
@staticmethod
19+
def _pybind11_conduit_v1_(*args, **kwargs):
20+
...
2221
def __init__(self) -> None:
2322
...
2423
def disable(self) -> None:
@@ -50,6 +49,9 @@ class Component:
5049
def is_enabled(self) -> bool:
5150
...
5251
class CudaArray:
52+
@staticmethod
53+
def _pybind11_conduit_v1_(*args, **kwargs):
54+
...
5355
def __init__(self, data: typing.Any) -> None:
5456
...
5557
def dlpack(self) -> typing.Any:
@@ -77,6 +79,9 @@ class CudaArray:
7779
def typestr(self) -> str:
7880
...
7981
class Device:
82+
@staticmethod
83+
def _pybind11_conduit_v1_(*args, **kwargs):
84+
...
8085
def __init__(self, alias: str) -> None:
8186
...
8287
def __repr__(self) -> str:
@@ -103,6 +108,9 @@ class Device:
103108
class Entity:
104109
name: str
105110
pose: Pose
111+
@staticmethod
112+
def _pybind11_conduit_v1_(*args, **kwargs):
113+
...
106114
def __init__(self) -> None:
107115
...
108116
def add_component(self, component: Component) -> Entity:
@@ -147,13 +155,16 @@ class Pose:
147155
p: numpy.ndarray[typing.Literal[3], numpy.dtype[numpy.float32]]
148156
q: numpy.ndarray[typing.Literal[4], numpy.dtype[numpy.float32]]
149157
rpy: numpy.ndarray[typing.Literal[3], numpy.dtype[numpy.float32]]
158+
@staticmethod
159+
def _pybind11_conduit_v1_(*args, **kwargs):
160+
...
150161
def __getstate__(self) -> tuple:
151162
...
152163
@typing.overload
153164
def __init__(self, p: numpy.ndarray[typing.Literal[3], numpy.dtype[numpy.float32]] | list[float] | tuple = ..., q: numpy.ndarray[typing.Literal[4], numpy.dtype[numpy.float32]] | list[float] | tuple = ...) -> None:
154165
...
155166
@typing.overload
156-
def __init__(self, matrix: numpy.ndarray[tuple[typing.Literal[4], typing.Literal[4]], numpy.dtype[numpy.float32]] | list | tuple) -> None:
167+
def __init__(self, matrix: typing.Annotated[numpy.typing.ArrayLike, numpy.float32, "[4, 4]"]) -> None:
157168
...
158169
def __mul__(self, other: Pose) -> Pose:
159170
...
@@ -175,9 +186,12 @@ class Pose:
175186
...
176187
def set_rpy(self, rpy: numpy.ndarray[typing.Literal[3], numpy.dtype[numpy.float32]] | list[float] | tuple) -> None:
177188
...
178-
def to_transformation_matrix(self) -> numpy.ndarray[tuple[typing.Literal[4], typing.Literal[4]], numpy.dtype[numpy.float32]]:
189+
def to_transformation_matrix(self) -> typing.Annotated[numpy.typing.NDArray[numpy.float32], "[4, 4]"]:
179190
...
180191
class Profiler:
192+
@staticmethod
193+
def _pybind11_conduit_v1_(*args, **kwargs):
194+
...
181195
def __call__(self, func: typing.Callable) -> typing.Callable:
182196
...
183197
def __enter__(self) -> None:
@@ -187,6 +201,9 @@ class Profiler:
187201
def __init__(self, name: str) -> None:
188202
...
189203
class Scene:
204+
@staticmethod
205+
def _pybind11_conduit_v1_(*args, **kwargs):
206+
...
190207
def __init__(self, systems: list[System]) -> None:
191208
...
192209
def add_entity(self, entity: Entity) -> None:
@@ -224,6 +241,9 @@ class Scene:
224241
def render_system(self) -> render.RenderSystem:
225242
...
226243
class System:
244+
@staticmethod
245+
def _pybind11_conduit_v1_(*args, **kwargs):
246+
...
227247
def __init__(self) -> None:
228248
...
229249
def step(self) -> None:

0 commit comments

Comments
 (0)