Skip to content

Commit 2f8e584

Browse files
authored
feat: use pipefunc.helpers.collect_kwargs (#30)
1 parent a61a037 commit 2f8e584

File tree

7 files changed

+19
-69
lines changed

7 files changed

+19
-69
lines changed

config/_templates/dataset/yaak.yaml

+7-12
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,17 @@ inputs:
3535
cache_dir: /tmp/rbyte-cache
3636
functions:
3737
- _target_: pipefunc.PipeFunc
38-
scope: meta
39-
output_name: data
38+
scope: yaak_metadata
39+
output_name: output
4040
cache: true
4141
func:
4242
_target_: hydra.utils.get_method
4343
path: rbyte.io.build_yaak_metadata_dataframe
4444

4545
- _target_: pipefunc.PipeFunc
46-
scope: mcap
4746
bound:
4847
path: ${data_dir}/(@=input_id@)/ai.mcap
49-
output_name: data
48+
output_name: mcap
5049
func:
5150
_target_: rbyte.io.McapDataFrameBuilder
5251
decoder_factories: [rbyte.utils._mcap.ProtobufDecoderFactory]
@@ -61,14 +60,10 @@ inputs:
6160

6261
- _target_: pipefunc.PipeFunc
6362
func:
64-
_target_: hydra.utils.get_method
65-
path: rbyte.utils.make_dict
66-
bound:
67-
k0: meta
68-
k1: mcap
63+
_target_: pipefunc.helpers.collect_kwargs
64+
parameters: [meta, mcap]
6965
renames:
70-
v0: meta.data
71-
v1: mcap.data
66+
meta: yaak_metadata.output
7267
output_name: data
7368

7469
- _target_: pipefunc.PipeFunc
@@ -137,7 +132,7 @@ inputs:
137132
length: 6
138133

139134
kwargs:
140-
meta:
135+
yaak_metadata:
141136
path: ${data_dir}/(@=input_id@)/metadata.log
142137
fields:
143138
rbyte.io.yaak.proto.sensor_pb2.ImageMetadata:

config/_templates/dataset/zod.yaml

+5-13
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ inputs:
3232
- _target_: pipefunc.PipeFunc
3333
bound:
3434
path: "${data_dir}/sequences/000002_short/camera_front_blur/000002_romeo_{timestamp:%Y-%m-%dT%H:%M:%S.%f}Z.jpg"
35-
output_name: camera_front_blur_data
35+
output_name: camera_front_blur
3636
func:
3737
_target_: rbyte.io.PathDataFrameBuilder
3838
fields:
@@ -43,7 +43,7 @@ inputs:
4343
- _target_: pipefunc.PipeFunc
4444
bound:
4545
path: "${data_dir}/sequences/000002_short/lidar_velodyne/000002_romeo_{timestamp:%Y-%m-%dT%H:%M:%S.%f}Z.npy"
46-
output_name: lidar_velodyne_data
46+
output_name: lidar_velodyne
4747
func:
4848
_target_: rbyte.io.PathDataFrameBuilder
4949
fields:
@@ -74,18 +74,10 @@ inputs:
7474
speed/meters_per_second/value:
7575

7676
- _target_: pipefunc.PipeFunc
77-
bound:
78-
k0: camera_front_blur
79-
k1: lidar_velodyne
80-
k2: vehicle_data
81-
renames:
82-
v0: camera_front_blur_data
83-
v1: lidar_velodyne_data
84-
v2: vehicle_data
85-
output_name: data
8677
func:
87-
_target_: hydra.utils.get_method
88-
path: rbyte.utils.make_dict
78+
_target_: pipefunc.helpers.collect_kwargs
79+
parameters: [camera_front_blur, lidar_velodyne, vehicle_data]
80+
output_name: data
8981

9082
- _target_: pipefunc.PipeFunc
9183
renames:

pyproject.toml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[project]
22
name = "rbyte"
3-
version = "0.10.1"
3+
version = "0.10.2"
44
description = "Multimodal PyTorch dataset library"
55
authors = [{ name = "Evgenii Gorchakov", email = "[email protected]" }]
66
maintainers = [{ name = "Evgenii Gorchakov", email = "[email protected]" }]
77
dependencies = [
88
"tensordict>=0.6.2",
99
"torch",
1010
"numpy",
11-
"polars>=1.16.0",
11+
"polars>=1.18.0",
1212
"pydantic>=2.10.2",
1313
"more-itertools>=10.5.0",
1414
"hydra-core>=1.3.2",
@@ -17,9 +17,8 @@ dependencies = [
1717
"diskcache>=5.6.3",
1818
"parse>=1.20.2",
1919
"structlog>=24.4.0",
20-
"xxhash>=3.5.0",
2120
"tqdm>=4.66.5",
22-
"pipefunc>=0.41.0",
21+
"pipefunc>=0.46.0",
2322
]
2423
readme = "README.md"
2524
requires-python = ">=3.12,<3.13"
@@ -39,7 +38,7 @@ repo = "https://github.com/yaak-ai/rbyte"
3938

4039
[project.optional-dependencies]
4140
build = ["hatchling>=1.25.0", "grpcio-tools>=1.62.0", "protoletariat==3.2.19"]
42-
visualize = ["rerun-sdk[notebook]>=0.20.2"]
41+
visualize = ["rerun-sdk[notebook]>=0.21.0"]
4342
mcap = [
4443
"mcap>=1.2.1",
4544
"mcap-ros2-support>=0.5.5",
@@ -53,7 +52,7 @@ video = [
5352
"video-reader-rs>=0.2.1",
5453
]
5554
hdf5 = ["h5py>=3.12.1"]
56-
rrd = ["rerun-sdk>=0.20.2", "pyarrow-stubs"]
55+
rrd = ["rerun-sdk>=0.21.0", "pyarrow-stubs"]
5756

5857
[project.scripts]
5958
rbyte-visualize = 'rbyte.scripts.visualize:main'

src/rbyte/io/yaak/idl-repo

src/rbyte/utils/__init__.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
from ._pipefunc import make_dict
2-
3-
__all__ = ["make_dict"]

src/rbyte/utils/_pipefunc.py

-33
This file was deleted.

src/rbyte/viz/loggers/rerun_logger.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,6 @@ def log(self, batch_idx: int, batch: Batch) -> None:
209209
rr.send_columns(
210210
entity_path=entity_path,
211211
times=times,
212-
components=components, # pyright: ignore[reportArgumentType]
212+
components=components,
213213
strict=True,
214214
)

0 commit comments

Comments
 (0)