Update doc/mjwarp/update_types.py
PiperOrigin-RevId: 903289569 Change-Id: I7e05736c54fa72dc0c89152f49cf3d9ee6e5492d
This commit is contained in:
committed by
Copybara-Service
parent
ba149aa043
commit
c3fddf5dc1
@@ -29,7 +29,7 @@ This script updates such instances with valid types
|
|||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
class Option:
|
class Option:
|
||||||
...
|
...
|
||||||
timestep: wp.array(dtype=float)
|
timestep: wp.array[float]
|
||||||
...
|
...
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -48,13 +48,13 @@ def replace_array_calls(match):
|
|||||||
dtype = args[-1]
|
dtype = args[-1]
|
||||||
|
|
||||||
if n_args == 2:
|
if n_args == 2:
|
||||||
return f'wp.array(dtype={dtype})'
|
return f'wp.array[{dtype}]'
|
||||||
elif n_args == 3:
|
elif n_args == 3:
|
||||||
return f'wp.array2d(dtype={dtype})'
|
return f'wp.array2d[{dtype}]'
|
||||||
elif n_args == 4:
|
elif n_args == 4:
|
||||||
return f'wp.array3d(dtype={dtype})'
|
return f'wp.array3d[{dtype}]'
|
||||||
elif n_args == 5:
|
elif n_args == 5:
|
||||||
return f'wp.array4d(dtype={dtype})'
|
return f'wp.array4d[{dtype}]'
|
||||||
else:
|
else:
|
||||||
return match.group(0)
|
return match.group(0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user