From 92ade35e0436cb3e18981ab754b966ebd4664034 Mon Sep 17 00:00:00 2001 From: Mauro Cortellazzi Date: Fri, 19 Jul 2024 14:28:44 +0200 Subject: [PATCH] fix(sdk): fix documentation typos (#125) --- sdk/radicalbit_platform_sdk/apis/model.py | 12 ++++++------ .../apis/model_current_dataset.py | 16 ++++++++++++---- .../apis/model_reference_dataset.py | 12 +++++++++--- .../models/dataset_drift.py | 1 + sdk/radicalbit_platform_sdk/models/job_status.py | 2 ++ .../models/model_definition.py | 8 ++++---- 6 files changed, 34 insertions(+), 17 deletions(-) diff --git a/sdk/radicalbit_platform_sdk/apis/model.py b/sdk/radicalbit_platform_sdk/apis/model.py index 901f7de0..49c9f250 100644 --- a/sdk/radicalbit_platform_sdk/apis/model.py +++ b/sdk/radicalbit_platform_sdk/apis/model.py @@ -149,7 +149,7 @@ def load_reference_dataset( :param bucket: The name of the S3 bucket. :param object_name: The optional name of the object uploaded to S3. Default value is None. :param aws_credentials: AWS credentials used to connect to S3 bucket. Default value is None. - :param separator: Optional value to define separator used inside CSV file. Default falue is "," + :param separator: Optional value to define separator used inside CSV file. Default value is "," :return: An instance of `ModelReferenceDataset` representing the reference dataset """ @@ -222,11 +222,11 @@ def bind_reference_dataset( aws_credentials: Optional[AwsCredentials] = None, separator: str = ',', ) -> ModelReferenceDataset: - """Bind an existing reference dataset file already uploded to S3 to a `Model` + """Bind an existing reference dataset file already uploaded to S3 to a `Model` :param dataset_url: The url of the file already uploaded inside S3 :param aws_credentials: AWS credentials used to connect to S3 bucket. Default value is None. - :param separator: Optional value to define separator used inside CSV file. Default falue is "," + :param separator: Optional value to define separator used inside CSV file. Default value is "," :return: An instance of `ModelReferenceDataset` representing the reference dataset """ @@ -298,7 +298,7 @@ def load_current_dataset( :param correlation_id_column: The name of the column used for correlation id :param object_name: The optional name of the object uploaded to S3. Default value is None. :param aws_credentials: AWS credentials used to connect to S3 bucket. Default value is None. - :param separator: Optional value to define separator used inside CSV file. Default falue is "," + :param separator: Optional value to define separator used inside CSV file. Default value is "," :return: An instance of `ModelReferenceDataset` representing the reference dataset """ @@ -375,12 +375,12 @@ def bind_current_dataset( aws_credentials: Optional[AwsCredentials] = None, separator: str = ',', ) -> ModelCurrentDataset: - """Bind an existing current dataset file already uploded to S3 to a `Model` + """Bind an existing current dataset file already uploaded to S3 to a `Model` :param dataset_url: The url of the file already uploaded inside S3 :param correlation_id_column: The name of the column used for correlation id :param aws_credentials: AWS credentials used to connect to S3 bucket. Default value is None. - :param separator: Optional value to define separator used inside CSV file. Default falue is "," + :param separator: Optional value to define separator used inside CSV file. Default value is "," :return: An instance of `ModelReferenceDataset` representing the reference dataset """ diff --git a/sdk/radicalbit_platform_sdk/apis/model_current_dataset.py b/sdk/radicalbit_platform_sdk/apis/model_current_dataset.py index 73d0d34d..88dcbc7f 100644 --- a/sdk/radicalbit_platform_sdk/apis/model_current_dataset.py +++ b/sdk/radicalbit_platform_sdk/apis/model_current_dataset.py @@ -59,7 +59,7 @@ def status(self) -> str: return self.__status def statistics(self) -> Optional[DatasetStats]: - """Get statistics about the current dataset + """Get statistics about the actual dataset :return: The `DatasetStats` if exists """ @@ -85,6 +85,8 @@ def __callback( match self.__status: case JobStatus.ERROR: self.__statistics = None + case JobStatus.MISSING_CURRENT: + self.__statistics = None case JobStatus.SUCCEEDED: if self.__statistics is None: _, stats = invoke( @@ -107,7 +109,7 @@ def __callback( return self.__statistics def drift(self) -> Optional[Drift]: - """Get drift about the current dataset + """Get drift about the actual dataset :return: The `Drift` if exists """ @@ -133,6 +135,8 @@ def __callback( match self.__status: case JobStatus.ERROR: self.__drift = None + case JobStatus.MISSING_CURRENT: + self.__drift = None case JobStatus.SUCCEEDED: if self.__drift is None: _, drift = invoke( @@ -155,7 +159,7 @@ def __callback( return self.__drift def data_quality(self) -> Optional[DataQuality]: - """Get data quality metrics about the current dataset + """Get data quality metrics about the actual dataset :return: The `DataQuality` if exists """ @@ -196,6 +200,8 @@ def __callback( match self.__status: case JobStatus.ERROR: self.__data_metrics = None + case JobStatus.MISSING_CURRENT: + self.__data_metrics = None case JobStatus.SUCCEEDED: if self.__data_metrics is None: _, metrics = invoke( @@ -218,7 +224,7 @@ def __callback( return self.__data_metrics def model_quality(self) -> Optional[ModelQuality]: - """Get model quality metrics about the current dataset + """Get model quality metrics about the actual dataset :return: The `ModelQuality` if exists """ @@ -266,6 +272,8 @@ def __callback( match self.__status: case JobStatus.ERROR: self.__model_metrics = None + case JobStatus.MISSING_CURRENT: + self.__model_metrics = None case JobStatus.SUCCEEDED: if self.__model_metrics is None: _, metrics = invoke( diff --git a/sdk/radicalbit_platform_sdk/apis/model_reference_dataset.py b/sdk/radicalbit_platform_sdk/apis/model_reference_dataset.py index f52779fd..1ea10ba9 100644 --- a/sdk/radicalbit_platform_sdk/apis/model_reference_dataset.py +++ b/sdk/radicalbit_platform_sdk/apis/model_reference_dataset.py @@ -53,7 +53,7 @@ def status(self) -> str: return self.__status def statistics(self) -> Optional[DatasetStats]: - """Get statistics about the current dataset + """Get statistics about the actual dataset :return: The `DatasetStats` if exists """ @@ -78,6 +78,8 @@ def __callback( match self.__status: case JobStatus.ERROR: self.__statistics = None + case JobStatus.MISSING_REFERENCE: + self.__statistics = None case JobStatus.SUCCEEDED: if self.__statistics is None: _, stats = invoke( @@ -100,7 +102,7 @@ def __callback( return self.__statistics def data_quality(self) -> Optional[DataQuality]: - """Get data quality metrics about the current dataset + """Get data quality metrics about the actual dataset :return: The `DataQuality` if exists """ @@ -141,6 +143,8 @@ def __callback( match self.__status: case JobStatus.ERROR: self.__data_metrics = None + case JobStatus.MISSING_REFERENCE: + self.__data_metrics = None case JobStatus.SUCCEEDED: if self.__data_metrics is None: _, metrics = invoke( @@ -163,7 +167,7 @@ def __callback( return self.__data_metrics def model_quality(self) -> Optional[ModelQuality]: - """Get model quality metrics about the current dataset + """Get model quality metrics about the actual dataset :return: The `ModelQuality` if exists """ @@ -211,6 +215,8 @@ def __callback( match self.__status: case JobStatus.ERROR: self.__model_metrics = None + case JobStatus.MISSING_REFERENCE: + self.__model_metrics = None case JobStatus.SUCCEEDED: if self.__model_metrics is None: _, metrics = invoke( diff --git a/sdk/radicalbit_platform_sdk/models/dataset_drift.py b/sdk/radicalbit_platform_sdk/models/dataset_drift.py index dd7f8e10..2b050dda 100644 --- a/sdk/radicalbit_platform_sdk/models/dataset_drift.py +++ b/sdk/radicalbit_platform_sdk/models/dataset_drift.py @@ -8,6 +8,7 @@ class DriftAlgorithm(str, Enum): KS = 'KS' CHI2 = 'CHI2' + PSI = 'PSI' class FeatureDriftCalculation(BaseModel): diff --git a/sdk/radicalbit_platform_sdk/models/job_status.py b/sdk/radicalbit_platform_sdk/models/job_status.py index e8bae428..ec7b0fdd 100644 --- a/sdk/radicalbit_platform_sdk/models/job_status.py +++ b/sdk/radicalbit_platform_sdk/models/job_status.py @@ -5,3 +5,5 @@ class JobStatus(str, Enum): IMPORTING = 'IMPORTING' SUCCEEDED = 'SUCCEEDED' ERROR = 'ERROR' + MISSING_REFERENCE = 'MISSING_REFERENCE' + MISSING_CURRENT = 'MISSING_CURRENT' diff --git a/sdk/radicalbit_platform_sdk/models/model_definition.py b/sdk/radicalbit_platform_sdk/models/model_definition.py index eb47445c..54730a7c 100644 --- a/sdk/radicalbit_platform_sdk/models/model_definition.py +++ b/sdk/radicalbit_platform_sdk/models/model_definition.py @@ -32,14 +32,14 @@ class BaseModelDefinition(BaseModel): name: The name of the model. description: An optional description to explain something about the model. model_type: The type of the model - data_type: It explanin the data type used by the model + data_type: It explains the data type used by the model granularity: The window used to calculate aggregated metrics features: A list column representing the features set - outputs: An OutputType definition to explaing the output of the model + outputs: An OutputType definition to explain the output of the model target: The column used to represent model's target - timestamp: The column used to store the when prediction was done + timestamp: The column used to store when prediction was done frameworks: An optional field to describe the frameworks used by the model - algorithm: An optional field to ecplane the algorithm used by the model + algorithm: An optional field to explain the algorithm used by the model """