kscale 0.3.13__py3-none-any.whl → 0.3.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
kscale/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Defines the common interface for the K-Scale Python API."""
2
2
 
3
- __version__ = "0.3.13"
3
+ __version__ = "0.3.15"
4
4
 
5
5
  from pathlib import Path
6
6
 
@@ -442,15 +442,23 @@ async def run_pybullet(
442
442
 
443
443
  @urdf.command("mujoco")
444
444
  @click.argument("class_name")
445
+ @click.option("--scene", type=str, default="smooth")
445
446
  @click.option("--no-cache", is_flag=True, default=False)
446
447
  @coro
447
- async def run_mujoco(class_name: str, no_cache: bool) -> None:
448
+ async def run_mujoco(class_name: str, scene: str, no_cache: bool) -> None:
448
449
  """Shows the URDF file for a robot class in Mujoco.
449
450
 
450
451
  This command downloads and extracts the robot class URDF folder,
451
452
  searches for an MJCF file (unless --mjcf-path is provided), and then
452
453
  launches the Mujoco viewer using the provided MJCF file.
453
454
  """
455
+ try:
456
+ from mujoco_scenes.errors import TemplateNotFoundError
457
+ from mujoco_scenes.mjcf import list_scenes, load_mjmodel
458
+ except ImportError:
459
+ click.echo(click.style("Mujoco Scenes is required; install with `pip install mujoco-scenes`", fg="red"))
460
+ return
461
+
454
462
  try:
455
463
  import mujoco.viewer
456
464
  except ImportError:
@@ -474,7 +482,12 @@ async def run_mujoco(class_name: str, no_cache: bool) -> None:
474
482
 
475
483
  mjcf_path_str = str(mjcf_file.resolve())
476
484
  click.echo(f"Launching Mujoco viewer with: {click.style(mjcf_path_str, fg='green')}")
477
- mujoco.viewer.launch_from_path(mjcf_path_str)
485
+ try:
486
+ model = load_mjmodel(mjcf_path_str, scene)
487
+ except TemplateNotFoundError:
488
+ click.echo(click.style(f"Failed to load scene {scene}. Available scenes: {', '.join(list_scenes())}", fg="red"))
489
+ return
490
+ mujoco.viewer.launch(model)
478
491
 
479
492
 
480
493
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kscale
3
- Version: 0.3.13
3
+ Version: 0.3.15
4
4
  Summary: The kscale project
5
5
  Home-page: https://github.com/kscalelabs/kscale
6
6
  Author: Benjamin Bolte
@@ -1,4 +1,4 @@
1
- kscale/__init__.py,sha256=blW9DBfEkhee_kJYnE9wcIWBY9iWvKHkO1_CoKimPU8,201
1
+ kscale/__init__.py,sha256=f1nXUuv07Cph2KGaUfC-yRJxnfN9MnlYum4DrJB04hI,201
2
2
  kscale/cli.py,sha256=JvaPtmWvF7s0D4I3K98eZAItf3oOi2ULsn5aPGxDcu4,795
3
3
  kscale/conf.py,sha256=dm35XSnzJp93St-ixVtYN4Nvqvb5upPGBrWkSI6Yb-4,1743
4
4
  kscale/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -15,7 +15,7 @@ kscale/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  kscale/web/utils.py,sha256=Mme-FAQ0_zbjjOQeX8wyq8F4kL4i9fH7ytri16U6qOA,1046
16
16
  kscale/web/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  kscale/web/cli/robot.py,sha256=rI-A4_0uvJPeA71Apl4Z3mV5fIfWkgmzT9JRmJYxz3A,3307
18
- kscale/web/cli/robot_class.py,sha256=Gzg1NTD1iDf04jPVRz_fCKVAjnQ3pmA7dB3KmUjxXwk,19080
18
+ kscale/web/cli/robot_class.py,sha256=dOmB1z1l0bkSXnwgb4M6kbcJpHV4YAdT9l_po83C05w,19647
19
19
  kscale/web/cli/user.py,sha256=9IGsJBPyhjsmT04mZ2RGOs35ePfqB2RltYP0Ty5zF5o,1290
20
20
  kscale/web/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  kscale/web/clients/base.py,sha256=P5AZdoawNpocgx_8j5v0eauowG5suUf8SnnD7q1_gx0,16213
@@ -25,9 +25,9 @@ kscale/web/clients/robot_class.py,sha256=LCKje6nNsDBeKDxZAGCO9vQXdyOwtx0woMmB5vD
25
25
  kscale/web/clients/user.py,sha256=jsa1_s6qXRM-AGBbHlPhd1NierUtynjY9tVAPNr6_Os,568
26
26
  kscale/web/gen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  kscale/web/gen/api.py,sha256=QwyayqHVz7FFgDQO7IJFMN9MxtKpJPemiTMAk6aCEQE,7299
28
- kscale-0.3.13.dist-info/licenses/LICENSE,sha256=HCN2bImAzUOXldAZZI7JZ9PYq6OwMlDAP_PpX1HnuN0,1071
29
- kscale-0.3.13.dist-info/METADATA,sha256=MBCGy62OjZbOcDo-culQK6K62vtR1kIDshurzWkp768,2350
30
- kscale-0.3.13.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
31
- kscale-0.3.13.dist-info/entry_points.txt,sha256=N_0pCpPnwGDYVzOeuaSOrbJkS5L3lS9d8CxpJF1f8UI,62
32
- kscale-0.3.13.dist-info/top_level.txt,sha256=C2ynjYwopg6YjgttnI2dJjasyq3EKNmYp-IfQg9Xms4,7
33
- kscale-0.3.13.dist-info/RECORD,,
28
+ kscale-0.3.15.dist-info/licenses/LICENSE,sha256=HCN2bImAzUOXldAZZI7JZ9PYq6OwMlDAP_PpX1HnuN0,1071
29
+ kscale-0.3.15.dist-info/METADATA,sha256=TnttcGfmXXNZvHsiJdh6s9rQ9llxrwAAT6FhewRrXjY,2350
30
+ kscale-0.3.15.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
31
+ kscale-0.3.15.dist-info/entry_points.txt,sha256=N_0pCpPnwGDYVzOeuaSOrbJkS5L3lS9d8CxpJF1f8UI,62
32
+ kscale-0.3.15.dist-info/top_level.txt,sha256=C2ynjYwopg6YjgttnI2dJjasyq3EKNmYp-IfQg9Xms4,7
33
+ kscale-0.3.15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5