Skip to content

constants

Globally accessible constants

cannot_connect_as_client_is_already_connected_error(new_client_sid, current_client_sid)

Generate an error message for when the client is already connected. Args: new_client_sid: The SID of the new client. current_client_sid: The SID of the current client. Returns: str: The error message.

Source code in src/ephys_link/utils/constants.py
def cannot_connect_as_client_is_already_connected_error(new_client_sid: str, current_client_sid: str) -> str:
    """Generate an error message for when the client is already connected.
    Args:
        new_client_sid: The SID of the new client.
        current_client_sid: The SID of the current client.
    Returns:
        str: The error message.
    """
    return f"Cannot connect {new_client_sid} as {current_client_sid} is already connected."

client_disconnected_without_being_connected_error(client_sid)

Generate an error message for when the client is disconnected without being connected. Args: client_sid: The SID of the client. Returns: str: The error message.

Source code in src/ephys_link/utils/constants.py
def client_disconnected_without_being_connected_error(client_sid: str) -> str:
    """Generate an error message for when the client is disconnected without being connected.
    Args:
        client_sid: The SID of the client.
    Returns:
        str: The error message.
    """
    return f"Client {client_sid} disconnected without being connected."

did_not_reach_target_depth_error(request, final_unified_depth)

Generate an error message for when the manipulator did not reach the target position. Args: request: The object containing the requested depth. final_unified_depth: The final depth of the manipulator. Returns: str: The error message.

Source code in src/ephys_link/utils/constants.py
def did_not_reach_target_depth_error(request: SetDepthRequest, final_unified_depth: float) -> str:
    """Generate an error message for when the manipulator did not reach the target position.
    Args:
        request: The object containing the requested depth.
        final_unified_depth: The final depth of the manipulator.
    Returns:
        str: The error message.
    """
    return f"Manipulator {request.manipulator_id} did not reach target depth. Requested: {request.depth}, got: {final_unified_depth}"

did_not_reach_target_position_error(request, axis_index, final_unified_position)

Generate an error message for when the manipulator did not reach the target position. Args: request: The object containing the requested position. axis_index: The index of the axis that did not reach the target position. final_unified_position: The final position of the manipulator. Returns: str: The error message.

Source code in src/ephys_link/utils/constants.py
def did_not_reach_target_position_error(
    request: SetPositionRequest, axis_index: int, final_unified_position: Vector4
) -> str:
    """Generate an error message for when the manipulator did not reach the target position.
    Args:
        request: The object containing the requested position.
        axis_index: The index of the axis that did not reach the target position.
        final_unified_position: The final position of the manipulator.
    Returns:
        str: The error message.
    """
    return f"Manipulator {request.manipulator_id} did not reach target position on axis {list(Vector4.model_fields.keys())[axis_index]}. Requested: {request.position}, got: {final_unified_position}"