SIENTIAPDE-1081
Enhance documentation across multiple modules with detailed parameter descriptions and usage examples
This commit is contained in:
@@ -55,13 +55,13 @@ class Gates(BaseActivity):
|
||||
Filters the data based on the filters. The return value is a tuple with the first element
|
||||
being the policy and the second element being the confidence status.
|
||||
Args:
|
||||
input_data (dict): The input data. Contains:
|
||||
filters (dict): The filters to apply.
|
||||
- input_data (dict): The input data. Contains:
|
||||
- filters (dict): The filters to apply.
|
||||
The key is the filter name and the value is the filter configuration.
|
||||
data (dict[str, Any]): The data to filter.
|
||||
path_priority (list[str]): The path priority.
|
||||
- data (dict[str, Any]): The data to filter.
|
||||
- path_priority (list[str]): The path priority.
|
||||
Returns:
|
||||
tuple[str | None, int, str]: (policy, confidence) based in priority
|
||||
tuple[str | None, int, str]: (policy, confidence, comments) based in priority
|
||||
list and filter configuration and functions.
|
||||
"""
|
||||
|
||||
@@ -111,13 +111,13 @@ class Gates(BaseActivity):
|
||||
The return value is a tuple with the first element
|
||||
being the policy and the second element being the confidence status.
|
||||
Args:
|
||||
input_data (dict): The input data. Contains:
|
||||
filters (dict): The filter configuration to apply.
|
||||
data (dict[str, Any]): The data to filter.
|
||||
path_priority (list[str]): The path priority list.
|
||||
type (str): The type of the gate.
|
||||
- input_data (dict): The input data. Contains:
|
||||
- filters (dict): The filter configuration to apply.
|
||||
- data (dict[str, Any]): The data to filter.
|
||||
- path_priority (list[str]): The path priority list.
|
||||
- type (str): The type of the gate.
|
||||
Returns:
|
||||
tuple[str | None, int, str]: (policy, confidence) based in priority list
|
||||
tuple[str | None, int, str]: (policy, confidence, comments) based in priority list
|
||||
and filter configuration and functions.
|
||||
"""
|
||||
|
||||
@@ -174,13 +174,13 @@ class Gates(BaseActivity):
|
||||
The return value is a tuple with the first element
|
||||
being the policy and the second element being the confidence status.
|
||||
Args:
|
||||
input_data (dict): The input data. Contains:
|
||||
filters (dict): The filter configuration to apply.
|
||||
data (dict[str, Any]): The data to filter.
|
||||
path_priority (list[str]): The path priority list.
|
||||
type (str): The type of the gate.
|
||||
- input_data (dict): The input data. Contains:
|
||||
- filters (dict): The filter configuration to apply.
|
||||
- data (dict[str, Any]): The data to filter.
|
||||
- path_priority (list[str]): The path priority list.
|
||||
- type (str): The type of the gate.
|
||||
Returns:
|
||||
tuple[str | None, int, str]: (policy, confidence) based in priority
|
||||
tuple[str | None, int, str]: (policy, confidence, comments) based in priority
|
||||
list and filter configuration and functions.
|
||||
"""
|
||||
|
||||
@@ -233,11 +233,11 @@ class Gates(BaseActivity):
|
||||
"""
|
||||
Formats the prediction data.
|
||||
Args:
|
||||
input_data (dict): The input data. Contains:
|
||||
data (dict[str, Any]): The data to format.
|
||||
timestamp (str): The timestamp of the data.
|
||||
model_id (str): The id of the model.
|
||||
prediction_confidence (float): The confidence of the prediction.
|
||||
- input_data (dict): The input data. Contains:
|
||||
- data (dict[str, Any]): The data to format.
|
||||
- timestamp (str): The timestamp of the data.
|
||||
- model_id (str): The id of the model.
|
||||
- prediction_confidence (float): The confidence of the prediction.
|
||||
Returns:
|
||||
dict: The formatted data.
|
||||
"""
|
||||
@@ -260,11 +260,11 @@ class Gates(BaseActivity):
|
||||
and usefull information in the other fields.
|
||||
|
||||
Args:
|
||||
input_data (dict): The input data. Contains:
|
||||
timestamp (str): The timestamp of the data.
|
||||
model_id (str): The id of the model.
|
||||
prediction_confidence (float): The confidence of the prediction.
|
||||
comment (str): The comment of the prediction.
|
||||
- input_data (dict): The input data. Contains:
|
||||
- timestamp (str): The timestamp of the data.
|
||||
- model_id (str): The id of the model.
|
||||
- prediction_confidence (float): The confidence of the prediction.
|
||||
- comment (str): The comment of the prediction.
|
||||
Returns:
|
||||
dict: The formatted data.
|
||||
"""
|
||||
@@ -286,8 +286,8 @@ class Gates(BaseActivity):
|
||||
"""
|
||||
Gets the last timestamp of the data.
|
||||
Args:
|
||||
input_data (dict): The input data. Contains:
|
||||
data (dict[str, Any]): The data to get the last timestamp from.
|
||||
- input_data (dict): The input data. Contains:
|
||||
- data (dict[str, Any]): The data to get the last timestamp from.
|
||||
Returns:
|
||||
str: The last timestamp of the data.
|
||||
"""
|
||||
|
||||
@@ -29,10 +29,10 @@ class MLFlow(BaseActivity):
|
||||
"""
|
||||
Access MLFlow model to get the transformed data.
|
||||
Args:
|
||||
input_data (dict): The input data. Contains:
|
||||
data (dict[str, Any]): The data to transform.
|
||||
model_name (str): The name of the model.
|
||||
model_retention (int): The retention of the model in minutes.
|
||||
- input_data (dict): The input data. Contains:
|
||||
- data (dict[str, Any]): The data to transform.
|
||||
- model_name (str): The name of the model.
|
||||
- model_retention (int): The retention time of the model, in minutes.
|
||||
Returns:
|
||||
dict[str, Any]: The transformed data.
|
||||
"""
|
||||
@@ -67,10 +67,10 @@ class MLFlow(BaseActivity):
|
||||
"""
|
||||
Access MLFlow model to get the predicted data.
|
||||
Args:
|
||||
input_data (dict): The input data. Contains:
|
||||
data (dict[str, Any]): The data to predict.
|
||||
model_name (str): The name of the model.
|
||||
model_retention (int): The retention of the model.
|
||||
- input_data (dict): The input data. Contains:
|
||||
- data (dict[str, Any]): The data to predict.
|
||||
- model_name (str): The name of the model.
|
||||
- model_retention (int): The retention time of the model, in minutes.
|
||||
Returns:
|
||||
dict[str, Any]: The predicted data.
|
||||
"""
|
||||
|
||||
@@ -39,6 +39,17 @@ class OPC(BaseActivity):
|
||||
|
||||
def write_data(self, server: str, tag: str, data: Any,
|
||||
data_type: str, tag_type: str):
|
||||
"""
|
||||
Write data to OPC server.
|
||||
|
||||
Args:
|
||||
- server (str): The name of the OPC server.
|
||||
- tag (str): The tag to write to.
|
||||
- data (Any): The data to write.
|
||||
- data_type (str): The data type.
|
||||
- tag_type (str): The tag type.
|
||||
"""
|
||||
|
||||
try:
|
||||
self.opc_repository[server].write_data(
|
||||
tag, data, data_type)
|
||||
@@ -61,15 +72,14 @@ class OPC(BaseActivity):
|
||||
operations are optional and independent of each other.
|
||||
|
||||
Args:
|
||||
input_data (dict[str, Any]): The input data. Contains the following keys:
|
||||
- data (dict[str, Any]): The dataframe that contains the data to write
|
||||
- input_data(dict[str, Any]): The input data. Contains the following keys:
|
||||
- data(dict[str, Any]): The dataframe that contains the data to write
|
||||
to the OPC servers.
|
||||
- opc_output_config (dict[str, Any]): The OPC writing configuration.
|
||||
- opc_output_config(dict[str, Any]): The OPC writing configuration.
|
||||
The keys are the OPC server names and the values contain:
|
||||
prediction_tags (dict[str, Any]): The tags to write to the OPC servers.
|
||||
confidence_tags (dict[str, Any]): The tags to write to the OPC servers.
|
||||
- prediction_tags(dict[str, Any]): The tags to write to the OPC servers.
|
||||
- confidence_tags(dict[str, Any]): The tags to write to the OPC servers.
|
||||
|
||||
Returns:
|
||||
"""
|
||||
self.logger.debug("Writing data to OPC servers...")
|
||||
data = DataFrame(input_data['data'])
|
||||
|
||||
Reference in New Issue
Block a user