From 3856273e263537dba9cd4a7bc146aca24a792e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Jan=C3=9Fen?= Date: Mon, 3 Jun 2024 15:54:30 +0200 Subject: [PATCH] Remove tailing whitespace in varios classes of docstrings in cadenzaanyltics --- src/cadenzaanalytics/cadenza_analytics_extension.py | 2 +- .../cadenza_analytics_extension_service.py | 4 ++-- src/cadenzaanalytics/request/analytics_request.py | 6 +++--- src/cadenzaanalytics/request/request_metadata.py | 10 +++++----- src/cadenzaanalytics/response/csv_response.py | 2 +- src/cadenzaanalytics/response/error_response.py | 4 ++-- .../response/extension_data_response.py | 2 +- src/cadenzaanalytics/response/extension_response.py | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/cadenzaanalytics/cadenza_analytics_extension.py b/src/cadenzaanalytics/cadenza_analytics_extension.py index 8fe3d41..610ecd0 100644 --- a/src/cadenzaanalytics/cadenza_analytics_extension.py +++ b/src/cadenzaanalytics/cadenza_analytics_extension.py @@ -102,4 +102,4 @@ def _get_request_data(self, multipart_request) -> AnalyticsRequest: else: df_data = pd.DataFrame() - return AnalyticsRequest(metadata, df_data) \ No newline at end of file + return AnalyticsRequest(metadata, df_data) diff --git a/src/cadenzaanalytics/cadenza_analytics_extension_service.py b/src/cadenzaanalytics/cadenza_analytics_extension_service.py index a80457e..4a30781 100644 --- a/src/cadenzaanalytics/cadenza_analytics_extension_service.py +++ b/src/cadenzaanalytics/cadenza_analytics_extension_service.py @@ -26,7 +26,7 @@ def add_analytics_extension(self, analytics_extension: CadenzaAnalyticsExtension ---------- analytics_extension : CadenzaAnalyticsExtension The analytics extension to be added. - """ + """ self._analytics_extensions.append(analytics_extension) self._app.add_url_rule("/" + analytics_extension.relative_path, @@ -45,7 +45,7 @@ def run_development_server(self, port: int = 5000): ---------- port : int, optional The port where the service is exposed, default 5000. - """ + """ self._app.run(port=port) def __call__(self, *args, **kwargs): diff --git a/src/cadenzaanalytics/request/analytics_request.py b/src/cadenzaanalytics/request/analytics_request.py index 99ff175..c0d0d78 100644 --- a/src/cadenzaanalytics/request/analytics_request.py +++ b/src/cadenzaanalytics/request/analytics_request.py @@ -3,7 +3,7 @@ class AnalyticsRequest: """A class representing an analytics request. - """ + """ def __init__(self, metadata: RequestMetadata, data): self._metadata = metadata self._data = data @@ -16,7 +16,7 @@ def metadata(self) -> RequestMetadata: ------- RequestMetadata The metadata associated with the request. - """ + """ return self._metadata @property @@ -27,5 +27,5 @@ def data(self): ------- object The data associated with the request. - """ + """ return self._data diff --git a/src/cadenzaanalytics/request/request_metadata.py b/src/cadenzaanalytics/request/request_metadata.py index f369f65..34576ec 100644 --- a/src/cadenzaanalytics/request/request_metadata.py +++ b/src/cadenzaanalytics/request/request_metadata.py @@ -37,7 +37,7 @@ def get_first_column_of_attribute_group(self, attribute_group) -> Optional[Colum ------- Optional[ColumnMetadata] The column metadata of the first column in the given attribute group. If no column metadata for the attribute group was send None is returned. - """ + """ if self.has_columns(): for column in self._get_columns(): if column['attributeGroupName'] == attribute_group: @@ -51,7 +51,7 @@ def get_columns_by_attribute_group(self) -> Dict[str, List[ColumnMetadata]]: ------- Dict[str, List[ColumnMetadata]] A dictionary where the keys are the attribute group names and values are lists of corresponding column metadata objects. - """ + """ grouped_columns = {} columns = self._get_columns() if self.has_columns() else [] for column in columns: @@ -69,7 +69,7 @@ def get_columns(self) -> List[ColumnMetadata]: ------- List[ColumnMetadata] A list of all column metadata objects. - """ + """ columns = self._get_columns() if self.has_columns() else [] return [ColumnMetadata._from_dict(column) for column in columns] @@ -80,7 +80,7 @@ def get_parameters(self) -> Dict[str, str]: ------- dict[str, str] Parameters of the request. - """ + """ return self._request_metadata['parameters'] def get_parameter(self, name: str) -> Optional[str]: @@ -107,7 +107,7 @@ def has_columns(self) -> bool: ------- bool True if the request has columns with coresponding metadata, False otherwise. - """ + """ return (len(self._request_metadata['dataContainers']) > 0 and "columns" in self._request_metadata['dataContainers'][0]) diff --git a/src/cadenzaanalytics/response/csv_response.py b/src/cadenzaanalytics/response/csv_response.py index 272033a..e23502b 100644 --- a/src/cadenzaanalytics/response/csv_response.py +++ b/src/cadenzaanalytics/response/csv_response.py @@ -30,7 +30,7 @@ def get_response(self, original_column_metadata: List[ColumnMetadata], original_ ------- Response The CSV response. - """ + """ python_3_12 = (3, 12) if sys.version_info >= python_3_12: csv_data = self._data.to_csv( diff --git a/src/cadenzaanalytics/response/error_response.py b/src/cadenzaanalytics/response/error_response.py index 7be16bb..3982d33 100644 --- a/src/cadenzaanalytics/response/error_response.py +++ b/src/cadenzaanalytics/response/error_response.py @@ -15,7 +15,7 @@ class ErrorResponse(ExtensionResponse): ---------- ExtensionResponse : type The base extension response type from which ErrorResponse inherits. - """ + """ def __init__(self, message: str, status: int = 400): self._message = message self._status = status @@ -27,7 +27,7 @@ def get_response(self, original_column_metadata: List[ColumnMetadata], original_ ------- Response The error response. - """ + """ return self._create_response(self._message) def _get_response_json(self, message: str): diff --git a/src/cadenzaanalytics/response/extension_data_response.py b/src/cadenzaanalytics/response/extension_data_response.py index af5793e..b92af7f 100644 --- a/src/cadenzaanalytics/response/extension_data_response.py +++ b/src/cadenzaanalytics/response/extension_data_response.py @@ -15,7 +15,7 @@ class ExtensionDataResponse(ExtensionResponse): ---------- ExtensionResponse : type The base extension response type from which ExtensionDataResponse inherits. - """ + """ def __init__(self, content_type, data_container_name='response-data'): self._content_type = content_type self._data_container_name = data_container_name diff --git a/src/cadenzaanalytics/response/extension_response.py b/src/cadenzaanalytics/response/extension_response.py index e9bff2f..0f6d19b 100644 --- a/src/cadenzaanalytics/response/extension_response.py +++ b/src/cadenzaanalytics/response/extension_response.py @@ -10,5 +10,5 @@ class ExtensionResponse: """ def get_response(self, original_column_metadata: List[ColumnMetadata], original_data: DataFrame): """Get the response from the extension. - """ + """ pass