robocandywrapper 0.2.9__tar.gz → 0.2.11__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 (35) hide show
  1. {robocandywrapper-0.2.9/robocandywrapper.egg-info → robocandywrapper-0.2.11}/PKG-INFO +1 -1
  2. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/pyproject.toml +1 -1
  3. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/__init__.py +1 -1
  4. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/metadata_view.py +19 -5
  5. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/wrapper.py +8 -3
  6. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11/robocandywrapper.egg-info}/PKG-INFO +1 -1
  7. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/setup.py +1 -1
  8. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/LICENSE +0 -0
  9. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/MANIFEST.in +0 -0
  10. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/README.md +0 -0
  11. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/constants.py +0 -0
  12. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/__init__.py +0 -0
  13. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/lerobot_21/__init__.py +0 -0
  14. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/lerobot_21/convert_v20_to_v21.py +0 -0
  15. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/lerobot_21/dataset.py +0 -0
  16. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/lerobot_21/utils.py +0 -0
  17. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/factory.py +0 -0
  18. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugin.py +0 -0
  19. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugins/__init__.py +0 -0
  20. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugins/affordance.py +0 -0
  21. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugins/control_mode.py +0 -0
  22. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugins/episode_outcome.py +0 -0
  23. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugins/subtask.py +0 -0
  24. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/samplers/__init__.py +0 -0
  25. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/samplers/config.py +0 -0
  26. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/samplers/factory.py +0 -0
  27. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/samplers/weighted.py +0 -0
  28. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/utils.py +0 -0
  29. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper.egg-info/SOURCES.txt +0 -0
  30. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper.egg-info/dependency_links.txt +0 -0
  31. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper.egg-info/requires.txt +0 -0
  32. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper.egg-info/top_level.txt +0 -0
  33. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/setup.cfg +0 -0
  34. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/tests/test_dataset_weights_integration.py +0 -0
  35. {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/tests/test_key_rename_stats.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robocandywrapper
3
- Version: 0.2.9
3
+ Version: 0.2.11
4
4
  Summary: Sweet wrappers for extending and remixing LeRobot Datasets
5
5
  Author: RoboCandyWrapper Contributors
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "robocandywrapper"
7
- version = "0.2.9"
7
+ version = "0.2.11"
8
8
  description = "Sweet wrappers for extending and remixing LeRobot Datasets"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -17,7 +17,7 @@ from robocandywrapper.constants import (
17
17
  EPISODE_OUTCOME_PLUGIN_NAME,
18
18
  )
19
19
 
20
- __version__ = "0.2.9"
20
+ __version__ = "0.2.11"
21
21
 
22
22
  __all__ = [
23
23
  "DatasetPlugin",
@@ -79,11 +79,25 @@ def aggregate_stats_weighted(
79
79
  if not stats_with_key:
80
80
  continue
81
81
 
82
- # Extract arrays
83
- means = np.stack([np.array(s["mean"]) for s in stats_with_key])
84
- stds = np.stack([np.array(s["std"]) for s in stats_with_key])
85
- mins = np.stack([np.array(s["min"]) for s in stats_with_key])
86
- maxs = np.stack([np.array(s["max"]) for s in stats_with_key])
82
+ # Extract arrays, padding to max dim if shapes differ
83
+ def _to_arrays(stat_key, pad_value=0.0):
84
+ arrs = [np.array(s[stat_key]) for s in stats_with_key]
85
+ if any(a.shape != arrs[0].shape for a in arrs):
86
+ max_dim = max(a.shape[-1] for a in arrs if a.ndim > 0)
87
+ padded = []
88
+ for a in arrs:
89
+ if a.ndim > 0 and a.shape[-1] < max_dim:
90
+ pad_width = [(0, 0)] * (a.ndim - 1) + [(0, max_dim - a.shape[-1])]
91
+ padded.append(np.pad(a, pad_width, constant_values=pad_value))
92
+ else:
93
+ padded.append(a)
94
+ return np.stack(padded)
95
+ return np.stack(arrs)
96
+
97
+ means = _to_arrays("mean", pad_value=0.0)
98
+ stds = _to_arrays("std", pad_value=1.0)
99
+ mins = _to_arrays("min", pad_value=0.0)
100
+ maxs = _to_arrays("max", pad_value=0.0)
87
101
 
88
102
  # Get counts and apply weight multipliers
89
103
  # Extract scalar count value (handle both scalar and array counts)
@@ -642,11 +642,16 @@ class WrappedRobotDataset(torch.utils.data.Dataset):
642
642
 
643
643
  # Fill missing image keys with zeros/noise
644
644
  if self._filled_image_keys:
645
- # Find a reference image shape from an existing image key in this item
645
+ # Find a reference image shape from an existing image key
646
646
  ref_shape = None
647
647
  for k, v in item.items():
648
- if hasattr(v, 'shape') and len(getattr(v, 'shape', ())) >= 3:
649
- ref_shape = v.shape
648
+ if not hasattr(v, 'shape'):
649
+ continue
650
+ s = v.shape
651
+ # Match image tensors: 3+ dims, last dim is 3 (RGB) or 4 (RGBA),
652
+ # and spatial dims are reasonable (> 16 pixels)
653
+ if len(s) >= 3 and s[-1] in (3, 4) and s[-3] > 16 and s[-2] > 16:
654
+ ref_shape = s
650
655
  ref_dtype = v.dtype if hasattr(v, 'dtype') else torch.uint8
651
656
  break
652
657
  for key in self._filled_image_keys:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robocandywrapper
3
- Version: 0.2.9
3
+ Version: 0.2.11
4
4
  Summary: Sweet wrappers for extending and remixing LeRobot Datasets
5
5
  Author: RoboCandyWrapper Contributors
6
6
  License: MIT License
@@ -9,7 +9,7 @@ long_description = readme_file.read_text(encoding="utf-8") if readme_file.exists
9
9
 
10
10
  setup(
11
11
  name="robocandywrapper",
12
- version="0.2.9",
12
+ version="0.2.11",
13
13
  description="Sweet wrappers for extending and remixing LeRobot Datasets",
14
14
  long_description=long_description,
15
15
  long_description_content_type="text/markdown",