Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The token is stored securely in your OS keyring.

```bash
# Upload a local dataset
trc dataset upload ./my-data --name my-dataset --type lerobot
trc dataset upload ./my-data --name my-dataset --type lerobot_v3

# Download a dataset
trc dataset download <dataset-id> ./output
Expand Down
2 changes: 1 addition & 1 deletion src/trossen_cloud_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def main_callback(

[bold]Datasets:[/bold]

trc dataset upload ./my-data --name my-dataset --type lerobot
trc dataset upload ./my-data --name my-dataset --type lerobot_v3
trc dataset import-hf org/dataset-name --name my-dataset
trc dataset download <dataset-id> ./output
trc dataset list --mine
Expand Down
2 changes: 1 addition & 1 deletion src/trossen_cloud_cli/commands/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def import_hf(
dataset_type: Annotated[
DatasetType,
typer.Option("--type", "-t", help="Dataset type"),
] = DatasetType.LEROBOT,
] = DatasetType.LEROBOT_V3,
privacy: Annotated[
PrivacyLevel,
typer.Option("--privacy", "-p", help="Privacy level"),
Expand Down
4 changes: 2 additions & 2 deletions src/trossen_cloud_cli/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class DatasetType(StrEnum):
Supported dataset types.
"""

MCAP = "mcap"
LEROBOT = "lerobot"
TROSSENMCAP = "trossenmcap"
LEROBOT_V3 = "lerobot_v3"


Comment on lines 15 to 16
class PrivacyLevel(StrEnum):
Expand Down
2 changes: 1 addition & 1 deletion src/trossen_cloud_cli/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ async def create_and_upload_dataset(

:param name: The name for the new dataset.
:param local_path: Path to the file or directory to upload.
:param dataset_type: The type of dataset (e.g., 'lerobot').
:param dataset_type: The type of dataset (e.g., 'lerobot_v3').
:param privacy: Privacy setting ('public' or 'private').
:param metadata: Optional additional metadata for the dataset.
:param show_progress: Whether to display upload progress. Defaults to True.
Expand Down
6 changes: 3 additions & 3 deletions src/trossen_cloud_cli/validators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def validate_dataset(path: Path, dataset_type: DatasetType) -> list[str]:
Validate a dataset directory against its type-specific spec.

Returns a list of warning messages. An empty list means no issues found.
Only runs for dataset types that have a validator (mcap, lerobot).
Only runs for dataset types that have a validator (trossenmcap, lerobot_v3).
"""
validators = {
DatasetType.MCAP: validate_mcap,
DatasetType.LEROBOT: validate_lerobot,
DatasetType.TROSSENMCAP: validate_mcap,
DatasetType.LEROBOT_V3: validate_lerobot,
}

validator = validators.get(dataset_type)
Expand Down
18 changes: 9 additions & 9 deletions tests/test_api_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_list_calls_datasets_endpoint(self):
"""
GET /datasets/ with limit param.
"""
datasets = [{"id": "abc-123", "name": "test-ds", "type": "mcap", "privacy": "private"}]
datasets = [{"id": "abc-123", "name": "test-ds", "type": "trossenmcap", "privacy": "private"}]
get_patch, get_mock = mock_client_get(datasets)
with mock_auth(), get_patch:
result = runner.invoke(app, ["dataset", "list"])
Expand Down Expand Up @@ -104,7 +104,7 @@ def test_info_calls_get_with_uuid(self):
dataset = {
"id": "abc-123",
"name": "test-ds",
"type": "mcap",
"type": "trossenmcap",
"privacy": "private",
"user_id": "user-1",
}
Expand All @@ -122,7 +122,7 @@ def test_info_displays_user_id_not_owner_id(self):
dataset = {
"id": "abc-123",
"name": "test-ds",
"type": "mcap",
"type": "trossenmcap",
"privacy": "private",
"user_id": "user-456",
}
Expand All @@ -138,7 +138,7 @@ def test_info_displays_dataset_metadata(self):
dataset = {
"id": "abc-123",
"name": "test-ds",
"type": "mcap",
"type": "trossenmcap",
"privacy": "private",
"dataset_metadata": {"key": "value"},
}
Expand All @@ -156,7 +156,7 @@ def test_delete_calls_correct_endpoint(self):
"""
DELETE /datasets/{uuid}.
"""
dataset = {"id": "abc-123", "name": "test-ds", "type": "mcap", "privacy": "private"}
dataset = {"id": "abc-123", "name": "test-ds", "type": "trossenmcap", "privacy": "private"}
get_patch, _ = mock_client_get(dataset)
del_patch, del_mock = mock_client_delete()
with mock_auth(), get_patch, del_patch:
Expand All @@ -176,7 +176,7 @@ def test_update_calls_patch_endpoint(self):
dataset = {
"id": "abc-123",
"name": "new-name",
"type": "mcap",
"type": "trossenmcap",
"privacy": "public",
}
get_patch, _ = mock_client_get(dataset)
Expand All @@ -194,7 +194,7 @@ def test_update_with_metadata(self):
"""
PATCH /datasets/{uuid} sends dataset_metadata.
"""
dataset = {"id": "abc-123", "name": "ds", "type": "mcap", "privacy": "private"}
dataset = {"id": "abc-123", "name": "ds", "type": "trossenmcap", "privacy": "private"}
get_patch, _ = mock_client_get(dataset)
patch_ctx, patch_mock = mock_client_patch(dataset)
with mock_auth(), get_patch, patch_ctx:
Expand Down Expand Up @@ -487,7 +487,7 @@ async def test_create_dataset_sends_correct_payload(self):
result = await create_and_upload_dataset(
name="test-ds",
local_path=Path("/tmp/test"),
dataset_type="mcap",
dataset_type="trossenmcap",
privacy="private",
metadata={"env": "lab"},
show_progress=False,
Expand All @@ -498,7 +498,7 @@ async def test_create_dataset_sends_correct_payload(self):
assert create_call[0][0] == "/datasets"
payload = create_call[1]["json"]
assert payload["name"] == "test-ds"
assert payload["type"] == "mcap"
assert payload["type"] == "trossenmcap"
assert payload["privacy"] == "private"
assert payload["dataset_metadata"] == {"env": "lab"}
assert len(payload["files"]) == 1
Expand Down
8 changes: 4 additions & 4 deletions tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def test_dataset_type_values():
"""
Test DatasetType enum values.
"""
assert DatasetType.MCAP == "mcap"
assert DatasetType.LEROBOT == "lerobot"
assert DatasetType.TROSSENMCAP == "trossenmcap"
assert DatasetType.LEROBOT_V3 == "lerobot_v3"


def test_privacy_level_values():
Expand Down Expand Up @@ -102,14 +102,14 @@ def test_dataset_info():
info = DatasetInfo(
id="dataset-123",
name="Test Dataset",
type=DatasetType.LEROBOT,
type=DatasetType.LEROBOT_V3,
privacy=PrivacyLevel.PRIVATE,
user_id="user-456",
created_at="2024-01-01T00:00:00Z",
)
assert info.id == "dataset-123"
assert info.name == "Test Dataset"
assert info.type == DatasetType.LEROBOT
assert info.type == DatasetType.LEROBOT_V3
assert info.privacy == PrivacyLevel.PRIVATE
assert info.user_id == "user-456"

Expand Down
8 changes: 4 additions & 4 deletions tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ def _make_valid_mcap_dataset(tmp_path: Path, num_episodes: int = 3) -> Path:
class TestValidateDataset:
def test_dispatches_to_lerobot(self, tmp_path):
ds = _make_valid_lerobot(tmp_path)
warnings = validate_dataset(ds, DatasetType.LEROBOT)
warnings = validate_dataset(ds, DatasetType.LEROBOT_V3)
assert warnings == []

def test_dispatches_to_mcap(self, tmp_path):
ds = _make_valid_mcap_dataset(tmp_path)
warnings = validate_dataset(ds, DatasetType.MCAP)
warnings = validate_dataset(ds, DatasetType.TROSSENMCAP)
assert warnings == []


Expand Down Expand Up @@ -590,7 +590,7 @@ def test_upload_force_skips_confirmation(self, tmp_path):
):
result = runner.invoke(
app,
["dataset", "upload", str(ds), "--name", "test", "--type", "mcap", "--force"],
["dataset", "upload", str(ds), "--name", "test", "--type", "trossenmcap", "--force"],
)
assert result.exit_code == 0
upload_mock.assert_called_once()
Expand All @@ -610,7 +610,7 @@ def test_upload_no_force_prompts_and_aborts(self, tmp_path):
):
result = runner.invoke(
app,
["dataset", "upload", str(ds), "--name", "test", "--type", "mcap"],
["dataset", "upload", str(ds), "--name", "test", "--type", "trossenmcap"],
input="n\n",
)
assert result.exit_code == 0
Expand Down