From 48762f8dd81aabb28ed03e00cd36933f4829dcb4 Mon Sep 17 00:00:00 2001 From: Kenneth Yang Date: Fri, 5 Jul 2024 13:16:00 -0700 Subject: [PATCH] Do renaming --- src/vbl_aquarium/models/ephys_link.py | 24 ++++-------------------- src/vbl_aquarium/utils/vbl_base_model.py | 2 +- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/vbl_aquarium/models/ephys_link.py b/src/vbl_aquarium/models/ephys_link.py index 905ba76..c48b634 100644 --- a/src/vbl_aquarium/models/ephys_link.py +++ b/src/vbl_aquarium/models/ephys_link.py @@ -37,7 +37,7 @@ class EphysLinkOptions(VBLBaseModel): serial: str = "no-e-stop" -class GotoPositionRequest(VBLBaseModel): +class SetPositionRequest(VBLBaseModel): """Request format for moving a manipulator to a position. :param manipulator_id: ID of the manipulator to move. @@ -53,7 +53,7 @@ class GotoPositionRequest(VBLBaseModel): speed: float = Field(gt=0) -class InsideBrainRequest(VBLBaseModel): +class SetInsideBrainRequest(VBLBaseModel): """Request format for setting inside brain state. :param manipulator_id: ID of the manipulator to move. @@ -66,7 +66,7 @@ class InsideBrainRequest(VBLBaseModel): inside: bool -class DriveToDepthRequest(VBLBaseModel): +class SetDepthRequest(VBLBaseModel): """Request format for driving a manipulator to depth. :param manipulator_id: ID of the manipulator to move. @@ -82,22 +82,6 @@ class DriveToDepthRequest(VBLBaseModel): speed: float = Field(gt=0) -class CanWriteRequest(VBLBaseModel): - """Request format for setting can write state. - - :param manipulator_id: ID of the manipulator to move. - :type manipulator_id: str - :param can_write: Whether the manipulator can write. - :type can_write: bool - :param hours: Number of hours the manipulator can write for (0 = indefinitely). - :type hours: float - """ - - manipulator_id: str = Field(min_length=1) - can_write: bool - hours: float = Field(ge=0) - - class GetManipulatorsResponse(VBLBaseModel): """Response format for requesting available manipulators. @@ -152,7 +136,7 @@ class ShankCountResponse(VBLBaseModel): error: str = "" -class DriveToDepthResponse(VBLBaseModel): +class SetDepthResponse(VBLBaseModel): """Response format for driving a manipulator to depth. :param depth: Depth the manipulator is at in mm. diff --git a/src/vbl_aquarium/utils/vbl_base_model.py b/src/vbl_aquarium/utils/vbl_base_model.py index 5842386..14486cf 100644 --- a/src/vbl_aquarium/utils/vbl_base_model.py +++ b/src/vbl_aquarium/utils/vbl_base_model.py @@ -10,5 +10,5 @@ class VBLBaseModel(BaseModel): model_config = ConfigDict(alias_generator=to_pascal, populate_by_name=True) - def to_string(self) -> str: + def to_json_string(self) -> str: return self.model_dump_json(by_alias=True)