From 30cd8cc0e2aa54d479a24d02a09a88b41ee1695b Mon Sep 17 00:00:00 2001 From: Taylor Howell Date: Wed, 25 Sep 2024 04:32:53 -0700 Subject: [PATCH] Add keyword argument example to code block in model editing section of the documentation. PiperOrigin-RevId: 678643644 Change-Id: Ie1d5659f01cc882628a669e7be22eff975a888fc --- doc/python.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/python.rst b/doc/python.rst index 2454c075..4e749cd4 100644 --- a/doc/python.rst +++ b/doc/python.rst @@ -482,14 +482,16 @@ Below is a simple example of how to use the model editing API. For more examples import mujoco spec = mujoco.MjSpec() - body = spec.worldbody.add_body() - body.pos = [1, 2, 3] - body.quat = [0, 1, 0, 0] - geom = body.add_geom() - geom.name = 'my_geom' - geom.type = mujoco.mjtGeom.mjGEOM_SPHERE - geom.size[0] = 1 - geom.rgba = [1, 0, 0, 1] + body = spec.worldbody.add_body( + pos=[1, 2, 3], + quat=[0, 1, 0, 0], + ) + geom = body.add_geom( + name='my_geom', + type=mujoco.mjtGeom.mjGEOM_SPHERE, + size=[1, 0, 0], + rgba=[1, 0, 0, 1], + ) ... model = spec.compile() @@ -498,8 +500,6 @@ Below is a simple example of how to use the model editing API. For more examples We are aware of multiple missing features in the Python API, including: - - Convenient constructors like: - |br| :python:`geom = body.add_geom(name='my_geom', size=[1, 1, 1], rgba=[1, 0, 0, 1])` - Better tree traversal utilities like :python:`children = body.children()` etc. - PyMJCF's notion of "binding", allowing access to :ref:`mjModel` and :ref:`mjData` values via the associated ``mjs`` elements.