From b3e79ee7b88a9b56174cb9e15bdb41570e33a8fc Mon Sep 17 00:00:00 2001 From: Jochen Sieg Date: Wed, 20 Nov 2024 13:41:18 +0100 Subject: [PATCH] linting --- molpipeline/mol2any/mol2concatinated_vector.py | 14 +++++++++++--- tests/utils/logging.py | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/molpipeline/mol2any/mol2concatinated_vector.py b/molpipeline/mol2any/mol2concatinated_vector.py index 1ffff643..0271f617 100644 --- a/molpipeline/mol2any/mol2concatinated_vector.py +++ b/molpipeline/mol2any/mol2concatinated_vector.py @@ -164,7 +164,8 @@ def _set_element_execution_details( else: self._output_type = "mixed" self._requires_fitting = any( - element[1]._requires_fitting for element in element_list # type: ignore[protected-access] + element[1]._requires_fitting + for element in element_list # pylint: disable=protected-access ) def get_params(self, deep: bool = True) -> dict[str, Any]: @@ -204,13 +205,20 @@ def _set_element_list( Parameters ---------- - element_list: list[tuple[str, MolToAnyPipelineElement]] - List of pipeline elements. + parameter_copy: dict[str, Any] + Copy of parameters. + parameters: Any + Original parameters. Raises ------ ValueError If element_list is empty. + + Returns + ------- + tuple[dict[str, Any], dict[str, Any]] + Updated parameter_copy and parameters. """ element_list = parameter_copy.pop("element_list", None) if element_list is not None: diff --git a/tests/utils/logging.py b/tests/utils/logging.py index 89a425e9..bc64511b 100644 --- a/tests/utils/logging.py +++ b/tests/utils/logging.py @@ -11,8 +11,8 @@ @contextmanager def capture_logs( - level="INFO", format="{level}:{name}:{message}" -) -> Generator[list[loguru.Message], None, None]: # ign + level: str = "INFO", format: str = "{level}:{name}:{message}" +) -> Generator[list[loguru.Message], None, None]: """Capture loguru-based logs. Custom context manager to test loguru-based logs. For details and usage examples,