Skip to content

Commit 6376bdd

Browse files
committed
chore: cleanup datasets and robots in record_and_playback integration
1 parent 055e46d commit 6376bdd

4 files changed

Lines changed: 235 additions & 184 deletions

File tree

neuracore/api/endpoints.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
"""
77

88
import requests
9-
from neuracore_types import DataSpec, DataType, DeploymentRequest, SynchronizedPoint
9+
from neuracore_types import (
10+
DataSpec,
11+
DataType,
12+
DeploymentRequest,
13+
GPUType,
14+
SynchronizedPoint,
15+
)
1016
from neuracore_types.endpoints.endpoint_requests import DeploymentConfig
11-
from neuracore_types.training.training import GPUType
1217

1318
from neuracore.api.core import _get_robot
1419
from neuracore.core.auth import get_auth

neuracore/core/robot.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,24 @@ def _cleanup_daemon_recording_context(self) -> None:
701701
finally:
702702
self._daemon_recording_context = None
703703

704+
def delete(self) -> None:
705+
"""Delete the robot from the server."""
706+
try:
707+
response = requests.delete(
708+
f"{API_URL}/org/{self.org_id}/robots/{self.id}",
709+
headers=self._auth.get_headers(),
710+
)
711+
response.raise_for_status()
712+
except requests.exceptions.ConnectionError:
713+
raise RobotError(
714+
"Failed to connect to neuracore server, "
715+
"please check your internet connection and try again."
716+
)
717+
except requests.exceptions.RequestException as e:
718+
raise RobotError(f"Failed to delete robot: {str(e)}")
719+
finally:
720+
self.close()
721+
704722
def close(self) -> None:
705723
"""Release local resources owned by this Robot instance."""
706724
self._cleanup_daemon_recording_context()

tests/integration/ml/test_algorithm_performance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
from neuracore_types import (
3434
BatchedJointData,
3535
DataType,
36+
GPUType,
3637
JointData,
3738
RGBCameraData,
3839
SynchronizedPoint,
3940
)
40-
from neuracore_types.training.training import GPUType
4141

4242
import neuracore as nc
4343
from neuracore.core.endpoint import Policy

0 commit comments

Comments
 (0)