kscale 0.0.6__py3-none-any.whl → 0.0.8__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
kscale/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  """Defines the common interface for the K-Scale Python API."""
2
2
 
3
- __version__ = "0.0.6"
3
+ __version__ = "0.0.8"
4
4
 
5
5
  from kscale.api import KScale
@@ -0,0 +1,18 @@
1
+ # Blender v2.66 (sub 1) OBJ File: ''
2
+ # www.blender.org
3
+ mtllib plane.mtl
4
+ o Plane
5
+ v 15.000000 -15.000000 0.000000
6
+ v 15.000000 15.000000 0.000000
7
+ v -15.000000 15.000000 0.000000
8
+ v -15.000000 -15.000000 0.000000
9
+
10
+ vt 15.000000 0.000000
11
+ vt 15.000000 15.000000
12
+ vt 0.000000 15.000000
13
+ vt 0.000000 0.000000
14
+
15
+ usemtl Material
16
+ s off
17
+ f 1/1 2/2 3/3
18
+ f 1/1 3/3 4/4
@@ -0,0 +1,28 @@
1
+ <?xml version="0.0" ?>
2
+ <robot name="plane">
3
+ <link name="planeLink">
4
+ <contact>
5
+ <lateral_friction value="1"/>
6
+ </contact>
7
+ <inertial>
8
+ <origin rpy="0 0 0" xyz="0 0 0"/>
9
+ <mass value=".0"/>
10
+ <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
11
+ </inertial>
12
+ <visual>
13
+ <origin rpy="0 0 0" xyz="0 0 0"/>
14
+ <geometry>
15
+ <mesh filename="plane.obj" scale="1 1 1"/>
16
+ </geometry>
17
+ <material name="white">
18
+ <color rgba="1 1 1 1"/>
19
+ </material>
20
+ </visual>
21
+ <collision>
22
+ <origin rpy="0 0 0" xyz="0 0 -5"/>
23
+ <geometry>
24
+ <box size="30 30 10"/>
25
+ </geometry>
26
+ </collision>
27
+ </link>
28
+ </robot>
@@ -0,0 +1,11 @@
1
+ # requirements-dev.txt
2
+
3
+ # For linting code.
4
+ black
5
+ darglint
6
+ mypy
7
+ pytest
8
+ ruff
9
+
10
+ # For generating API types.
11
+ datamodel-code-generator
@@ -0,0 +1,10 @@
1
+ # requirements.txt
2
+
3
+ # Configuration
4
+ omegaconf
5
+ email_validator
6
+
7
+ # HTTP requests
8
+ httpx
9
+ requests
10
+ pydantic
kscale/store/client.py CHANGED
@@ -26,6 +26,7 @@ class KScaleStoreClient:
26
26
  self.client = httpx.AsyncClient(
27
27
  base_url=self.base_url,
28
28
  headers={"Authorization": f"Bearer {get_api_key()}"},
29
+ timeout=httpx.Timeout(30.0),
29
30
  )
30
31
 
31
32
  async def _request(
kscale/store/pybullet.py CHANGED
@@ -27,7 +27,10 @@ async def main(args: Sequence[str] | None = None) -> None:
27
27
  parsed_args = parser.parse_args(args)
28
28
 
29
29
  # Gets the URDF path.
30
- urdf_path = await download_urdf(parsed_args.listing_id)
30
+ urdf_dir = await download_urdf(parsed_args.listing_id)
31
+ urdf_path = next(urdf_dir.glob("*.urdf"), None)
32
+ if urdf_path is None:
33
+ raise ValueError(f"No URDF found in {urdf_dir}")
31
34
 
32
35
  try:
33
36
  import pybullet as p # type: ignore[import-not-found]
kscale/store/urdf.py CHANGED
@@ -21,6 +21,17 @@ from kscale.store.utils import get_api_key
21
21
  logging.basicConfig(level=logging.INFO)
22
22
  logger = logging.getLogger(__name__)
23
23
 
24
+ ALLOWED_SUFFIXES = {
25
+ ".urdf",
26
+ ".mjcf",
27
+ ".stl",
28
+ ".obj",
29
+ ".dae",
30
+ ".png",
31
+ ".jpg",
32
+ ".jpeg",
33
+ }
34
+
24
35
 
25
36
  def get_cache_dir() -> Path:
26
37
  return Path(Settings.load().store.cache_dir).expanduser().resolve()
@@ -75,7 +86,7 @@ def create_tarball(folder_path: Path, output_filename: str, cache_dir: Path) ->
75
86
  tarball_path = cache_dir / output_filename
76
87
  with tarfile.open(tarball_path, "w:gz") as tar:
77
88
  for file_path in folder_path.rglob("*"):
78
- if file_path.is_file() and file_path.suffix.lower() in (".urdf", ".mjcf", ".stl", ".obj", ".dae"):
89
+ if file_path.is_file() and file_path.suffix.lower() in ALLOWED_SUFFIXES:
79
90
  tar.add(file_path, arcname=file_path.relative_to(folder_path))
80
91
  logger.info("Added %s to tarball", file_path)
81
92
  else:
@@ -1,16 +1,17 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kscale
3
- Version: 0.0.6
3
+ Version: 0.0.8
4
4
  Summary: The kscale project
5
5
  Home-page: https://github.com/kscalelabs/kscale
6
6
  Author: Benjamin Bolte
7
7
  Requires-Python: >=3.11
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
- Requires-Dist: omegaconf ==2.3.0
11
- Requires-Dist: email-validator ==2.2.0
12
- Requires-Dist: httpx ==0.27.0
13
- Requires-Dist: requests ==2.32.2
10
+ Requires-Dist: omegaconf
11
+ Requires-Dist: email-validator
12
+ Requires-Dist: httpx
13
+ Requires-Dist: requests
14
+ Requires-Dist: pydantic
14
15
  Provides-Extra: dev
15
16
  Requires-Dist: black ; extra == 'dev'
16
17
  Requires-Dist: darglint ; extra == 'dev'
@@ -0,0 +1,25 @@
1
+ kscale/__init__.py,sha256=1MpcdojomS4ZvErzg6npkz6JgWeelA-mh3PHtjA2ERw,117
2
+ kscale/api.py,sha256=xBtKj8rgZ400r1Xx9LRY0AzSgIIttoXdejmhHhdVGS0,333
3
+ kscale/conf.py,sha256=9fShFaYTbnrm_eiGjmy8ZtC4Q4m6PQkWPyoF3eNyov8,1424
4
+ kscale/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ kscale/requirements-dev.txt,sha256=WI7-ea4IRJakmqVMN8QKhOsDGrghwtvk03aIsFaNSIw,130
6
+ kscale/requirements.txt,sha256=gxo_niYIHsmyxKxvIOegv45s_lvdnIzI2iFJ2TZzx_U,103
7
+ kscale/artifacts/plane.obj,sha256=x59-IIrWpLjhotChiqT2Ul6U8s0RcHkaEeUZb4KXL1c,348
8
+ kscale/artifacts/plane.urdf,sha256=LCiTk14AyTHjkZ1jvsb0hNaEaJUxDb8Z1JjsgpXu3YM,819
9
+ kscale/store/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ kscale/store/api.py,sha256=rydanYGg8zlc_cNuWo9YBG_WVtPKMxFgp6fpec-B8M0,671
11
+ kscale/store/cli.py,sha256=8ygg_1tZzOOHJotEIgSN9pfumcriPmA31sI_FCFQiTo,859
12
+ kscale/store/client.py,sha256=R1IDnf2J4ojAcP8nmUUHfXhcHUt4zP0-mxtVI7MIC5U,2664
13
+ kscale/store/pybullet.py,sha256=WzA1FVAc19JMY9nUar0go9kcy9BvU8W1lnT9eT1W1LI,7638
14
+ kscale/store/urdf.py,sha256=5x8tK2BYv901S_yYWYPWEnHv-3T0ALBQMdDwb70EZFw,6395
15
+ kscale/store/utils.py,sha256=rFXGkem2oAttAf3bhWmFEhxrqYnaVvlVJsC268IMw6Y,906
16
+ kscale/store/gen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ kscale/store/gen/api.py,sha256=82D41J6pg9KWdgD0lx7NggLcNS32SpnN8DqE3Md6ON0,9559
18
+ kscale/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ kscale/utils/api_base.py,sha256=Kk_WtRDdJHmOg6NtHmVxVrcfARSUkhfr29ypLch_pO0,112
20
+ kscale-0.0.8.dist-info/LICENSE,sha256=HCN2bImAzUOXldAZZI7JZ9PYq6OwMlDAP_PpX1HnuN0,1071
21
+ kscale-0.0.8.dist-info/METADATA,sha256=yCEhXQcLAaMpUqZnVWeK9Rcdv3LGV4u_vYNrUZ9VCbM,2504
22
+ kscale-0.0.8.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
23
+ kscale-0.0.8.dist-info/entry_points.txt,sha256=PaVs1ivqB0BBdGUsiFkxGUYjGLz05VqagxwRVwi4yV4,54
24
+ kscale-0.0.8.dist-info/top_level.txt,sha256=C2ynjYwopg6YjgttnI2dJjasyq3EKNmYp-IfQg9Xms4,7
25
+ kscale-0.0.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.1)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,21 +0,0 @@
1
- kscale/__init__.py,sha256=JpzvBV9Lj2LiHL79IFLwTAqSkYwDJW5xG0WY6MlzNgY,117
2
- kscale/api.py,sha256=xBtKj8rgZ400r1Xx9LRY0AzSgIIttoXdejmhHhdVGS0,333
3
- kscale/conf.py,sha256=9fShFaYTbnrm_eiGjmy8ZtC4Q4m6PQkWPyoF3eNyov8,1424
4
- kscale/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- kscale/store/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- kscale/store/api.py,sha256=rydanYGg8zlc_cNuWo9YBG_WVtPKMxFgp6fpec-B8M0,671
7
- kscale/store/cli.py,sha256=8ygg_1tZzOOHJotEIgSN9pfumcriPmA31sI_FCFQiTo,859
8
- kscale/store/client.py,sha256=YlujOt9A8fz5efzQgFPoaUpwSgAZukEopjb368r8kBI,2623
9
- kscale/store/pybullet.py,sha256=viTQCE2jT72miPKZpFKj4f4zGLLYtjhRFxGqzxd2Z8M,7504
10
- kscale/store/urdf.py,sha256=a82l8mRUHGDacdnSdJI8ZHH2LYvFPvebWhVmt216do8,6298
11
- kscale/store/utils.py,sha256=rFXGkem2oAttAf3bhWmFEhxrqYnaVvlVJsC268IMw6Y,906
12
- kscale/store/gen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- kscale/store/gen/api.py,sha256=82D41J6pg9KWdgD0lx7NggLcNS32SpnN8DqE3Md6ON0,9559
14
- kscale/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- kscale/utils/api_base.py,sha256=Kk_WtRDdJHmOg6NtHmVxVrcfARSUkhfr29ypLch_pO0,112
16
- kscale-0.0.6.dist-info/LICENSE,sha256=HCN2bImAzUOXldAZZI7JZ9PYq6OwMlDAP_PpX1HnuN0,1071
17
- kscale-0.0.6.dist-info/METADATA,sha256=Zl8dRnQ4-ZpjBCc5iDj86fvXDh8s11U3x2G__QrMv8s,2514
18
- kscale-0.0.6.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
19
- kscale-0.0.6.dist-info/entry_points.txt,sha256=PaVs1ivqB0BBdGUsiFkxGUYjGLz05VqagxwRVwi4yV4,54
20
- kscale-0.0.6.dist-info/top_level.txt,sha256=C2ynjYwopg6YjgttnI2dJjasyq3EKNmYp-IfQg9Xms4,7
21
- kscale-0.0.6.dist-info/RECORD,,