robocandywrapper 0.2.1__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.
Files changed (31) hide show
  1. robocandywrapper-0.2.1/LICENSE +21 -0
  2. robocandywrapper-0.2.1/MANIFEST.in +5 -0
  3. robocandywrapper-0.2.1/PKG-INFO +122 -0
  4. robocandywrapper-0.2.1/README.md +70 -0
  5. robocandywrapper-0.2.1/pyproject.toml +56 -0
  6. robocandywrapper-0.2.1/robocandywrapper/__init__.py +36 -0
  7. robocandywrapper-0.2.1/robocandywrapper/constants.py +14 -0
  8. robocandywrapper-0.2.1/robocandywrapper/dataformats/__init__.py +0 -0
  9. robocandywrapper-0.2.1/robocandywrapper/dataformats/lerobot_21/__init__.py +32 -0
  10. robocandywrapper-0.2.1/robocandywrapper/dataformats/lerobot_21/dataset.py +1077 -0
  11. robocandywrapper-0.2.1/robocandywrapper/dataformats/lerobot_21/utils.py +206 -0
  12. robocandywrapper-0.2.1/robocandywrapper/factory.py +295 -0
  13. robocandywrapper-0.2.1/robocandywrapper/metadata_view.py +280 -0
  14. robocandywrapper-0.2.1/robocandywrapper/plugin.py +94 -0
  15. robocandywrapper-0.2.1/robocandywrapper/plugins/__init__.py +18 -0
  16. robocandywrapper-0.2.1/robocandywrapper/plugins/affordance.py +180 -0
  17. robocandywrapper-0.2.1/robocandywrapper/plugins/episode_outcome.py +310 -0
  18. robocandywrapper-0.2.1/robocandywrapper/samplers/__init__.py +13 -0
  19. robocandywrapper-0.2.1/robocandywrapper/samplers/config.py +120 -0
  20. robocandywrapper-0.2.1/robocandywrapper/samplers/factory.py +184 -0
  21. robocandywrapper-0.2.1/robocandywrapper/samplers/weighted.py +129 -0
  22. robocandywrapper-0.2.1/robocandywrapper/utils.py +127 -0
  23. robocandywrapper-0.2.1/robocandywrapper/wrapper.py +475 -0
  24. robocandywrapper-0.2.1/robocandywrapper.egg-info/PKG-INFO +122 -0
  25. robocandywrapper-0.2.1/robocandywrapper.egg-info/SOURCES.txt +29 -0
  26. robocandywrapper-0.2.1/robocandywrapper.egg-info/dependency_links.txt +1 -0
  27. robocandywrapper-0.2.1/robocandywrapper.egg-info/requires.txt +10 -0
  28. robocandywrapper-0.2.1/robocandywrapper.egg-info/top_level.txt +1 -0
  29. robocandywrapper-0.2.1/setup.cfg +4 -0
  30. robocandywrapper-0.2.1/setup.py +44 -0
  31. robocandywrapper-0.2.1/tests/test_dataset_weights_integration.py +191 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ville Kuosmanen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include LICENSE
3
+ include pyproject.toml
4
+ recursive-include robocandywrapper *.py
5
+
@@ -0,0 +1,122 @@
1
+ Metadata-Version: 2.4
2
+ Name: robocandywrapper
3
+ Version: 0.2.1
4
+ Summary: Sweet wrappers for extending and remixing LeRobot Datasets
5
+ Author: RoboCandyWrapper Contributors
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Ville Kuosmanen
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/yourusername/RoboCandyWrapper
29
+ Project-URL: Repository, https://github.com/yourusername/RoboCandyWrapper
30
+ Classifier: Development Status :: 3 - Alpha
31
+ Classifier: Intended Audience :: Developers
32
+ Classifier: Intended Audience :: Science/Research
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: Programming Language :: Python :: 3.10
35
+ Classifier: Programming Language :: Python :: 3.11
36
+ Classifier: Programming Language :: Python :: 3.12
37
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
38
+ Requires-Python: >=3.10
39
+ Description-Content-Type: text/markdown
40
+ License-File: LICENSE
41
+ Requires-Dist: numpy>=1.20.0
42
+ Requires-Dist: torch>=2.0.0
43
+ Requires-Dist: lerobot<0.5,>=0.4
44
+ Requires-Dist: pandas>=1.3.0
45
+ Provides-Extra: dev
46
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
47
+ Requires-Dist: black>=22.0.0; extra == "dev"
48
+ Requires-Dist: isort>=5.10.0; extra == "dev"
49
+ Requires-Dist: flake8>=4.0.0; extra == "dev"
50
+ Dynamic: license-file
51
+ Dynamic: requires-python
52
+
53
+ # 🍬 RoboCandyWrapper
54
+
55
+ **Sweet wrappers for extending and remixing LeRobot Datasets.**
56
+
57
+ ---
58
+
59
+ ## 🍬 Why do I need this?
60
+
61
+ You have robot data. Lots of it. But it's messy:
62
+ * Some datasets are from the "old days" (v2.1 dataset).
63
+ * Some are brand new (v3.0 dataset).
64
+ * You want to mix various data sources as needed, without permanently merging them.
65
+
66
+ Traditionally, you'd have to write complex scripts to convert everything to a single format. **RoboCandyWrapper** handles that compatibility layer for you. It wraps your datasets in a sweet, consistent interface so you can focus on training, not data plumbing.
67
+
68
+ Additionally, you might want to extend your datasets with additional labels and columns without breaking backwards compatibility of data or code with LeRobot. RoboCandyWrapper provides an extendible **Adapter** system to add new data to existing datasets, load any number of adapters during training, and mixing data between adapters.
69
+
70
+ RoboCandyWrapper also includes a **Sampler** system to change the ratio of sampling between multiple data sources, so you can increase or decrease the weight of specific datasets in your data mix as needed.
71
+
72
+ RoboCandyWrapper is still experimental so do note that the library API could change in the future although we'll do our best to avoid unnecessary changes!
73
+
74
+ ## 🍬 Quick Start (5 Minutes)
75
+
76
+ ### Installation
77
+ ```bash
78
+ # Include LeRobot as a dependency in installation
79
+ pip install robocandywrapper
80
+
81
+ # OR...
82
+ # Use your own version of LeRobot - may cause issues!
83
+ pip install --no-dependencies robocandywrapper
84
+
85
+ # OR...
86
+ # Use your own version of LeRobot and install robocandywrapper as a local editable dependency so you change LeRobot imports as needed
87
+ # This might be required if you use a LeRobot fork or depend on an out of date version
88
+ git clone https://github.com/villekuosmanen/RoboCandyWrapper.git
89
+ cd RoboCandyWrapper
90
+ pip install --no-dependencies -e .
91
+ ```
92
+
93
+ ### Basic usage
94
+ Load a vintage v2.1 dataset and a modern v3.0 dataset as if they were the same thing.
95
+
96
+ ```python
97
+ from robocandywrapper import make_dataset_without_config
98
+
99
+ # Your playlist: one old, one new
100
+ repo_ids = [
101
+ "lerobot/svla_so100_pickplace", # v2.1 dataset
102
+ "lerobot/svla_so100_stacking", # v3.0 dataset
103
+ ]
104
+
105
+ # The factory handles the compatibility logic automatically
106
+ dataset = make_dataset_without_config(repo_ids)
107
+
108
+ print(f"🎉 Successfully loaded {len(dataset)} episodes from mixed sources!")
109
+ ```
110
+
111
+ ## 🍬 What more can I do with it?
112
+
113
+ ### 🎧 [The "Mix Tape" (Mixing Datasets)](docs/guide_mixing_datasets.md)
114
+ Learn how to combine multiple datasets into one, handle different robot configurations, and use sampling weights to balance your data mix.
115
+
116
+ ### 🧂 [The "Flavor Enhancer" (Transforming Data)](docs/guide_transforming_data.md)
117
+ Learn how to use **Plugins** to add new labels or columns to your dataset, reshape tensors, or modify existing data on-the-fly without breaking backwards compatability.
118
+
119
+ ## Other cool stuff from the authors
120
+
121
+ 1. [Physical AI Interpretability](https://github.com/villekuosmanen/physical-AI-interpretability) offers open-source interpretability tools for AI robotics.
122
+ 2. [RewACT](https://github.com/villekuosmanen/rewACT) is an open-source reward model / value function based on the ACT transformer architecture.
@@ -0,0 +1,70 @@
1
+ # 🍬 RoboCandyWrapper
2
+
3
+ **Sweet wrappers for extending and remixing LeRobot Datasets.**
4
+
5
+ ---
6
+
7
+ ## 🍬 Why do I need this?
8
+
9
+ You have robot data. Lots of it. But it's messy:
10
+ * Some datasets are from the "old days" (v2.1 dataset).
11
+ * Some are brand new (v3.0 dataset).
12
+ * You want to mix various data sources as needed, without permanently merging them.
13
+
14
+ Traditionally, you'd have to write complex scripts to convert everything to a single format. **RoboCandyWrapper** handles that compatibility layer for you. It wraps your datasets in a sweet, consistent interface so you can focus on training, not data plumbing.
15
+
16
+ Additionally, you might want to extend your datasets with additional labels and columns without breaking backwards compatibility of data or code with LeRobot. RoboCandyWrapper provides an extendible **Adapter** system to add new data to existing datasets, load any number of adapters during training, and mixing data between adapters.
17
+
18
+ RoboCandyWrapper also includes a **Sampler** system to change the ratio of sampling between multiple data sources, so you can increase or decrease the weight of specific datasets in your data mix as needed.
19
+
20
+ RoboCandyWrapper is still experimental so do note that the library API could change in the future although we'll do our best to avoid unnecessary changes!
21
+
22
+ ## 🍬 Quick Start (5 Minutes)
23
+
24
+ ### Installation
25
+ ```bash
26
+ # Include LeRobot as a dependency in installation
27
+ pip install robocandywrapper
28
+
29
+ # OR...
30
+ # Use your own version of LeRobot - may cause issues!
31
+ pip install --no-dependencies robocandywrapper
32
+
33
+ # OR...
34
+ # Use your own version of LeRobot and install robocandywrapper as a local editable dependency so you change LeRobot imports as needed
35
+ # This might be required if you use a LeRobot fork or depend on an out of date version
36
+ git clone https://github.com/villekuosmanen/RoboCandyWrapper.git
37
+ cd RoboCandyWrapper
38
+ pip install --no-dependencies -e .
39
+ ```
40
+
41
+ ### Basic usage
42
+ Load a vintage v2.1 dataset and a modern v3.0 dataset as if they were the same thing.
43
+
44
+ ```python
45
+ from robocandywrapper import make_dataset_without_config
46
+
47
+ # Your playlist: one old, one new
48
+ repo_ids = [
49
+ "lerobot/svla_so100_pickplace", # v2.1 dataset
50
+ "lerobot/svla_so100_stacking", # v3.0 dataset
51
+ ]
52
+
53
+ # The factory handles the compatibility logic automatically
54
+ dataset = make_dataset_without_config(repo_ids)
55
+
56
+ print(f"🎉 Successfully loaded {len(dataset)} episodes from mixed sources!")
57
+ ```
58
+
59
+ ## 🍬 What more can I do with it?
60
+
61
+ ### 🎧 [The "Mix Tape" (Mixing Datasets)](docs/guide_mixing_datasets.md)
62
+ Learn how to combine multiple datasets into one, handle different robot configurations, and use sampling weights to balance your data mix.
63
+
64
+ ### 🧂 [The "Flavor Enhancer" (Transforming Data)](docs/guide_transforming_data.md)
65
+ Learn how to use **Plugins** to add new labels or columns to your dataset, reshape tensors, or modify existing data on-the-fly without breaking backwards compatability.
66
+
67
+ ## Other cool stuff from the authors
68
+
69
+ 1. [Physical AI Interpretability](https://github.com/villekuosmanen/physical-AI-interpretability) offers open-source interpretability tools for AI robotics.
70
+ 2. [RewACT](https://github.com/villekuosmanen/rewACT) is an open-source reward model / value function based on the ACT transformer architecture.
@@ -0,0 +1,56 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "robocandywrapper"
7
+ version = "0.2.1"
8
+ description = "Sweet wrappers for extending and remixing LeRobot Datasets"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = {file = "LICENSE"}
12
+ authors = [
13
+ {name = "RoboCandyWrapper Contributors"}
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "Intended Audience :: Science/Research",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
24
+ ]
25
+ dependencies = [
26
+ "numpy>=1.20.0",
27
+ "torch>=2.0.0",
28
+ "lerobot>=0.4,<0.5",
29
+ "pandas>=1.3.0",
30
+ ]
31
+
32
+ [project.optional-dependencies]
33
+ dev = [
34
+ "pytest>=7.0.0",
35
+ "black>=22.0.0",
36
+ "isort>=5.10.0",
37
+ "flake8>=4.0.0",
38
+ ]
39
+
40
+ [project.urls]
41
+ Homepage = "https://github.com/yourusername/RoboCandyWrapper"
42
+ Repository = "https://github.com/yourusername/RoboCandyWrapper"
43
+
44
+ [tool.setuptools.packages.find]
45
+ where = ["."]
46
+ include = ["robocandywrapper*"]
47
+ exclude = ["examples*", "tests*"]
48
+
49
+ [tool.black]
50
+ line-length = 100
51
+ target-version = ['py310']
52
+
53
+ [tool.isort]
54
+ profile = "black"
55
+ line_length = 100
56
+
@@ -0,0 +1,36 @@
1
+ """RoboCandyWrapper - Extensible dataset wrapper for LeRobot datasets."""
2
+
3
+ from robocandywrapper.plugin import (
4
+ DatasetPlugin,
5
+ PluginInstance,
6
+ PluginConflictError,
7
+ )
8
+ from robocandywrapper.wrapper import WrappedRobotDataset
9
+ from robocandywrapper.metadata_view import WrappedRobotDatasetMetadataView
10
+ from robocandywrapper.samplers.weighted import WeightedSampler
11
+ from robocandywrapper.samplers.factory import make_sampler
12
+ from robocandywrapper.factory import make_dataset_without_config, make_dataset
13
+ from robocandywrapper.utils import WandBLogger
14
+ from robocandywrapper.constants import (
15
+ CANDYWRAPPER_PLUGINS_DIR,
16
+ AFFORDANCE_PLUGIN_NAME,
17
+ EPISODE_OUTCOME_PLUGIN_NAME,
18
+ )
19
+
20
+ __version__ = "0.2.1"
21
+
22
+ __all__ = [
23
+ "DatasetPlugin",
24
+ "PluginInstance",
25
+ "PluginConflictError",
26
+ "WrappedRobotDataset",
27
+ "WrappedRobotDatasetMetadataView",
28
+ "WeightedSampler",
29
+ "make_sampler",
30
+ "make_dataset_without_config",
31
+ "make_dataset",
32
+ "WandBLogger",
33
+ "CANDYWRAPPER_PLUGINS_DIR",
34
+ "AFFORDANCE_PLUGIN_NAME",
35
+ "EPISODE_OUTCOME_PLUGIN_NAME",
36
+ ]
@@ -0,0 +1,14 @@
1
+ """
2
+ Constants for RoboCandyWrapper plugins and data storage.
3
+ """
4
+
5
+ # Plugin storage directory (relative to dataset root)
6
+ CANDYWRAPPER_PLUGINS_DIR = "candywrapper_plugins"
7
+
8
+ # Plugin-specific subdirectory names
9
+ AFFORDANCE_PLUGIN_NAME = "affordance"
10
+ EPISODE_OUTCOME_PLUGIN_NAME = "episode_outcome"
11
+ # Add more plugin names here as needed
12
+ # GOAL_PLUGIN_NAME = "goal"
13
+ # LANGUAGE_PLUGIN_NAME = "language"
14
+
@@ -0,0 +1,32 @@
1
+ from .dataset import LeRobot21Dataset, LeRobot21DatasetMetadata
2
+ from .utils import (
3
+ load_tasks,
4
+ load_episodes,
5
+ append_jsonlines,
6
+ load_jsonlines,
7
+ serialize_dict,
8
+ cast_stats_to_numpy,
9
+ write_episode,
10
+ write_episode_stats,
11
+ load_episodes_stats,
12
+ backward_compatible_episodes_stats,
13
+ get_episode_data_index,
14
+ check_timestamps_sync,
15
+ )
16
+
17
+ __all__ = [
18
+ "LeRobot21Dataset",
19
+ "LeRobot21DatasetMetadata",
20
+ "load_tasks",
21
+ "load_episodes",
22
+ "append_jsonlines",
23
+ "load_jsonlines",
24
+ "serialize_dict",
25
+ "cast_stats_to_numpy",
26
+ "write_episode",
27
+ "write_episode_stats",
28
+ "load_episodes_stats",
29
+ "backward_compatible_episodes_stats",
30
+ "get_episode_data_index",
31
+ "check_timestamps_sync",
32
+ ]