From a171f2475694b918aecf3acdaa1cdf2f207ebb16 Mon Sep 17 00:00:00 2001 From: GoldenAnpu Date: Wed, 21 Feb 2024 20:21:27 +0100 Subject: [PATCH] fix pylint comments --- agent/worker/constants.py | 4 ++-- agent/worker/task_app.py | 20 ++++++++++---------- agent/worker/task_custom.py | 4 ++-- agent/worker/task_inference.py | 4 ++-- agent/worker/task_inference_rpc.py | 4 ++-- agent/worker/task_train.py | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/agent/worker/constants.py b/agent/worker/constants.py index cd00498..05b0aa1 100644 --- a/agent/worker/constants.py +++ b/agent/worker/constants.py @@ -6,9 +6,9 @@ import supervisely_lib as sly import hashlib import re -from supervisely_lib.io.docker_utils import ( +from supervisely_lib.io.docker_utils import ( # pylint: disable=import-error, no-name-in-module PullPolicy, -) # pylint: disable=import-error, no-name-in-module +) _SERVER_ADDRESS = "SERVER_ADDRESS" diff --git a/agent/worker/task_app.py b/agent/worker/task_app.py index 474e07f..e3cd7b5 100644 --- a/agent/worker/task_app.py +++ b/agent/worker/task_app.py @@ -21,16 +21,16 @@ import supervisely_lib as sly from .task_dockerized import TaskDockerized -from supervisely_lib.io.json import ( +from supervisely_lib.io.json import ( # pylint: disable=import-error, no-name-in-module dump_json_file, -) # pylint: disable=import-error, no-name-in-module -from supervisely_lib.io.json import ( +) +from supervisely_lib.io.json import ( # pylint: disable=import-error, no-name-in-module flatten_json, modify_keys, -) # pylint: disable=import-error, no-name-in-module -from supervisely_lib.api.api import ( +) +from supervisely_lib.api.api import ( # pylint: disable=import-error, no-name-in-module SUPERVISELY_TASK_ID, -) # pylint: disable=import-error, no-name-in-module +) from supervisely_lib.api.api import Api # pylint: disable=import-error, no-name-in-module from supervisely_lib.io.fs import ( # pylint: disable=import-error, no-name-in-module ensure_base_path, @@ -41,9 +41,9 @@ file_exists, mkdir, ) -from supervisely_lib.io.exception_handlers import ( +from supervisely_lib.io.exception_handlers import ( # pylint: disable=import-error, no-name-in-module handle_exceptions, -) # pylint: disable=import-error, no-name-in-module +) from worker import constants from worker.agent_utils import ( @@ -612,8 +612,8 @@ def install_pip_requirements(self, container_id=None): pip_install_exec_info = self._docker_api.api.exec_inspect(self._exec_id) - if pip_install_exec_info['ExitCode'] != 0: - raise RuntimeError("Pip install failed") + if pip_install_exec_info["ExitCode"] != 0: + raise RuntimeError("Pip install failed") self.logger.info("Requirements are installed") diff --git a/agent/worker/task_custom.py b/agent/worker/task_custom.py index d7e9ff4..5bfecfa 100644 --- a/agent/worker/task_custom.py +++ b/agent/worker/task_custom.py @@ -5,9 +5,9 @@ import os from supervisely_lib.task.paths import TaskPaths # pylint: disable=import-error, no-name-in-module -from supervisely_lib.io.json import ( +from supervisely_lib.io.json import ( # pylint: disable=import-error, no-name-in-module dump_json_file, -) # pylint: disable=import-error, no-name-in-module +) from worker.task_dockerized import TaskDockerized, TaskStep from worker import constants diff --git a/agent/worker/task_inference.py b/agent/worker/task_inference.py index c500c71..7f97138 100644 --- a/agent/worker/task_inference.py +++ b/agent/worker/task_inference.py @@ -6,9 +6,9 @@ import supervisely_lib as sly from supervisely_lib.task.paths import TaskPaths # pylint: disable=import-error, no-name-in-module -from supervisely_lib.io.json import ( +from supervisely_lib.io.json import ( # pylint: disable=import-error, no-name-in-module dump_json_file, -) # pylint: disable=import-error, no-name-in-module +) from worker.task_dockerized import TaskDockerized, TaskStep from worker import agent_utils diff --git a/agent/worker/task_inference_rpc.py b/agent/worker/task_inference_rpc.py index ecd6345..318636d 100644 --- a/agent/worker/task_inference_rpc.py +++ b/agent/worker/task_inference_rpc.py @@ -6,9 +6,9 @@ import supervisely_lib as sly from supervisely_lib.task.paths import TaskPaths # pylint: disable=import-error, no-name-in-module -from supervisely_lib.io.json import ( +from supervisely_lib.io.json import ( # pylint: disable=import-error, no-name-in-module dump_json_file, -) # pylint: disable=import-error, no-name-in-module +) from worker.task_dockerized import TaskDockerized, TaskStep from worker import constants diff --git a/agent/worker/task_train.py b/agent/worker/task_train.py index b22c13e..9e2df71 100644 --- a/agent/worker/task_train.py +++ b/agent/worker/task_train.py @@ -50,12 +50,12 @@ def init_additional(self): def download_step(self): self.logger.info("DOWNLOAD_DATA") - sly.io.json.dump_json_file( + sly.io.json.dump_json_file( # Deprecated 'task_settings.json' # pylint: disable=no-member self.info["config"], self.config_path1 - ) # Deprecated 'task_settings.json' # pylint: disable=no-member - sly.io.json.dump_json_file( + ) + sly.io.json.dump_json_file( # New style task_config.json # pylint: disable=no-member self.info["config"], self.config_path2 - ) # New style task_config.json # pylint: disable=no-member + ) if len(self.info["projects"]) != 1: raise ValueError(