current-data-py 0.1.16__tar.gz → 0.1.18__tar.gz
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.
- {current_data_py-0.1.16 → current_data_py-0.1.18}/MANIFEST.in +10 -8
- {current_data_py-0.1.16/current_data_py.egg-info → current_data_py-0.1.18}/PKG-INFO +31 -3
- {current_data_py-0.1.16 → current_data_py-0.1.18}/README.md +213 -185
- {current_data_py-0.1.16 → current_data_py-0.1.18}/__init__.py +24 -17
- {current_data_py-0.1.16 → current_data_py-0.1.18}/_multipart.py +52 -52
- current_data_py-0.1.18/_urdf_dae.py +37 -0
- current_data_py-0.1.18/_urdf_directory.py +87 -0
- current_data_py-0.1.18/_urdf_mesh.py +39 -0
- current_data_py-0.1.18/_urdf_validation.py +230 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18/current_data_py.egg-info}/PKG-INFO +31 -3
- {current_data_py-0.1.16 → current_data_py-0.1.18}/current_data_py.egg-info/SOURCES.txt +16 -1
- {current_data_py-0.1.16 → current_data_py-0.1.18}/decoding.py +179 -184
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs/api/management.md +594 -363
- current_data_py-0.1.18/docs/api/processing.md +699 -0
- current_data_py-0.1.18/docs/index.md +79 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs/skills/convert-robot-data/SKILL.md +211 -211
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs/skills/data-platform/SKILL.md +32 -29
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs/skills/data-platform/references/api.md +37 -34
- current_data_py-0.1.18/docs/skills/data-platform/references/data-transfer.md +62 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs/skills/data-platform/references/dev-pod.md +62 -62
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs/skills/data-platform/references/jobs.md +86 -86
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs/skills/data-platform/references/test-environment.md +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs/skills/data-platform/references/use-cases.md +82 -82
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs/skills/sdk-client/SKILL.md +11 -11
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs/skills/sdk-client/references/data-client.md +380 -279
- current_data_py-0.1.18/docs/skills/sdk-client/references/metadata-v2.md +156 -0
- current_data_py-0.1.18/docs/urdf.md +84 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/docs.py +46 -46
- {current_data_py-0.1.16 → current_data_py-0.1.18}/examples/__init__.py +1 -1
- {current_data_py-0.1.16 → current_data_py-0.1.18}/examples/list_schemas.py +7 -7
- {current_data_py-0.1.16 → current_data_py-0.1.18}/examples/read_remote_td.py +54 -54
- {current_data_py-0.1.16 → current_data_py-0.1.18}/examples/read_td.py +30 -30
- current_data_py-0.1.18/examples/upload_urdf.py +38 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/examples/write_td.py +30 -30
- {current_data_py-0.1.16 → current_data_py-0.1.18}/labeling.py +102 -102
- {current_data_py-0.1.16 → current_data_py-0.1.18}/management.py +367 -233
- {current_data_py-0.1.16 → current_data_py-0.1.18}/oss.py +264 -229
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/labeling/service/service_pb2.py +79 -79
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/labeling/service/service_pb2_grpc.py +435 -435
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/labeling/task/task_pb2.py +52 -52
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/labeling/template/template_pb2.py +40 -40
- current_data_py-0.1.18/proto_gen/python/management/metadata/metadata_pb2.py +74 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/management/selection/selection_pb2.py +27 -27
- current_data_py-0.1.18/proto_gen/python/management/service/service_pb2.py +131 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/management/service/service_pb2_grpc.py +931 -528
- current_data_py-0.1.18/proto_gen/python/management/urdf/asset_pb2.py +31 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/builtin_interfaces/duration_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/builtin_interfaces/time_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/custom_msgs/encoder_status_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/custom_msgs/joint_current_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/custom_msgs/keypoints_quality_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/custom_msgs/pose_rpy_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/custom_msgs/slam_quality_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/custom_msgs/sonic_frame_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/custom_msgs/subtask_description_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/custom_msgs/target_quality_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/foxglove/compressed_audio_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/foxglove/compressed_video_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/point32_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/point_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/pose_array_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/pose_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/pose_stamped_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/pose_with_covariance_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/pose_with_covariance_stamped_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/quaternion_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/transform_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/transform_stamped_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/twist_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/twist_stamped_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/twist_with_covariance_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/twist_with_covariance_stamped_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/vector3_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/wrench_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/geometry_msgs/wrench_stamped_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/nav_msgs/map_meta_data_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/nav_msgs/occupancy_grid_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/nav_msgs/odometry_pb2.py +28 -28
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/nav_msgs/path_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/battery_state_pb2.py +32 -32
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/camera_info_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/compressed_image_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/image_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/imu_pb2.py +28 -28
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/joint_state_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/laser_scan_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/nav_sat_fix_pb2.py +29 -29
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/nav_sat_status_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/point_cloud2_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/point_field_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/range_pb2.py +28 -28
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/sensor_msgs/region_of_interest_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/std_msgs/bool_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/std_msgs/color_rgba_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/std_msgs/float32_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/std_msgs/float64_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/std_msgs/header_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/std_msgs/int32_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/std_msgs/string_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/std_msgs/uint32_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.18}/proto_gen/python/msg/tf2_msgs/tf_message_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.18}/pyproject.toml +24 -24
- {current_data_py-0.1.16 → current_data_py-0.1.18}/remote/__init__.py +7 -7
- current_data_py-0.1.18/remote/client.py +305 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/remote/source.py +99 -99
- {current_data_py-0.1.16 → current_data_py-0.1.18}/remote/tos_source.py +84 -84
- {current_data_py-0.1.16 → current_data_py-0.1.18}/schema/__init__.py +113 -113
- {current_data_py-0.1.16 → current_data_py-0.1.18}/schema/message_metadata.py +30 -30
- {current_data_py-0.1.16 → current_data_py-0.1.18}/setup.py +93 -93
- {current_data_py-0.1.16 → current_data_py-0.1.18}/tests/check_docs.py +79 -79
- {current_data_py-0.1.16 → current_data_py-0.1.18}/tests/check_environment.py +83 -79
- {current_data_py-0.1.16 → current_data_py-0.1.18}/tests/check_labeling.py +111 -111
- {current_data_py-0.1.16 → current_data_py-0.1.18}/tests/check_management.py +588 -469
- {current_data_py-0.1.16 → current_data_py-0.1.18}/tests/check_oss.py +500 -424
- {current_data_py-0.1.16 → current_data_py-0.1.18}/tests/check_package.py +44 -44
- {current_data_py-0.1.16 → current_data_py-0.1.18}/tests/check_remote.py +351 -343
- current_data_py-0.1.18/tests/check_urdf.py +440 -0
- current_data_py-0.1.18/tests/check_urdf_validation.py +286 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/tos.py +195 -191
- current_data_py-0.1.18/urdf.py +66 -0
- current_data_py-0.1.16/docs/api/processing.md +0 -401
- current_data_py-0.1.16/docs/index.md +0 -66
- current_data_py-0.1.16/docs/skills/data-platform/references/data-transfer.md +0 -34
- current_data_py-0.1.16/docs/skills/data-platform/references/updates.md +0 -44
- current_data_py-0.1.16/proto_gen/python/management/metadata/metadata_pb2.py +0 -68
- current_data_py-0.1.16/proto_gen/python/management/service/service_pb2.py +0 -84
- current_data_py-0.1.16/remote/client.py +0 -138
- {current_data_py-0.1.16 → current_data_py-0.1.18}/current_data_py.egg-info/dependency_links.txt +0 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/current_data_py.egg-info/requires.txt +0 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/current_data_py.egg-info/top_level.txt +0 -0
- {current_data_py-0.1.16 → current_data_py-0.1.18}/setup.cfg +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
include tests/check_package.py
|
|
2
|
-
include tests/check_environment.py
|
|
3
|
-
include tests/check_remote.py
|
|
4
|
-
include tests/check_management.py
|
|
5
|
-
include tests/check_oss.py
|
|
6
|
-
include tests/check_labeling.py
|
|
7
|
-
include tests/check_docs.py
|
|
8
|
-
|
|
1
|
+
include tests/check_package.py
|
|
2
|
+
include tests/check_environment.py
|
|
3
|
+
include tests/check_remote.py
|
|
4
|
+
include tests/check_management.py
|
|
5
|
+
include tests/check_oss.py
|
|
6
|
+
include tests/check_labeling.py
|
|
7
|
+
include tests/check_docs.py
|
|
8
|
+
include tests/check_urdf.py
|
|
9
|
+
include tests/check_urdf_validation.py
|
|
10
|
+
recursive-include docs *.md
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: current-data-py
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.18
|
|
4
4
|
Summary: Current Data protobuf messages and schema metadata
|
|
5
5
|
Requires-Python: >=3.9
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -49,6 +49,21 @@ Set `ENV=test` before the first SDK import to select the test service; an unset
|
|
|
49
49
|
empty value defaults to production. An explicit client `address=` overrides the
|
|
50
50
|
default. Remote examples require service connectivity and accessible data.
|
|
51
51
|
|
|
52
|
+
Downloads and remote reads with a selected bucket default to the storage provider's
|
|
53
|
+
internal endpoint (`OSSClient` / `TOSClient` read permission, `download_data`,
|
|
54
|
+
`open_data`, and bucket-selected `open_td`). Outside that cloud network, pass
|
|
55
|
+
`use_internal_endpoint=False`; there is no automatic public fallback. A supplied
|
|
56
|
+
TOS `endpoint` selects that public address unless internal networking is explicitly
|
|
57
|
+
requested, which remains an error. Uploads still default to public networking.
|
|
58
|
+
Legacy OSS `open_td` without `bucket` retains the server's default read scope and
|
|
59
|
+
does not support network selection. V2/V3 read-credential methods default to internal.
|
|
60
|
+
|
|
61
|
+
Calibration workers can import `GLOVE_CALIBRATION_REPORT_URL` from
|
|
62
|
+
`current_data_py` for the environment's HTTPS Collection callback endpoint on
|
|
63
|
+
`DEFAULT_ADDRESS` (port 443).
|
|
64
|
+
Processing supplies `ENV` to the Job; set it before the first SDK import.
|
|
65
|
+
The worker needs network access to that platform domain.
|
|
66
|
+
|
|
52
67
|
## Upload files
|
|
53
68
|
|
|
54
69
|
Use `OSSClient` or `TOSClient` with upload permission. The management service
|
|
@@ -87,6 +102,19 @@ policy update and ensure the underlying cloud role permits cleanup before use.
|
|
|
87
102
|
There is no persistent checkpoint: a later call starts a new upload. Uploading
|
|
88
103
|
does not register the data; call `ManagementClient.register_data` separately.
|
|
89
104
|
|
|
105
|
+
## URDF packages
|
|
106
|
+
|
|
107
|
+
Use `ManagementClient.upload_urdf(directory, entrypoint, info=...)` to check local
|
|
108
|
+
dependencies, upload source files without overwriting objects, and register one
|
|
109
|
+
asset under a new UUID on each call. Keep the directory unchanged throughout the
|
|
110
|
+
call; validation, hashing and upload read the source directly without private
|
|
111
|
+
copies. Failed calls leave uploaded objects in place and do not resume or recover
|
|
112
|
+
registration on a later call.
|
|
113
|
+
STL, static COLLADA, OBJ/MTL and PNG/JPEG references are supported; rendering is
|
|
114
|
+
checked in preview. The result is the locally generated asset UUID; model lists
|
|
115
|
+
provide URDF URLs. See the
|
|
116
|
+
[URDF guide](docs/urdf.md) and run `python -I -m current_data_py.examples.upload_urdf --help`.
|
|
117
|
+
|
|
90
118
|
## Test changes
|
|
91
119
|
|
|
92
120
|
The package bundles generated Protobuf modules during its build. After protocol
|
|
@@ -103,7 +131,7 @@ shared dependencies are left unchanged:
|
|
|
103
131
|
(cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
|
|
104
132
|
python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
|
|
105
133
|
python -m pip install --no-deps --force-reinstall "$sdk_dist"/*.whl
|
|
106
|
-
for check in package environment management labeling remote oss tos decoding multipart docs; do
|
|
134
|
+
for check in package environment management labeling remote remote_v2 oss tos decoding multipart urdf urdf_validation docs; do
|
|
107
135
|
python -I "current_data_py/tests/check_${check}.py"
|
|
108
136
|
done
|
|
109
137
|
)
|
|
@@ -145,7 +173,7 @@ sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
|
|
|
145
173
|
(
|
|
146
174
|
cd "$sdk_release_dir"
|
|
147
175
|
unset PYTHONPATH PYTHONHOME
|
|
148
|
-
for check in package environment management labeling remote oss tos decoding; do
|
|
176
|
+
for check in package environment management labeling remote remote_v2 oss tos decoding urdf urdf_validation docs; do
|
|
149
177
|
python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
|
|
150
178
|
done
|
|
151
179
|
)
|
|
@@ -1,185 +1,213 @@
|
|
|
1
|
-
# current-data-py
|
|
2
|
-
|
|
3
|
-
Python SDK for robotics Protobuf messages, TD files, and platform service clients.
|
|
4
|
-
Run shell commands from the repository root in the shared development environment.
|
|
5
|
-
|
|
6
|
-
## Use locally
|
|
7
|
-
|
|
8
|
-
Run the bundled examples to write and read a local TD file using the installed SDK:
|
|
9
|
-
|
|
10
|
-
```sh
|
|
11
|
-
python -I -m current_data_py.examples.write_td /tmp/current-data-example.td
|
|
12
|
-
python -I -m current_data_py.examples.read_td /tmp/current-data-example.td
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
`-I` avoids importing the unbuilt source directory in place of the installed package.
|
|
16
|
-
See [examples](examples) for other entry points.
|
|
17
|
-
|
|
18
|
-
For a minimal read-only service call, run this snippet with `python -I` so it uses
|
|
19
|
-
the installed SDK:
|
|
20
|
-
|
|
21
|
-
```python
|
|
22
|
-
from contextlib import closing
|
|
23
|
-
import os
|
|
24
|
-
os.environ["ENV"] = "test"
|
|
25
|
-
|
|
26
|
-
from current_data_py.management import ManagementClient, MetadataFilter
|
|
27
|
-
|
|
28
|
-
with ManagementClient() as client:
|
|
29
|
-
with closing(client.stream_data_references(MetadataFilter(), timeout=30)) as records:
|
|
30
|
-
record = next(records, None)
|
|
31
|
-
print(record.id if record is not None else "No matching data")
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Set `ENV=test` before the first SDK import to select the test service; an unset or
|
|
35
|
-
empty value defaults to production. An explicit client `address=` overrides the
|
|
36
|
-
default. Remote examples require service connectivity and accessible data.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
`
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
[
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
###
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
that
|
|
185
|
-
|
|
1
|
+
# current-data-py
|
|
2
|
+
|
|
3
|
+
Python SDK for robotics Protobuf messages, TD files, and platform service clients.
|
|
4
|
+
Run shell commands from the repository root in the shared development environment.
|
|
5
|
+
|
|
6
|
+
## Use locally
|
|
7
|
+
|
|
8
|
+
Run the bundled examples to write and read a local TD file using the installed SDK:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
python -I -m current_data_py.examples.write_td /tmp/current-data-example.td
|
|
12
|
+
python -I -m current_data_py.examples.read_td /tmp/current-data-example.td
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`-I` avoids importing the unbuilt source directory in place of the installed package.
|
|
16
|
+
See [examples](examples) for other entry points.
|
|
17
|
+
|
|
18
|
+
For a minimal read-only service call, run this snippet with `python -I` so it uses
|
|
19
|
+
the installed SDK:
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from contextlib import closing
|
|
23
|
+
import os
|
|
24
|
+
os.environ["ENV"] = "test"
|
|
25
|
+
|
|
26
|
+
from current_data_py.management import ManagementClient, MetadataFilter
|
|
27
|
+
|
|
28
|
+
with ManagementClient() as client:
|
|
29
|
+
with closing(client.stream_data_references(MetadataFilter(), timeout=30)) as records:
|
|
30
|
+
record = next(records, None)
|
|
31
|
+
print(record.id if record is not None else "No matching data")
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Set `ENV=test` before the first SDK import to select the test service; an unset or
|
|
35
|
+
empty value defaults to production. An explicit client `address=` overrides the
|
|
36
|
+
default. Remote examples require service connectivity and accessible data.
|
|
37
|
+
|
|
38
|
+
Downloads and remote reads with a selected bucket default to the storage provider's
|
|
39
|
+
internal endpoint (`OSSClient` / `TOSClient` read permission, `download_data`,
|
|
40
|
+
`open_data`, and bucket-selected `open_td`). Outside that cloud network, pass
|
|
41
|
+
`use_internal_endpoint=False`; there is no automatic public fallback. A supplied
|
|
42
|
+
TOS `endpoint` selects that public address unless internal networking is explicitly
|
|
43
|
+
requested, which remains an error. Uploads still default to public networking.
|
|
44
|
+
Legacy OSS `open_td` without `bucket` retains the server's default read scope and
|
|
45
|
+
does not support network selection. V2/V3 read-credential methods default to internal.
|
|
46
|
+
|
|
47
|
+
Calibration workers can import `GLOVE_CALIBRATION_REPORT_URL` from
|
|
48
|
+
`current_data_py` for the environment's HTTPS Collection callback endpoint on
|
|
49
|
+
`DEFAULT_ADDRESS` (port 443).
|
|
50
|
+
Processing supplies `ENV` to the Job; set it before the first SDK import.
|
|
51
|
+
The worker needs network access to that platform domain.
|
|
52
|
+
|
|
53
|
+
## Upload files
|
|
54
|
+
|
|
55
|
+
Use `OSSClient` or `TOSClient` with upload permission. The management service
|
|
56
|
+
selects the bucket and allowed object prefix; keep it open during transfers:
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from current_data_py.management import ManagementClient
|
|
60
|
+
from current_data_py.tos import TOSClient
|
|
61
|
+
|
|
62
|
+
with ManagementClient() as management:
|
|
63
|
+
with TOSClient(management, permission="upload", data_type="YAM",
|
|
64
|
+
data_kind="CONVERTED") as storage:
|
|
65
|
+
storage.upload_file(storage.object_prefix + "recording.td", "/data/recording.td",
|
|
66
|
+
multipart_threshold=100 * 1024**2,
|
|
67
|
+
part_size=16 * 1024**2, max_workers=4)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Both clients accept the same transfer options. Files at or above
|
|
71
|
+
`multipart_threshold` use multipart upload; `0` forces multipart for nonempty
|
|
72
|
+
files. Empty files always use PutObject. Sizes are in bytes. `part_size` must be
|
|
73
|
+
5 MiB–5 GiB, and the file must fit within 10,000 parts; increase it for larger
|
|
74
|
+
files. `max_workers` controls parallel requests (1–64); part buffers use roughly
|
|
75
|
+
`part_size * max_workers` memory, plus SDK overhead. Do not modify the source
|
|
76
|
+
file during upload.
|
|
77
|
+
|
|
78
|
+
Uploads reject existing objects by default, including when completing multipart
|
|
79
|
+
uploads. Set `forbid_overwrite=False` to replace one. Content type and metadata
|
|
80
|
+
are preserved. The return value is the provider's PutObject result for small
|
|
81
|
+
files or CompleteMultipartUpload result for multipart files.
|
|
82
|
+
|
|
83
|
+
Failed multipart transfers attempt to abort and delete incomplete parts. A failed
|
|
84
|
+
cleanup emits a warning; check the bucket's incomplete uploads. The upload role
|
|
85
|
+
and its scoped STS policy must allow `oss:AbortMultipartUpload` or
|
|
86
|
+
`tos:AbortMultipartUpload` in addition to PutObject. Deploy the management-service
|
|
87
|
+
policy update and ensure the underlying cloud role permits cleanup before use.
|
|
88
|
+
There is no persistent checkpoint: a later call starts a new upload. Uploading
|
|
89
|
+
does not register the data; call `ManagementClient.register_data` separately.
|
|
90
|
+
|
|
91
|
+
## URDF packages
|
|
92
|
+
|
|
93
|
+
Use `ManagementClient.upload_urdf(directory, entrypoint, info=...)` to check local
|
|
94
|
+
dependencies, upload source files without overwriting objects, and register one
|
|
95
|
+
asset under a new UUID on each call. Keep the directory unchanged throughout the
|
|
96
|
+
call; validation, hashing and upload read the source directly without private
|
|
97
|
+
copies. Failed calls leave uploaded objects in place and do not resume or recover
|
|
98
|
+
registration on a later call.
|
|
99
|
+
STL, static COLLADA, OBJ/MTL and PNG/JPEG references are supported; rendering is
|
|
100
|
+
checked in preview. The result is the locally generated asset UUID; model lists
|
|
101
|
+
provide URDF URLs. See the
|
|
102
|
+
[URDF guide](docs/urdf.md) and run `python -I -m current_data_py.examples.upload_urdf --help`.
|
|
103
|
+
|
|
104
|
+
## Test changes
|
|
105
|
+
|
|
106
|
+
The package bundles generated Protobuf modules during its build. After protocol
|
|
107
|
+
changes, [regenerate the bindings](../README.md#protobuf) first.
|
|
108
|
+
Build into a fresh temporary directory, validate the artifacts, and install this
|
|
109
|
+
checkout's wheel before running its checks. Only the local package is installed;
|
|
110
|
+
shared dependencies are left unchanged:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
(
|
|
114
|
+
set -e
|
|
115
|
+
sdk_dist=$(mktemp -d)
|
|
116
|
+
trap 'rm -rf "$sdk_dist"' EXIT
|
|
117
|
+
(cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
|
|
118
|
+
python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
|
|
119
|
+
python -m pip install --no-deps --force-reinstall "$sdk_dist"/*.whl
|
|
120
|
+
for check in package environment management labeling remote remote_v2 oss tos decoding multipart urdf urdf_validation docs; do
|
|
121
|
+
python -I "current_data_py/tests/check_${check}.py"
|
|
122
|
+
done
|
|
123
|
+
)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
These checks cover packaging, environment selection, clients, and media decoding
|
|
127
|
+
using local fixtures and mocked services. They do not require production credentials
|
|
128
|
+
or prove connectivity to a deployed service.
|
|
129
|
+
|
|
130
|
+
## Publish to PyPI
|
|
131
|
+
|
|
132
|
+
CI checks this SDK but does not publish it. Releases are manual and must use the
|
|
133
|
+
latest successfully fetched `origin/main`, including the version bump. Development
|
|
134
|
+
branches, uncommitted changes, and older main commits are not release sources. Follow the
|
|
135
|
+
[repository Git workflow](../.agents/rules/git-workflow.md).
|
|
136
|
+
Prepare the version update in `pyproject.toml` on a development branch and merge it
|
|
137
|
+
through review together with the intended SDK changes before building a release.
|
|
138
|
+
Use a version that has not already been published.
|
|
139
|
+
|
|
140
|
+
### Build and validate
|
|
141
|
+
|
|
142
|
+
Run from the repository root. Fetch the latest `origin/main`, record its commit,
|
|
143
|
+
and build from a clean exported copy so local edits and old artifacts cannot enter
|
|
144
|
+
the release:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
|
|
148
|
+
(
|
|
149
|
+
set -euo pipefail
|
|
150
|
+
git fetch origin
|
|
151
|
+
sdk_release_sha=$(git rev-parse origin/main)
|
|
152
|
+
printf '%s\n' "$sdk_release_sha" > "$sdk_release_dir/source-commit.txt"
|
|
153
|
+
mkdir "$sdk_release_dir/source"
|
|
154
|
+
git archive "$sdk_release_sha" | tar -x -C "$sdk_release_dir/source"
|
|
155
|
+
(cd "$sdk_release_dir/source/current_data_py" && python -m build --no-isolation --outdir "$sdk_release_dir/dist")
|
|
156
|
+
python "$sdk_release_dir/source/current_data_py/tests/check_distribution.py" --dist-dir "$sdk_release_dir/dist"
|
|
157
|
+
python -m twine check "$sdk_release_dir/dist/"*
|
|
158
|
+
python -m pip install --no-deps --force-reinstall "$sdk_release_dir/dist/"*.whl
|
|
159
|
+
(
|
|
160
|
+
cd "$sdk_release_dir"
|
|
161
|
+
unset PYTHONPATH PYTHONHOME
|
|
162
|
+
for check in package environment management labeling remote remote_v2 oss tos decoding urdf urdf_validation docs; do
|
|
163
|
+
python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
|
|
164
|
+
done
|
|
165
|
+
)
|
|
166
|
+
(cd "$sdk_release_dir/dist" && sha256sum *) > "$sdk_release_dir/SHA256SUMS"
|
|
167
|
+
)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Release checks run outside both source trees so child Python processes also use
|
|
171
|
+
the installed wheel. They come from the recorded `origin/main` commit; unmerged
|
|
172
|
+
local test fixes are not included in the export.
|
|
173
|
+
|
|
174
|
+
Continue only after every check succeeds. Confirm `source-commit.txt` contains the
|
|
175
|
+
intended main commit and inspect the wheel for the intended release features.
|
|
176
|
+
Review the built package's README metadata for public display; exclude private
|
|
177
|
+
deployment addresses, bucket names, and credentials. Keep the release directory
|
|
178
|
+
and use these exact validated artifacts for uploading.
|
|
179
|
+
|
|
180
|
+
### Upload
|
|
181
|
+
|
|
182
|
+
Use your configured PyPI credentials or Twine's interactive token prompt; do not
|
|
183
|
+
put tokens in the README or shell commands. Run from the repository root in the
|
|
184
|
+
same shell that defines `sdk_release_dir`.
|
|
185
|
+
|
|
186
|
+
Fetch main again immediately before uploading. If its commit has changed, rebuild
|
|
187
|
+
and rerun all checks from the new latest main. The command also checks that the
|
|
188
|
+
artifacts still match the hashes recorded after validation:
|
|
189
|
+
|
|
190
|
+
```sh
|
|
191
|
+
(
|
|
192
|
+
set -e
|
|
193
|
+
sdk_repository=pypi
|
|
194
|
+
git fetch origin
|
|
195
|
+
if [ "$(git rev-parse origin/main)" != "$(cat "$sdk_release_dir/source-commit.txt")" ]; then
|
|
196
|
+
echo "origin/main changed; rebuild and validate the latest main before uploading." >&2
|
|
197
|
+
exit 1
|
|
198
|
+
fi
|
|
199
|
+
(cd "$sdk_release_dir/dist" && sha256sum -c ../SHA256SUMS)
|
|
200
|
+
python -m twine upload --repository "$sdk_repository" "$sdk_release_dir/dist/"*
|
|
201
|
+
)
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
For an optional TestPyPI trial, change `sdk_repository=pypi` to
|
|
205
|
+
`sdk_repository=testpypi` in the same block and use TestPyPI credentials. Both
|
|
206
|
+
registries require the latest-main and artifact checks.
|
|
207
|
+
|
|
208
|
+
### Verify the release
|
|
209
|
+
|
|
210
|
+
After upload, verify that PyPI shows the expected version and rendered description.
|
|
211
|
+
Compare the SHA-256 digests of both published files with `SHA256SUMS`, and retain
|
|
212
|
+
that file with `source-commit.txt` as the release record. An optional TestPyPI trial
|
|
213
|
+
does not replace verification of the production PyPI release.
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
"""Protobuf message schemas and metadata for Current Data."""
|
|
2
|
-
|
|
3
|
-
import os as _os
|
|
4
|
-
|
|
5
|
-
from .schema.message_metadata import descriptor_set, topic_metadata
|
|
6
|
-
from .schema import SCHEMA_TO_CLASS
|
|
7
|
-
|
|
8
|
-
_environment = _os.environ.get("ENV") or "prod"
|
|
9
|
-
if _environment not in ("prod", "test"):
|
|
10
|
-
raise ValueError("ENV must be prod or test")
|
|
11
|
-
|
|
12
|
-
DEFAULT_ADDRESS = (
|
|
13
|
-
"data-test.current-robotics.work:443"
|
|
14
|
-
if _environment == "test" else "data.current-robotics.work:443"
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
"""Protobuf message schemas and metadata for Current Data."""
|
|
2
|
+
|
|
3
|
+
import os as _os
|
|
4
|
+
|
|
5
|
+
from .schema.message_metadata import descriptor_set, topic_metadata
|
|
6
|
+
from .schema import SCHEMA_TO_CLASS
|
|
7
|
+
|
|
8
|
+
_environment = _os.environ.get("ENV") or "prod"
|
|
9
|
+
if _environment not in ("prod", "test"):
|
|
10
|
+
raise ValueError("ENV must be prod or test")
|
|
11
|
+
|
|
12
|
+
DEFAULT_ADDRESS = (
|
|
13
|
+
"data-test.current-robotics.work:443"
|
|
14
|
+
if _environment == "test" else "data.current-robotics.work:443"
|
|
15
|
+
)
|
|
16
|
+
GLOVE_CALIBRATION_REPORT_URL = (
|
|
17
|
+
f"https://{DEFAULT_ADDRESS}"
|
|
18
|
+
"/api/collection.service.v1.CollectionService/ReportGloveCalibration"
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"DEFAULT_ADDRESS", "GLOVE_CALIBRATION_REPORT_URL", "SCHEMA_TO_CLASS",
|
|
23
|
+
"descriptor_set", "topic_metadata",
|
|
24
|
+
]
|