Skip to content

RSDK-8506-RSDK-8253: fix docs #709

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
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
18 changes: 8 additions & 10 deletions src/viam/app/data_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,9 @@ async def tabular_data_capture_upload(
component_type: str,
component_name: str,
method_name: str,
data_request_times: List[Tuple[datetime, datetime]],
method_parameters: Optional[Mapping[str, Any]] = None,
tags: Optional[List[str]] = None,
data_request_times: Optional[List[Tuple[datetime, datetime]]] = None,
) -> str:
"""Upload tabular sensor data.

Expand All @@ -1132,7 +1132,7 @@ async def tabular_data_capture_upload(

file_id = await data_client.tabular_data_capture_upload(
part_id="INSERT YOUR PART ID",
component_type='motor',
component_type='rdk:component:motor',
component_name='left_motor',
method_name='IsPowered',
tags=["tag_1", "tag_2"],
Expand All @@ -1143,15 +1143,14 @@ async def tabular_data_capture_upload(
Args:
tabular_data (List[Mapping[str, Any]]): List of the data to be uploaded, represented tabularly as a collection of dictionaries.
part_id (str): Part ID of the component used to capture the data.
component_type (str): Type of the component used to capture the data (for example, "movement_sensor").
component_type (str): Type of the component used to capture the data (for example, "rdk:component:movement_sensor").
component_name (str): Name of the component used to capture the data.
method_name (str): Name of the method used to capture the data.
data_request_times (List[Tuple[datetime.datetime, datetime.datetime]]): List of tuples, each containing `datetime` objects
denoting the times this data was requested[0] by the robot and received[1] from the appropriate sensor. Passing a list of
tabular data and Timestamps with length n > 1 will result in n datapoints being uploaded, all tied to the same metadata.
method_parameters (Optional[Mapping[str, Any]]): Optional dictionary of method parameters. No longer in active use.
tags (Optional[List[str]]): Optional list of tags to allow for tag-based data filtering when retrieving data.
data_request_times (Optional[List[Tuple[datetime.datetime, datetime.datetime]]]): Optional list of tuples, each containing
`datetime` objects denoting the times this data was requested[0] by the robot and received[1] from the appropriate sensor.
Passing a list of tabular data and Timestamps with length n > 1 will result in n datapoints being uploaded, all tied to the
same metadata.

Raises:
GRPCError: If an invalid part ID is passed.
Expand All @@ -1164,9 +1163,8 @@ async def tabular_data_capture_upload(
For more information, see `Data Client API <https://docs.viam.com/appendix/apis/data-client/>`_.
"""
sensor_contents = []
if data_request_times:
if len(data_request_times) != len(tabular_data):
raise ValueError("data_request_times and tabular_data lengths must be equal.")
if len(data_request_times) != len(tabular_data):
raise ValueError("data_request_times and tabular_data lengths must be equal.")

for idx, tab in enumerate(tabular_data):
s = Struct()
Expand Down
4 changes: 2 additions & 2 deletions src/viam/services/vision/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async def get_detections(
detections = await my_detector.get_detections(img)

Args:
image (Image | RawImage): The image to get detections from
image (ViamImage): The image to get detections from

Raises:
ViamError: Raised if given an image without a specified width and height
Expand Down Expand Up @@ -254,7 +254,7 @@ async def get_classifications(
classifications = await my_classifier.get_classifications(img, 2)

Args:
image (Image | RawImage): The image to get detections from
image (ViamImage): The image to get detections from
count (int): The number of classifications desired

Returns:
Expand Down
Loading