Skip to content

Commit

Permalink
Merge pull request #53 from vaughantnrc/dev-tv-connector-maintenance-…
Browse files Browse the repository at this point in the history
…24-06-26

MNT: Migrate connectivity logic from UI to Connector class
  • Loading branch information
vaughantnrc authored Jul 3, 2024
2 parents 1493c5a + 8ab87ca commit 492a63e
Show file tree
Hide file tree
Showing 101 changed files with 2,151 additions and 1,919 deletions.
4 changes: 2 additions & 2 deletions src/calibrator/api/add_calibration_image_request.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from src.common import MCastRequest
from src.common import MCTRequest
from src.common.structures import CaptureFormat
from pydantic import Field


class AddCalibrationImageRequest(MCastRequest):
class AddCalibrationImageRequest(MCTRequest):
"""
Calibrator will infer resolution from the image itself, and associate its own label to the data.
"""
Expand Down
4 changes: 2 additions & 2 deletions src/calibrator/api/add_calibration_image_response.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from src.common import MCastResponse
from src.common import MCTResponse
from pydantic import Field


class AddCalibrationImageResponse(MCastResponse):
class AddCalibrationImageResponse(MCTResponse):
@staticmethod
def parsable_type_identifier() -> str:
return "add_calibration_image"
Expand Down
4 changes: 2 additions & 2 deletions src/calibrator/api/calibrate_request.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from src.common import MCastRequest
from src.common import MCTRequest
from src.common.structures import ImageResolution
from pydantic import Field


class CalibrateRequest(MCastRequest):
class CalibrateRequest(MCTRequest):
@staticmethod
def parsable_type_identifier() -> str:
return "calibrate"
Expand Down
4 changes: 2 additions & 2 deletions src/calibrator/api/calibrate_response.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from src.common import MCastResponse
from src.common import MCTResponse
from src.common.structures import IntrinsicCalibration
from pydantic import Field


class CalibrateResponse(MCastResponse):
class CalibrateResponse(MCTResponse):
@staticmethod
def parsable_type_identifier() -> str:
return "calibrate"
Expand Down
4 changes: 2 additions & 2 deletions src/calibrator/api/delete_staged_request.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from src.common import MCastRequest
from src.common import MCTRequest
from pydantic import Field


class DeleteStagedRequest(MCastRequest):
class DeleteStagedRequest(MCTRequest):
@staticmethod
def parsable_type_identifier() -> str:
return "clear_calibration_data_staged_for_deletion"
Expand Down
4 changes: 2 additions & 2 deletions src/calibrator/api/get_calibration_image_request.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from src.common import MCastRequest
from src.common import MCTRequest
from pydantic import Field


class GetCalibrationImageRequest(MCastRequest):
class GetCalibrationImageRequest(MCTRequest):
@staticmethod
def parsable_type_identifier() -> str:
return "get_calibration_image"
Expand Down
4 changes: 2 additions & 2 deletions src/calibrator/api/get_calibration_image_response.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from src.common import MCastResponse
from src.common import MCTResponse
from pydantic import Field


class GetCalibrationImageResponse(MCastResponse):
class GetCalibrationImageResponse(MCTResponse):
@staticmethod
def parsable_type_identifier() -> str:
return "get_calibration_image"
Expand Down
4 changes: 2 additions & 2 deletions src/calibrator/api/get_calibration_result_request.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from src.common import MCastRequest
from src.common import MCTRequest
from pydantic import Field


class GetCalibrationResultRequest(MCastRequest):
class GetCalibrationResultRequest(MCTRequest):
@staticmethod
def parsable_type_identifier() -> str:
return "get_calibration_result"
Expand Down
4 changes: 2 additions & 2 deletions src/calibrator/api/get_calibration_result_response.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from src.common import MCastResponse
from src.common import MCTResponse
from src.common.structures import IntrinsicCalibration
from pydantic import Field


class GetCalibrationResultResponse(MCastResponse):
class GetCalibrationResultResponse(MCTResponse):
@staticmethod
def parsable_type_identifier() -> str:
return "get_calibration_result"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from src.common import MCastRequest
from src.common import MCTRequest
from pydantic import Field


class ListCalibrationDetectorResolutionsRequest(MCastRequest):
class ListCalibrationDetectorResolutionsRequest(MCTRequest):
@staticmethod
def parsable_type_identifier() -> str:
return "list_calibration_detector_resolutions"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from src.common import MCastResponse
from src.common import MCTResponse
from src.common.structures import DetectorResolution
from pydantic import Field


class ListCalibrationDetectorResolutionsResponse(MCastResponse):
class ListCalibrationDetectorResolutionsResponse(MCTResponse):
@staticmethod
def parsable_type_identifier() -> str:
return "list_calibration_detector_resolutions"
Expand Down
4 changes: 2 additions & 2 deletions src/calibrator/api/list_calibration_image_metadata_request.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from src.common import MCastRequest
from src.common import MCTRequest
from src.common.structures import ImageResolution
from pydantic import Field


class ListCalibrationImageMetadataRequest(MCastRequest):
class ListCalibrationImageMetadataRequest(MCTRequest):
@staticmethod
def parsable_type_identifier() -> str:
return "get_calibration_metadata_identifier_list"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from ..structures import CalibrationImageMetadata
from src.common import MCastResponse
from src.common import MCTResponse
from pydantic import Field


class ListCalibrationImageMetadataResponse(MCastResponse):
class ListCalibrationImageMetadataResponse(MCTResponse):
@staticmethod
def parsable_type_identifier() -> str:
return "get_calibration_metadata_identifier_list"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from src.common import MCastRequest
from src.common import MCTRequest
from src.common.structures import ImageResolution
from pydantic import Field


class ListCalibrationResultMetadataRequest(MCastRequest):
class ListCalibrationResultMetadataRequest(MCTRequest):
@staticmethod
def parsable_type_identifier() -> str:
return "get_calibration_result_metadata_list"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from ..structures import CalibrationResultMetadata
from src.common import MCastResponse
from src.common import MCTResponse
from pydantic import Field


class ListCalibrationResultMetadataResponse(MCastResponse):
class ListCalibrationResultMetadataResponse(MCTResponse):
@staticmethod
def parsable_type_identifier() -> str:
return "get_calibration_result_metadata_list"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from ..structures import CalibrationImageState
from src.common import MCastRequest
from src.common import MCTRequest
from pydantic import Field


class UpdateCalibrationImageMetadataRequest(MCastRequest):
class UpdateCalibrationImageMetadataRequest(MCTRequest):
@staticmethod
def parsable_type_identifier() -> str:
return "update_calibration_image_metadata"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from ..structures import CalibrationResultState
from src.common import MCastRequest
from src.common import MCTRequest
from pydantic import Field


class UpdateCalibrationResultMetadataRequest(MCastRequest):
class UpdateCalibrationResultMetadataRequest(MCTRequest):
@staticmethod
def parsable_type_identifier() -> str:
return "update_calibration_result_metadata"
Expand Down
10 changes: 5 additions & 5 deletions src/calibrator/calibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
ErrorResponse, \
get_kwarg, \
ImageCoding, \
MCastComponent, \
MCastRequest, \
MCastResponse
MCTComponent, \
MCTRequest, \
MCTResponse
from src.common.structures import \
DetectorResolution, \
ImageResolution, \
Expand Down Expand Up @@ -86,8 +86,8 @@ def __init__(
self.add_status_message(severity="critical", message=message)
raise RuntimeError(message)

def supported_request_types(self) -> dict[type[MCastRequest], Callable[[dict], MCastResponse]]:
return_value: dict[type[MCastRequest], Callable[[dict], MCastResponse]] = super().supported_request_types()
def supported_request_types(self) -> dict[type[MCTRequest], Callable[[dict], MCTResponse]]:
return_value: dict[type[MCTRequest], Callable[[dict], MCTResponse]] = super().supported_request_types()
return return_value

def add_calibration_image(self, **kwargs) -> AddCalibrationImageResponse | ErrorResponse:
Expand Down
12 changes: 6 additions & 6 deletions src/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
DequeueStatusMessagesResponse, \
EmptyResponse, \
ErrorResponse, \
MCastRequest, \
MCastRequestSeries, \
MCastResponse, \
MCastResponseSeries
MCTParsable, \
MCTRequest, \
MCTRequestSeries, \
MCTResponse, \
MCTResponseSeries
from .client_identifier_from_connection import client_identifier_from_connection
from .get_kwarg import get_kwarg
from .image_coding import ImageCoding
from .image_utils import ImageUtils
from .mcast_component import MCastComponent
from .mcast_websocket_send_recv import mcast_websocket_send_recv
from .mct_component import MCTComponent
from .standard_resolutions import StandardResolutions
from .status_message_source import StatusMessageSource
10 changes: 5 additions & 5 deletions src/common/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from .dequeue_status_messages_response import DequeueStatusMessagesResponse
from .empty_response import EmptyResponse
from .error_response import ErrorResponse
from .mcast_parsable import MCastParsable
from .mcast_request import MCastRequest
from .mcast_request_series import MCastRequestSeries
from .mcast_response import MCastResponse
from .mcast_response_series import MCastResponseSeries
from .mct_parsable import MCTParsable
from .mct_request import MCTRequest
from .mct_request_series import MCTRequestSeries
from .mct_response import MCTResponse
from .mct_response_series import MCTResponseSeries
4 changes: 2 additions & 2 deletions src/common/api/dequeue_status_messages_request.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from .mcast_request import MCastRequest
from .mct_request import MCTRequest
from pydantic import Field


class DequeueStatusMessagesRequest(MCastRequest):
class DequeueStatusMessagesRequest(MCTRequest):
@staticmethod
def parsable_type_identifier() -> str:
return "dequeue_status_messages"
Expand Down
4 changes: 2 additions & 2 deletions src/common/api/dequeue_status_messages_response.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from .mcast_response import MCastResponse
from .mct_response import MCTResponse
from src.common.structures.status_message import StatusMessage
from pydantic import Field


class DequeueStatusMessagesResponse(MCastResponse):
class DequeueStatusMessagesResponse(MCTResponse):

@staticmethod
def parsable_type_identifier() -> str:
Expand Down
4 changes: 2 additions & 2 deletions src/common/api/empty_response.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from .mcast_response import MCastResponse
from .mct_response import MCTResponse
from pydantic import Field


class EmptyResponse(MCastResponse):
class EmptyResponse(MCTResponse):
@staticmethod
def parsable_type_identifier() -> str:
return "empty"
Expand Down
4 changes: 2 additions & 2 deletions src/common/api/error_response.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from .mcast_response import MCastResponse
from .mct_response import MCTResponse
from pydantic import Field


class ErrorResponse(MCastResponse):
class ErrorResponse(MCTResponse):
@staticmethod
def parsable_type_identifier() -> str:
return "error"
Expand Down
9 changes: 0 additions & 9 deletions src/common/api/mcast_parsable.py

This file was deleted.

7 changes: 0 additions & 7 deletions src/common/api/mcast_request.py

This file was deleted.

6 changes: 0 additions & 6 deletions src/common/api/mcast_request_series.py

This file was deleted.

7 changes: 0 additions & 7 deletions src/common/api/mcast_response.py

This file was deleted.

7 changes: 0 additions & 7 deletions src/common/api/mcast_response_series.py

This file was deleted.

Loading

0 comments on commit 492a63e

Please sign in to comment.