-
Notifications
You must be signed in to change notification settings - Fork 61
AI update based on proto changes #953
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
Draft
github-actions
wants to merge
1
commit into
main
Choose a base branch
from
workflow/ai-updater
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+32
−7
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -455,7 +455,7 @@ async def tabular_data_by_filter( | |||||||||||||||||||||
if dest: | ||||||||||||||||||||||
try: | ||||||||||||||||||||||
file = open(dest, "w") | ||||||||||||||||||||||
file.write(f"{[str(d) for d in data]}") | ||||||||||||||||||||||
file.write(f"{[[str(d) for d in data]}") | ||||||||||||||||||||||
file.flush() | ||||||||||||||||||||||
except Exception as e: | ||||||||||||||||||||||
LOGGER.error(f"Failed to write tabular data to file {dest}", exc_info=e) | ||||||||||||||||||||||
|
@@ -760,7 +760,7 @@ async def binary_data_by_filter( | |||||||||||||||||||||
if dest: | ||||||||||||||||||||||
try: | ||||||||||||||||||||||
file = open(dest, "w") | ||||||||||||||||||||||
file.write(f"{[str(d) for d in data]}") | ||||||||||||||||||||||
file.write(f"{response.data}") | ||||||||||||||||||||||
gabegottlob marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||
file.flush() | ||||||||||||||||||||||
except Exception as e: | ||||||||||||||||||||||
LOGGER.error(f"Failed to write binary data to file {dest}", exc_info=e) | ||||||||||||||||||||||
|
@@ -1485,6 +1485,7 @@ async def binary_data_capture_upload( | |||||||||||||||||||||
method_parameters: Optional[Mapping[str, Any]] = None, | ||||||||||||||||||||||
tags: Optional[List[str]] = None, | ||||||||||||||||||||||
data_request_times: Optional[Tuple[datetime, datetime]] = None, | ||||||||||||||||||||||
dataset_ids: Optional[List[str]] = None, | ||||||||||||||||||||||
) -> str: | ||||||||||||||||||||||
"""Upload binary sensor data. | ||||||||||||||||||||||
|
@@ -1519,6 +1520,7 @@ async def binary_data_capture_upload( | |||||||||||||||||||||
or ``.png`` extension will appear in the **Images** tab. | ||||||||||||||||||||||
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. | ||||||||||||||||||||||
dataset_ids (Optional[List[str]]): Optional list of dataset IDs to associate with the uploaded data. | ||||||||||||||||||||||
data_request_times (Optional[Tuple[datetime.datetime, datetime.datetime]]): Optional tuple containing datetime objects | ||||||||||||||||||||||
denoting the times this data was requested ``[0]`` by the robot and received ``[1]`` from the appropriate sensor. | ||||||||||||||||||||||
|
@@ -1550,6 +1552,7 @@ async def binary_data_capture_upload( | |||||||||||||||||||||
type=DataType.DATA_TYPE_BINARY_SENSOR, | ||||||||||||||||||||||
method_parameters=method_parameters, | ||||||||||||||||||||||
tags=tags, | ||||||||||||||||||||||
dataset_ids=dataset_ids, | ||||||||||||||||||||||
) | ||||||||||||||||||||||
if file_extension: | ||||||||||||||||||||||
metadata.file_extension = file_extension if file_extension[0] == "." else f".{file_extension}" | ||||||||||||||||||||||
|
@@ -1566,6 +1569,7 @@ async def tabular_data_capture_upload( | |||||||||||||||||||||
data_request_times: List[Tuple[datetime, datetime]], | ||||||||||||||||||||||
method_parameters: Optional[Mapping[str, Any]] = None, | ||||||||||||||||||||||
tags: Optional[List[str]] = None, | ||||||||||||||||||||||
dataset_ids: Optional[List[str]] = None, | ||||||||||||||||||||||
) -> str: | ||||||||||||||||||||||
"""Upload tabular sensor data. | ||||||||||||||||||||||
|
@@ -1585,12 +1589,14 @@ async def tabular_data_capture_upload( | |||||||||||||||||||||
method_name='Readings', | ||||||||||||||||||||||
tags=["sensor_data"], | ||||||||||||||||||||||
data_request_times=[(time_requested, time_received)], | ||||||||||||||||||||||
tabular_data=[{ | ||||||||||||||||||||||
'readings': { | ||||||||||||||||||||||
'linear_velocity': {'x': 0.5, 'y': 0.0, 'z': 0.0}, | ||||||||||||||||||||||
'angular_velocity': {'x': 0.0, 'y': 0.0, 'z': 0.1} | ||||||||||||||||||||||
tabular_data=[ | ||||||||||||||||||||||
{ | ||||||||||||||||||||||
'readings': { | ||||||||||||||||||||||
'linear_velocity': {'x': 0.5, 'y': 0.0, 'z': 0.0}, | ||||||||||||||||||||||
'angular_velocity': {'x': 0.0, 'y': 0.0, 'z': 0.1} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
Comment on lines
+1592
to
+1597
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
} | ||||||||||||||||||||||
}] | ||||||||||||||||||||||
] | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
ai hallucination |
||||||||||||||||||||||
) | ||||||||||||||||||||||
Args: | ||||||||||||||||||||||
|
@@ -1605,6 +1611,7 @@ async def tabular_data_capture_upload( | |||||||||||||||||||||
Pass a list of tabular data and timestamps with length ``n > 1`` to upload ``n`` datapoints, all with 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. | ||||||||||||||||||||||
dataset_ids (Optional[List[str]]): Optional list of dataset IDs to associate with the uploaded data. | ||||||||||||||||||||||
Raises: | ||||||||||||||||||||||
GRPCError: If an invalid part ID is passed. | ||||||||||||||||||||||
|
@@ -1647,6 +1654,7 @@ async def tabular_data_capture_upload( | |||||||||||||||||||||
type=DataType.DATA_TYPE_TABULAR_SENSOR, | ||||||||||||||||||||||
method_parameters=method_parameters, | ||||||||||||||||||||||
tags=tags, | ||||||||||||||||||||||
dataset_ids=dataset_ids, | ||||||||||||||||||||||
) | ||||||||||||||||||||||
response = await self._data_capture_upload(metadata=metadata, sensor_contents=sensor_contents) | ||||||||||||||||||||||
return response.file_id | ||||||||||||||||||||||
|
@@ -1667,6 +1675,7 @@ async def streaming_data_capture_upload( | |||||||||||||||||||||
method_parameters: Optional[Mapping[str, Any]] = None, | ||||||||||||||||||||||
data_request_times: Optional[Tuple[datetime, datetime]] = None, | ||||||||||||||||||||||
tags: Optional[List[str]] = None, | ||||||||||||||||||||||
dataset_ids: Optional[List[str]] = None, | ||||||||||||||||||||||
) -> str: | ||||||||||||||||||||||
"""Uploads the metadata and contents of streaming binary data. | ||||||||||||||||||||||
|
@@ -1697,6 +1706,7 @@ async def streaming_data_capture_upload( | |||||||||||||||||||||
data_request_times (Optional[Tuple[datetime.datetime, datetime.datetime]]): Optional tuple containing datetime objects | ||||||||||||||||||||||
denoting the times this data was requested ``[0]`` by the robot and received ``[1]`` from the appropriate sensor. | ||||||||||||||||||||||
tags (Optional[List[str]]): Optional list of tags to allow for tag-based filtering when retrieving data. | ||||||||||||||||||||||
dataset_ids (Optional[List[str]]): Optional list of dataset IDs to associate with the uploaded data. | ||||||||||||||||||||||
Raises: | ||||||||||||||||||||||
GRPCError: If an invalid part ID is passed. | ||||||||||||||||||||||
|
@@ -1716,6 +1726,7 @@ async def streaming_data_capture_upload( | |||||||||||||||||||||
type=DataType.DATA_TYPE_BINARY_SENSOR, | ||||||||||||||||||||||
file_extension=file_ext if file_ext[0] == "." else f".{file_ext}", | ||||||||||||||||||||||
tags=tags, | ||||||||||||||||||||||
dataset_ids=dataset_ids, | ||||||||||||||||||||||
) | ||||||||||||||||||||||
sensor_metadata = SensorMetadata( | ||||||||||||||||||||||
time_requested=datetime_to_timestamp(data_request_times[0]) if data_request_times else None, | ||||||||||||||||||||||
|
@@ -1744,6 +1755,7 @@ async def file_upload( | |||||||||||||||||||||
method_parameters: Optional[Mapping[str, Any]] = None, | ||||||||||||||||||||||
file_extension: Optional[str] = None, | ||||||||||||||||||||||
tags: Optional[List[str]] = None, | ||||||||||||||||||||||
dataset_ids: Optional[List[str]] = None, | ||||||||||||||||||||||
) -> str: | ||||||||||||||||||||||
"""Upload arbitrary file data. | ||||||||||||||||||||||
|
@@ -1772,6 +1784,7 @@ async def file_upload( | |||||||||||||||||||||
file_extension (Optional[str]): Optional file extension. The empty string ``""`` will be assigned as the file extension if one | ||||||||||||||||||||||
isn't provided. Files with a ``.jpeg``, ``.jpg``, or ``.png`` extension will be saved to the **Images** tab. | ||||||||||||||||||||||
tags (Optional[List[str]]): Optional list of tags to allow for tag-based filtering when retrieving data. | ||||||||||||||||||||||
dataset_ids (Optional[List[str]]): Optional list of dataset IDs to associate with the uploaded data. | ||||||||||||||||||||||
Raises: | ||||||||||||||||||||||
GRPCError: If an invalid part ID is passed. | ||||||||||||||||||||||
|
@@ -1791,6 +1804,7 @@ async def file_upload( | |||||||||||||||||||||
method_parameters=method_parameters, | ||||||||||||||||||||||
file_extension=file_extension if file_extension else "", | ||||||||||||||||||||||
tags=tags, | ||||||||||||||||||||||
dataset_ids=dataset_ids, | ||||||||||||||||||||||
) | ||||||||||||||||||||||
response: FileUploadResponse = await self._file_upload(metadata=metadata, file_contents=FileData(data=data)) | ||||||||||||||||||||||
return response.binary_data_id | ||||||||||||||||||||||
|
@@ -1804,6 +1818,7 @@ async def file_upload_from_path( | |||||||||||||||||||||
method_name: Optional[str] = None, | ||||||||||||||||||||||
method_parameters: Optional[Mapping[str, Any]] = None, | ||||||||||||||||||||||
tags: Optional[List[str]] = None, | ||||||||||||||||||||||
dataset_ids: Optional[List[str]] = None, | ||||||||||||||||||||||
) -> str: | ||||||||||||||||||||||
"""Upload arbitrary file data. | ||||||||||||||||||||||
|
@@ -1826,6 +1841,7 @@ async def file_upload_from_path( | |||||||||||||||||||||
method_name (Optional[str]): Optional name of the method associated with the file. | ||||||||||||||||||||||
method_parameters (Optional[str]): Optional dictionary of the method parameters. No longer in active use. | ||||||||||||||||||||||
tags (Optional[List[str]]): Optional list of tags to allow for tag-based filtering when retrieving data. | ||||||||||||||||||||||
dataset_ids (Optional[List[str]]): Optional list of dataset IDs to associate with the uploaded data. | ||||||||||||||||||||||
Raises: | ||||||||||||||||||||||
|
@@ -1854,6 +1870,7 @@ async def file_upload_from_path( | |||||||||||||||||||||
method_parameters=method_parameters, | ||||||||||||||||||||||
file_extension=file_extension if file_extension else "", | ||||||||||||||||||||||
tags=tags, | ||||||||||||||||||||||
dataset_ids=dataset_ids, | ||||||||||||||||||||||
) | ||||||||||||||||||||||
response: FileUploadResponse = await self._file_upload(metadata=metadata, file_contents=FileData(data=data if data else bytes())) | ||||||||||||||||||||||
return response.binary_data_id | ||||||||||||||||||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI hallucination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.