diff --git a/README.md b/README.md index 9133bfe..292d656 100644 --- a/README.md +++ b/README.md @@ -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 ./output diff --git a/src/trossen_cloud_cli/cli.py b/src/trossen_cloud_cli/cli.py index f27ed62..8b93732 100644 --- a/src/trossen_cloud_cli/cli.py +++ b/src/trossen_cloud_cli/cli.py @@ -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 ./output trc dataset list --mine diff --git a/src/trossen_cloud_cli/commands/datasets.py b/src/trossen_cloud_cli/commands/datasets.py index 45e794a..462a9ce 100644 --- a/src/trossen_cloud_cli/commands/datasets.py +++ b/src/trossen_cloud_cli/commands/datasets.py @@ -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"), diff --git a/src/trossen_cloud_cli/types.py b/src/trossen_cloud_cli/types.py index c90bb46..97b7ccc 100644 --- a/src/trossen_cloud_cli/types.py +++ b/src/trossen_cloud_cli/types.py @@ -10,8 +10,8 @@ class DatasetType(StrEnum): Supported dataset types. """ - MCAP = "mcap" - LEROBOT = "lerobot" + TROSSENMCAP = "trossenmcap" + LEROBOT_V3 = "lerobot_v3" class PrivacyLevel(StrEnum): diff --git a/src/trossen_cloud_cli/upload.py b/src/trossen_cloud_cli/upload.py index 6af8823..d4f06b9 100644 --- a/src/trossen_cloud_cli/upload.py +++ b/src/trossen_cloud_cli/upload.py @@ -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. diff --git a/src/trossen_cloud_cli/validators/__init__.py b/src/trossen_cloud_cli/validators/__init__.py index 7c298e3..5a9aa8c 100644 --- a/src/trossen_cloud_cli/validators/__init__.py +++ b/src/trossen_cloud_cli/validators/__init__.py @@ -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) diff --git a/tests/test_api_endpoints.py b/tests/test_api_endpoints.py index 6c5eb6b..411c5d0 100644 --- a/tests/test_api_endpoints.py +++ b/tests/test_api_endpoints.py @@ -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"]) @@ -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", } @@ -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", } @@ -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"}, } @@ -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: @@ -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) @@ -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: @@ -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, @@ -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 diff --git a/tests/test_types.py b/tests/test_types.py index fa85640..173cb62 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -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(): @@ -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" diff --git a/tests/test_validators.py b/tests/test_validators.py index 2f22a3b..7d16ed2 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -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 == [] @@ -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() @@ -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