Skip to content

Commit

Permalink
Do renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
kjy5 committed Jul 5, 2024
1 parent 152492a commit 48762f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
24 changes: 4 additions & 20 deletions src/vbl_aquarium/models/ephys_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/vbl_aquarium/utils/vbl_base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 48762f8

Please sign in to comment.