SIENTIAPDE-1314
Refactor OPC Class and Enhance Testing for Output Management - Removed the unused 'success' parameter from the manage_output_tags method in the OPC class to streamline its signature. - Commented out the error handling logic in the OpcRepository for clarity and future reference. - Added new tests for manage_output_tags to validate successful and failed write operations, ensuring accurate assertions for output data and metrics.
This commit is contained in:
@@ -199,7 +199,6 @@ class OPC(BaseActivity):
|
||||
config: dict[str, Any],
|
||||
data: DataFrame,
|
||||
metadata: dict[str, Any],
|
||||
success: bool,
|
||||
) -> tuple[bool, dict[str, float | None]]:
|
||||
"""
|
||||
Manage the writing of prediction and confidence data to OPC server tags.
|
||||
@@ -305,7 +304,7 @@ class OPC(BaseActivity):
|
||||
continue
|
||||
|
||||
local_success, local_response_times = await self.manage_output_tags(
|
||||
server_id, config, data, metadata, success
|
||||
server_id, config, data, metadata
|
||||
)
|
||||
metrics[server_id] = local_response_times
|
||||
local_count = len(local_response_times)
|
||||
|
||||
@@ -263,7 +263,7 @@ class OpcRepository(BaseActivity):
|
||||
if self.client is None:
|
||||
return await self.connect()
|
||||
|
||||
# if self.error_count > 5:
|
||||
# if self.error_count > 5: # NOSONAR
|
||||
# self.logger.custom_warning(
|
||||
# f'OPC server {self.id} will be disconnected due to multiple errors', self.metadata
|
||||
# )
|
||||
|
||||
Reference in New Issue
Block a user