current-data-py 0.1.16__tar.gz → 0.1.17__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.17}/MANIFEST.in +8 -8
- {current_data_py-0.1.16/current_data_py.egg-info → current_data_py-0.1.17}/PKG-INFO +9 -3
- {current_data_py-0.1.16 → current_data_py-0.1.17}/README.md +191 -185
- {current_data_py-0.1.16 → current_data_py-0.1.17}/__init__.py +24 -17
- {current_data_py-0.1.16 → current_data_py-0.1.17}/_multipart.py +52 -52
- {current_data_py-0.1.16 → current_data_py-0.1.17/current_data_py.egg-info}/PKG-INFO +9 -3
- {current_data_py-0.1.16 → current_data_py-0.1.17}/decoding.py +179 -184
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/api/management.md +470 -363
- current_data_py-0.1.17/docs/api/processing.md +699 -0
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/index.md +70 -66
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/convert-robot-data/SKILL.md +211 -211
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/SKILL.md +32 -29
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/references/api.md +37 -34
- current_data_py-0.1.17/docs/skills/data-platform/references/data-transfer.md +62 -0
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/references/dev-pod.md +62 -62
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/references/jobs.md +86 -86
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/references/test-environment.md +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/references/use-cases.md +82 -82
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/sdk-client/SKILL.md +11 -11
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/sdk-client/references/data-client.md +379 -279
- current_data_py-0.1.17/docs/skills/sdk-client/references/metadata-v2.md +156 -0
- {current_data_py-0.1.16 → current_data_py-0.1.17}/docs.py +46 -46
- {current_data_py-0.1.16 → current_data_py-0.1.17}/examples/__init__.py +1 -1
- {current_data_py-0.1.16 → current_data_py-0.1.17}/examples/list_schemas.py +7 -7
- {current_data_py-0.1.16 → current_data_py-0.1.17}/examples/read_remote_td.py +54 -54
- {current_data_py-0.1.16 → current_data_py-0.1.17}/examples/read_td.py +30 -30
- {current_data_py-0.1.16 → current_data_py-0.1.17}/examples/write_td.py +30 -30
- {current_data_py-0.1.16 → current_data_py-0.1.17}/labeling.py +102 -102
- {current_data_py-0.1.16 → current_data_py-0.1.17}/management.py +312 -233
- {current_data_py-0.1.16 → current_data_py-0.1.17}/oss.py +229 -229
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/labeling/service/service_pb2.py +79 -79
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/labeling/service/service_pb2_grpc.py +435 -435
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/labeling/task/task_pb2.py +52 -52
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/labeling/template/template_pb2.py +40 -40
- current_data_py-0.1.17/proto_gen/python/management/metadata/metadata_pb2.py +74 -0
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/management/selection/selection_pb2.py +27 -27
- current_data_py-0.1.17/proto_gen/python/management/service/service_pb2.py +118 -0
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/management/service/service_pb2_grpc.py +831 -528
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/builtin_interfaces/duration_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/builtin_interfaces/time_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/encoder_status_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/joint_current_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/keypoints_quality_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/pose_rpy_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/slam_quality_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/sonic_frame_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/subtask_description_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/target_quality_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/foxglove/compressed_audio_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/foxglove/compressed_video_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/point32_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/point_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/pose_array_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/pose_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/pose_stamped_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/pose_with_covariance_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/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.17}/proto_gen/python/msg/geometry_msgs/quaternion_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/transform_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/transform_stamped_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/twist_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/twist_stamped_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/twist_with_covariance_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/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.17}/proto_gen/python/msg/geometry_msgs/vector3_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/wrench_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/wrench_stamped_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/nav_msgs/map_meta_data_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/nav_msgs/occupancy_grid_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/nav_msgs/odometry_pb2.py +28 -28
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/nav_msgs/path_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/battery_state_pb2.py +32 -32
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/camera_info_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/compressed_image_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/image_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/imu_pb2.py +28 -28
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/joint_state_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/laser_scan_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/nav_sat_fix_pb2.py +29 -29
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/nav_sat_status_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/point_cloud2_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/point_field_pb2.py +27 -27
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/range_pb2.py +28 -28
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/region_of_interest_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/bool_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/color_rgba_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/float32_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/float64_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/header_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/int32_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/string_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/uint32_pb2.py +25 -25
- {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/tf2_msgs/tf_message_pb2.py +26 -26
- {current_data_py-0.1.16 → current_data_py-0.1.17}/pyproject.toml +24 -24
- {current_data_py-0.1.16 → current_data_py-0.1.17}/remote/__init__.py +7 -7
- current_data_py-0.1.17/remote/client.py +293 -0
- {current_data_py-0.1.16 → current_data_py-0.1.17}/remote/source.py +99 -99
- {current_data_py-0.1.16 → current_data_py-0.1.17}/remote/tos_source.py +84 -84
- {current_data_py-0.1.16 → current_data_py-0.1.17}/schema/__init__.py +113 -113
- {current_data_py-0.1.16 → current_data_py-0.1.17}/schema/message_metadata.py +30 -30
- {current_data_py-0.1.16 → current_data_py-0.1.17}/setup.py +93 -93
- {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_docs.py +74 -79
- {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_environment.py +83 -79
- {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_labeling.py +111 -111
- {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_management.py +588 -469
- {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_oss.py +424 -424
- {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_package.py +44 -44
- {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_remote.py +343 -343
- {current_data_py-0.1.16 → current_data_py-0.1.17}/tos.py +191 -191
- current_data_py-0.1.16/docs/api/processing.md +0 -401
- 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.17}/current_data_py.egg-info/SOURCES.txt +0 -0
- {current_data_py-0.1.16 → current_data_py-0.1.17}/current_data_py.egg-info/dependency_links.txt +0 -0
- {current_data_py-0.1.16 → current_data_py-0.1.17}/current_data_py.egg-info/requires.txt +0 -0
- {current_data_py-0.1.16 → current_data_py-0.1.17}/current_data_py.egg-info/top_level.txt +0 -0
- {current_data_py-0.1.16 → current_data_py-0.1.17}/setup.cfg +0 -0
|
@@ -1,8 +1,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
|
-
recursive-include docs *.md
|
|
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
|
+
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.17
|
|
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,12 @@ 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
|
+
Calibration workers can import `GLOVE_CALIBRATION_REPORT_URL` from
|
|
53
|
+
`current_data_py` for the environment's HTTPS Collection callback endpoint on
|
|
54
|
+
`DEFAULT_ADDRESS` (port 443).
|
|
55
|
+
Processing supplies `ENV` to the Job; set it before the first SDK import.
|
|
56
|
+
The worker needs network access to that platform domain.
|
|
57
|
+
|
|
52
58
|
## Upload files
|
|
53
59
|
|
|
54
60
|
Use `OSSClient` or `TOSClient` with upload permission. The management service
|
|
@@ -103,7 +109,7 @@ shared dependencies are left unchanged:
|
|
|
103
109
|
(cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
|
|
104
110
|
python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
|
|
105
111
|
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
|
|
112
|
+
for check in package environment management labeling remote remote_v2 oss tos decoding multipart docs; do
|
|
107
113
|
python -I "current_data_py/tests/check_${check}.py"
|
|
108
114
|
done
|
|
109
115
|
)
|
|
@@ -145,7 +151,7 @@ sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
|
|
|
145
151
|
(
|
|
146
152
|
cd "$sdk_release_dir"
|
|
147
153
|
unset PYTHONPATH PYTHONHOME
|
|
148
|
-
for check in package environment management labeling remote oss tos decoding; do
|
|
154
|
+
for check in package environment management labeling remote remote_v2 oss tos decoding; do
|
|
149
155
|
python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
|
|
150
156
|
done
|
|
151
157
|
)
|
|
@@ -1,185 +1,191 @@
|
|
|
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
|
-
|
|
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
|
+
Calibration workers can import `GLOVE_CALIBRATION_REPORT_URL` from
|
|
39
|
+
`current_data_py` for the environment's HTTPS Collection callback endpoint on
|
|
40
|
+
`DEFAULT_ADDRESS` (port 443).
|
|
41
|
+
Processing supplies `ENV` to the Job; set it before the first SDK import.
|
|
42
|
+
The worker needs network access to that platform domain.
|
|
43
|
+
|
|
44
|
+
## Upload files
|
|
45
|
+
|
|
46
|
+
Use `OSSClient` or `TOSClient` with upload permission. The management service
|
|
47
|
+
selects the bucket and allowed object prefix; keep it open during transfers:
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from current_data_py.management import ManagementClient
|
|
51
|
+
from current_data_py.tos import TOSClient
|
|
52
|
+
|
|
53
|
+
with ManagementClient() as management:
|
|
54
|
+
with TOSClient(management, permission="upload", data_type="YAM",
|
|
55
|
+
data_kind="CONVERTED") as storage:
|
|
56
|
+
storage.upload_file(storage.object_prefix + "recording.td", "/data/recording.td",
|
|
57
|
+
multipart_threshold=100 * 1024**2,
|
|
58
|
+
part_size=16 * 1024**2, max_workers=4)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Both clients accept the same transfer options. Files at or above
|
|
62
|
+
`multipart_threshold` use multipart upload; `0` forces multipart for nonempty
|
|
63
|
+
files. Empty files always use PutObject. Sizes are in bytes. `part_size` must be
|
|
64
|
+
5 MiB–5 GiB, and the file must fit within 10,000 parts; increase it for larger
|
|
65
|
+
files. `max_workers` controls parallel requests (1–64); part buffers use roughly
|
|
66
|
+
`part_size * max_workers` memory, plus SDK overhead. Do not modify the source
|
|
67
|
+
file during upload.
|
|
68
|
+
|
|
69
|
+
Uploads reject existing objects by default, including when completing multipart
|
|
70
|
+
uploads. Set `forbid_overwrite=False` to replace one. Content type and metadata
|
|
71
|
+
are preserved. The return value is the provider's PutObject result for small
|
|
72
|
+
files or CompleteMultipartUpload result for multipart files.
|
|
73
|
+
|
|
74
|
+
Failed multipart transfers attempt to abort and delete incomplete parts. A failed
|
|
75
|
+
cleanup emits a warning; check the bucket's incomplete uploads. The upload role
|
|
76
|
+
and its scoped STS policy must allow `oss:AbortMultipartUpload` or
|
|
77
|
+
`tos:AbortMultipartUpload` in addition to PutObject. Deploy the management-service
|
|
78
|
+
policy update and ensure the underlying cloud role permits cleanup before use.
|
|
79
|
+
There is no persistent checkpoint: a later call starts a new upload. Uploading
|
|
80
|
+
does not register the data; call `ManagementClient.register_data` separately.
|
|
81
|
+
|
|
82
|
+
## Test changes
|
|
83
|
+
|
|
84
|
+
The package bundles generated Protobuf modules during its build. After protocol
|
|
85
|
+
changes, [regenerate the bindings](../README.md#protobuf) first.
|
|
86
|
+
Build into a fresh temporary directory, validate the artifacts, and install this
|
|
87
|
+
checkout's wheel before running its checks. Only the local package is installed;
|
|
88
|
+
shared dependencies are left unchanged:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
(
|
|
92
|
+
set -e
|
|
93
|
+
sdk_dist=$(mktemp -d)
|
|
94
|
+
trap 'rm -rf "$sdk_dist"' EXIT
|
|
95
|
+
(cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
|
|
96
|
+
python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
|
|
97
|
+
python -m pip install --no-deps --force-reinstall "$sdk_dist"/*.whl
|
|
98
|
+
for check in package environment management labeling remote remote_v2 oss tos decoding multipart docs; do
|
|
99
|
+
python -I "current_data_py/tests/check_${check}.py"
|
|
100
|
+
done
|
|
101
|
+
)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
These checks cover packaging, environment selection, clients, and media decoding
|
|
105
|
+
using local fixtures and mocked services. They do not require production credentials
|
|
106
|
+
or prove connectivity to a deployed service.
|
|
107
|
+
|
|
108
|
+
## Publish to PyPI
|
|
109
|
+
|
|
110
|
+
CI checks this SDK but does not publish it. Releases are manual and must use the
|
|
111
|
+
latest successfully fetched `origin/main`, including the version bump. Development
|
|
112
|
+
branches, uncommitted changes, and older main commits are not release sources. Follow the
|
|
113
|
+
[repository Git workflow](../.agents/rules/git-workflow.md).
|
|
114
|
+
Prepare the version update in `pyproject.toml` on a development branch and merge it
|
|
115
|
+
through review together with the intended SDK changes before building a release.
|
|
116
|
+
Use a version that has not already been published.
|
|
117
|
+
|
|
118
|
+
### Build and validate
|
|
119
|
+
|
|
120
|
+
Run from the repository root. Fetch the latest `origin/main`, record its commit,
|
|
121
|
+
and build from a clean exported copy so local edits and old artifacts cannot enter
|
|
122
|
+
the release:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
|
|
126
|
+
(
|
|
127
|
+
set -euo pipefail
|
|
128
|
+
git fetch origin
|
|
129
|
+
sdk_release_sha=$(git rev-parse origin/main)
|
|
130
|
+
printf '%s\n' "$sdk_release_sha" > "$sdk_release_dir/source-commit.txt"
|
|
131
|
+
mkdir "$sdk_release_dir/source"
|
|
132
|
+
git archive "$sdk_release_sha" | tar -x -C "$sdk_release_dir/source"
|
|
133
|
+
(cd "$sdk_release_dir/source/current_data_py" && python -m build --no-isolation --outdir "$sdk_release_dir/dist")
|
|
134
|
+
python "$sdk_release_dir/source/current_data_py/tests/check_distribution.py" --dist-dir "$sdk_release_dir/dist"
|
|
135
|
+
python -m twine check "$sdk_release_dir/dist/"*
|
|
136
|
+
python -m pip install --no-deps --force-reinstall "$sdk_release_dir/dist/"*.whl
|
|
137
|
+
(
|
|
138
|
+
cd "$sdk_release_dir"
|
|
139
|
+
unset PYTHONPATH PYTHONHOME
|
|
140
|
+
for check in package environment management labeling remote remote_v2 oss tos decoding; do
|
|
141
|
+
python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
|
|
142
|
+
done
|
|
143
|
+
)
|
|
144
|
+
(cd "$sdk_release_dir/dist" && sha256sum *) > "$sdk_release_dir/SHA256SUMS"
|
|
145
|
+
)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Release checks run outside both source trees so child Python processes also use
|
|
149
|
+
the installed wheel. They come from the recorded `origin/main` commit; unmerged
|
|
150
|
+
local test fixes are not included in the export.
|
|
151
|
+
|
|
152
|
+
Continue only after every check succeeds. Confirm `source-commit.txt` contains the
|
|
153
|
+
intended main commit and inspect the wheel for the intended release features.
|
|
154
|
+
Review the built package's README metadata for public display; exclude private
|
|
155
|
+
deployment addresses, bucket names, and credentials. Keep the release directory
|
|
156
|
+
and use these exact validated artifacts for uploading.
|
|
157
|
+
|
|
158
|
+
### Upload
|
|
159
|
+
|
|
160
|
+
Use your configured PyPI credentials or Twine's interactive token prompt; do not
|
|
161
|
+
put tokens in the README or shell commands. Run from the repository root in the
|
|
162
|
+
same shell that defines `sdk_release_dir`.
|
|
163
|
+
|
|
164
|
+
Fetch main again immediately before uploading. If its commit has changed, rebuild
|
|
165
|
+
and rerun all checks from the new latest main. The command also checks that the
|
|
166
|
+
artifacts still match the hashes recorded after validation:
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
(
|
|
170
|
+
set -e
|
|
171
|
+
sdk_repository=pypi
|
|
172
|
+
git fetch origin
|
|
173
|
+
if [ "$(git rev-parse origin/main)" != "$(cat "$sdk_release_dir/source-commit.txt")" ]; then
|
|
174
|
+
echo "origin/main changed; rebuild and validate the latest main before uploading." >&2
|
|
175
|
+
exit 1
|
|
176
|
+
fi
|
|
177
|
+
(cd "$sdk_release_dir/dist" && sha256sum -c ../SHA256SUMS)
|
|
178
|
+
python -m twine upload --repository "$sdk_repository" "$sdk_release_dir/dist/"*
|
|
179
|
+
)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
For an optional TestPyPI trial, change `sdk_repository=pypi` to
|
|
183
|
+
`sdk_repository=testpypi` in the same block and use TestPyPI credentials. Both
|
|
184
|
+
registries require the latest-main and artifact checks.
|
|
185
|
+
|
|
186
|
+
### Verify the release
|
|
187
|
+
|
|
188
|
+
After upload, verify that PyPI shows the expected version and rendered description.
|
|
189
|
+
Compare the SHA-256 digests of both published files with `SHA256SUMS`, and retain
|
|
190
|
+
that file with `source-commit.txt` as the release record. An optional TestPyPI trial
|
|
191
|
+
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
|
+
]
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
"""Bounded-memory multipart scheduling shared by OSS and TOS."""
|
|
2
|
-
from concurrent.futures import ThreadPoolExecutor
|
|
3
|
-
import os
|
|
4
|
-
import warnings
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def upload_size(path, threshold, part_size, max_workers):
|
|
8
|
-
for name, value, minimum, maximum in (
|
|
9
|
-
("multipart_threshold", threshold, 0, 5 * 1024**3),
|
|
10
|
-
("part_size", part_size, 5 * 1024**2, 5 * 1024**3),
|
|
11
|
-
("max_workers", max_workers, 1, 64),
|
|
12
|
-
):
|
|
13
|
-
if isinstance(value, bool) or not isinstance(value, int) or not minimum <= value <= maximum:
|
|
14
|
-
raise ValueError(f"{name} must be an integer between {minimum} and {maximum}")
|
|
15
|
-
size = os.stat(path).st_size
|
|
16
|
-
if (size + part_size - 1) // part_size > 10000:
|
|
17
|
-
raise ValueError("Upload exceeds 10000 parts; increase part_size")
|
|
18
|
-
return size
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def transfer(path, size, part_size, max_workers, start, put, complete, abort):
|
|
22
|
-
# Verify the file before creating any remote upload. Each worker opens its
|
|
23
|
-
# own handle and retains at most one part; queued tasks contain only offsets.
|
|
24
|
-
with open(path, "rb") as source:
|
|
25
|
-
before = os.fstat(source.fileno())
|
|
26
|
-
if before.st_size != size:
|
|
27
|
-
raise ValueError("Upload source changed before transfer")
|
|
28
|
-
upload_id = start()
|
|
29
|
-
|
|
30
|
-
def send(number):
|
|
31
|
-
offset = (number - 1) * part_size
|
|
32
|
-
length = min(part_size, size - offset)
|
|
33
|
-
with open(path, "rb") as source:
|
|
34
|
-
source.seek(offset)
|
|
35
|
-
data = source.read(length)
|
|
36
|
-
if len(data) != length:
|
|
37
|
-
raise ValueError("Upload source changed during transfer")
|
|
38
|
-
return number, put(upload_id, number, data)
|
|
39
|
-
|
|
40
|
-
try:
|
|
41
|
-
with ThreadPoolExecutor(max_workers=max_workers) as pool:
|
|
42
|
-
parts = list(pool.map(send, range(1, (size + part_size - 1) // part_size + 1)))
|
|
43
|
-
after = os.stat(path)
|
|
44
|
-
if (before.st_size, before.st_mtime_ns, before.st_ino) != (after.st_size, after.st_mtime_ns, after.st_ino):
|
|
45
|
-
raise ValueError("Upload source changed during transfer")
|
|
46
|
-
return complete(upload_id, parts)
|
|
47
|
-
except BaseException:
|
|
48
|
-
try:
|
|
49
|
-
abort(upload_id)
|
|
50
|
-
except Exception:
|
|
51
|
-
warnings.warn("Multipart cleanup failed; incomplete parts may remain in storage", RuntimeWarning)
|
|
52
|
-
raise
|
|
1
|
+
"""Bounded-memory multipart scheduling shared by OSS and TOS."""
|
|
2
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
3
|
+
import os
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def upload_size(path, threshold, part_size, max_workers):
|
|
8
|
+
for name, value, minimum, maximum in (
|
|
9
|
+
("multipart_threshold", threshold, 0, 5 * 1024**3),
|
|
10
|
+
("part_size", part_size, 5 * 1024**2, 5 * 1024**3),
|
|
11
|
+
("max_workers", max_workers, 1, 64),
|
|
12
|
+
):
|
|
13
|
+
if isinstance(value, bool) or not isinstance(value, int) or not minimum <= value <= maximum:
|
|
14
|
+
raise ValueError(f"{name} must be an integer between {minimum} and {maximum}")
|
|
15
|
+
size = os.stat(path).st_size
|
|
16
|
+
if (size + part_size - 1) // part_size > 10000:
|
|
17
|
+
raise ValueError("Upload exceeds 10000 parts; increase part_size")
|
|
18
|
+
return size
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def transfer(path, size, part_size, max_workers, start, put, complete, abort):
|
|
22
|
+
# Verify the file before creating any remote upload. Each worker opens its
|
|
23
|
+
# own handle and retains at most one part; queued tasks contain only offsets.
|
|
24
|
+
with open(path, "rb") as source:
|
|
25
|
+
before = os.fstat(source.fileno())
|
|
26
|
+
if before.st_size != size:
|
|
27
|
+
raise ValueError("Upload source changed before transfer")
|
|
28
|
+
upload_id = start()
|
|
29
|
+
|
|
30
|
+
def send(number):
|
|
31
|
+
offset = (number - 1) * part_size
|
|
32
|
+
length = min(part_size, size - offset)
|
|
33
|
+
with open(path, "rb") as source:
|
|
34
|
+
source.seek(offset)
|
|
35
|
+
data = source.read(length)
|
|
36
|
+
if len(data) != length:
|
|
37
|
+
raise ValueError("Upload source changed during transfer")
|
|
38
|
+
return number, put(upload_id, number, data)
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
with ThreadPoolExecutor(max_workers=max_workers) as pool:
|
|
42
|
+
parts = list(pool.map(send, range(1, (size + part_size - 1) // part_size + 1)))
|
|
43
|
+
after = os.stat(path)
|
|
44
|
+
if (before.st_size, before.st_mtime_ns, before.st_ino) != (after.st_size, after.st_mtime_ns, after.st_ino):
|
|
45
|
+
raise ValueError("Upload source changed during transfer")
|
|
46
|
+
return complete(upload_id, parts)
|
|
47
|
+
except BaseException:
|
|
48
|
+
try:
|
|
49
|
+
abort(upload_id)
|
|
50
|
+
except Exception:
|
|
51
|
+
warnings.warn("Multipart cleanup failed; incomplete parts may remain in storage", RuntimeWarning)
|
|
52
|
+
raise
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: current-data-py
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.17
|
|
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,12 @@ 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
|
+
Calibration workers can import `GLOVE_CALIBRATION_REPORT_URL` from
|
|
53
|
+
`current_data_py` for the environment's HTTPS Collection callback endpoint on
|
|
54
|
+
`DEFAULT_ADDRESS` (port 443).
|
|
55
|
+
Processing supplies `ENV` to the Job; set it before the first SDK import.
|
|
56
|
+
The worker needs network access to that platform domain.
|
|
57
|
+
|
|
52
58
|
## Upload files
|
|
53
59
|
|
|
54
60
|
Use `OSSClient` or `TOSClient` with upload permission. The management service
|
|
@@ -103,7 +109,7 @@ shared dependencies are left unchanged:
|
|
|
103
109
|
(cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
|
|
104
110
|
python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
|
|
105
111
|
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
|
|
112
|
+
for check in package environment management labeling remote remote_v2 oss tos decoding multipart docs; do
|
|
107
113
|
python -I "current_data_py/tests/check_${check}.py"
|
|
108
114
|
done
|
|
109
115
|
)
|
|
@@ -145,7 +151,7 @@ sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
|
|
|
145
151
|
(
|
|
146
152
|
cd "$sdk_release_dir"
|
|
147
153
|
unset PYTHONPATH PYTHONHOME
|
|
148
|
-
for check in package environment management labeling remote oss tos decoding; do
|
|
154
|
+
for check in package environment management labeling remote remote_v2 oss tos decoding; do
|
|
149
155
|
python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
|
|
150
156
|
done
|
|
151
157
|
)
|