From 097754efbb55b0a9a7f2f691e941cdbc2fbbb581 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:59:05 +0000 Subject: [PATCH] [pre-commit.ci] pre-commit suggestions (#168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit suggestions updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.0.1...v4.4.0) - [github.com/psf/black: 21.11b1 → 23.9.1](https://github.com/psf/black/compare/21.11b1...23.9.1) - [github.com/PyCQA/isort: 5.10.1 → 5.12.0](https://github.com/PyCQA/isort/compare/5.10.1...5.12.0) - [github.com/PyCQA/bandit: 1.7.0 → 1.7.5](https://github.com/PyCQA/bandit/compare/1.7.0...1.7.5) - [github.com/kynan/nbstripout: 0.5.0 → 0.6.1](https://github.com/kynan/nbstripout/compare/0.5.0...0.6.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 10 +++++----- chitra/coordinates.py | 1 - chitra/datagenerator.py | 1 - chitra/dataloader.py | 1 - chitra/serve/api.py | 1 - chitra/serve/cloud/aws_serverless.py | 1 - 6 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 766fcff..25c8a7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,27 +11,27 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-added-large-files - repo: https://github.com/psf/black - rev: 21.11b1 + rev: 23.9.1 hooks: - id: black name: "Black: The uncompromising Python code formatter" - repo: https://github.com/PyCQA/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort name: "Sort Imports" args: [ "--profile black" ] - repo: https://github.com/PyCQA/bandit - rev: 1.7.0 + rev: 1.7.5 hooks: - id: bandit language_version: python3 @@ -50,6 +50,6 @@ repos: pass_filenames: false - repo: https://github.com/kynan/nbstripout - rev: 0.5.0 + rev: 0.6.1 hooks: - id: nbstripout diff --git a/chitra/coordinates.py b/chitra/coordinates.py index 945c722..1eac7c1 100644 --- a/chitra/coordinates.py +++ b/chitra/coordinates.py @@ -5,7 +5,6 @@ class BoundingBoxes: - CENTER = "XXYY" CORNER = "XYXY" diff --git a/chitra/datagenerator.py b/chitra/datagenerator.py index 939eb27..4528edf 100644 --- a/chitra/datagenerator.py +++ b/chitra/datagenerator.py @@ -34,7 +34,6 @@ def get_label(filename): class ImageSizeList: def __init__(self, img_sz_list=None): - if ( isinstance(img_sz_list, (list, tuple)) and len(img_sz_list) != 0 diff --git a/chitra/dataloader.py b/chitra/dataloader.py index 25be407..1702b9b 100644 --- a/chitra/dataloader.py +++ b/chitra/dataloader.py @@ -120,7 +120,6 @@ def _get_classnames(self, list_folders, encode_classes: bool = True): self._encode_classes() def _encode_classes(self): - class_names = sorted(self.CLASS_NAMES) for i, e in enumerate(class_names): diff --git a/chitra/serve/api.py b/chitra/serve/api.py index 5123daf..0ad8160 100644 --- a/chitra/serve/api.py +++ b/chitra/serve/api.py @@ -80,7 +80,6 @@ async def predict_question_answer(self, data: schema.QnARequest): return x def setup(self, **_): - if self.api_type in (IMAGE_CLF, OBJECT_DETECTION): self.app.post("/api/predict-image")(self.predict_image) diff --git a/chitra/serve/cloud/aws_serverless.py b/chitra/serve/cloud/aws_serverless.py index c518986..c951bf0 100644 --- a/chitra/serve/cloud/aws_serverless.py +++ b/chitra/serve/cloud/aws_serverless.py @@ -39,7 +39,6 @@ def index(): return {"hello": "world"} def predict(self) -> dict: - data_processor = self.data_processor x = self.app.current_request.raw_body logger.debug(f"raw body type={type(x)}")