Skip to content

rc-0.5.1 #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "viam-sdk"
version = "0.5.0"
version = "0.5.1"
description = "Viam Robotics Python SDK"
authors = [ "Naveed <[email protected]>" ]
license = "Apache-2.0"
Expand Down
18 changes: 5 additions & 13 deletions src/viam/components/camera/camera.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import abc
from typing import Final, List, NamedTuple, Optional, Tuple, Union, Any, Dict
from typing import Any, Dict, Final, List, NamedTuple, Optional, Tuple, Union

from PIL.Image import Image

Expand Down Expand Up @@ -36,12 +36,7 @@ class Properties(NamedTuple):

@abc.abstractmethod
async def get_image(
self,
mime_type: str = "",
*,
extra: Optional[Dict[str, Any]] = None,
timeout: Optional[float] = None,
**kwargs
self, mime_type: str = "", *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs
) -> Union[Image, RawImage]:
"""Get the next image from the camera as an Image or RawImage.
Be sure to close the image when finished.
Expand Down Expand Up @@ -73,12 +68,9 @@ async def get_images(self, *, timeout: Optional[float] = None, **kwargs) -> Tupl
...

@abc.abstractmethod
async def get_point_cloud(self,
*,
extra: Optional[Dict[str, Any]] = None,
timeout: Optional[float] = None,
**kwargs
) -> Tuple[bytes, str]:
async def get_point_cloud(
self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs
) -> Tuple[bytes, str]:
"""
Get the next point cloud from the camera. This will be
returned as bytes with a mimetype describing
Expand Down
9 changes: 3 additions & 6 deletions src/viam/components/camera/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@ def __init__(self, name: str, channel: Channel):
self.client = CameraServiceStub(channel)
super().__init__(name)

async def get_image(self,
mime_type: str = "",
*,
extra: Optional[Dict[str, Any]] = None,
timeout: Optional[float] = None
) -> Union[Image.Image, RawImage]:
async def get_image(
self, mime_type: str = "", *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None
) -> Union[Image.Image, RawImage]:
if extra is None:
extra = {}
request = GetImageRequest(name=self.name, mime_type=mime_type, extra=dict_to_struct(extra))
Expand Down