From d11333981f6b1dd905ffec16a94fefa36920ea40 Mon Sep 17 00:00:00 2001 From: Matthias Bisping Date: Sun, 27 Mar 2022 01:20:48 +0100 Subject: [PATCH] applied black --- image_prediction/estimator/adapter/adapters/mock.py | 1 - image_prediction/estimator/preprocessor/preprocessor.py | 1 - test/unit_tests/conftest.py | 6 ++++-- test/unit_tests/estimator_test.py | 1 - test/unit_tests/predictor_test.py | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/image_prediction/estimator/adapter/adapters/mock.py b/image_prediction/estimator/adapter/adapters/mock.py index a8d5b6e..89bf477 100644 --- a/image_prediction/estimator/adapter/adapters/mock.py +++ b/image_prediction/estimator/adapter/adapters/mock.py @@ -8,7 +8,6 @@ class DummyEstimator: class EstimatorAdapterMock(EstimatorAdapter): - def __init__(self, estimator): super().__init__(estimator=estimator) diff --git a/image_prediction/estimator/preprocessor/preprocessor.py b/image_prediction/estimator/preprocessor/preprocessor.py index 5f8b026..e5da175 100644 --- a/image_prediction/estimator/preprocessor/preprocessor.py +++ b/image_prediction/estimator/preprocessor/preprocessor.py @@ -2,7 +2,6 @@ import abc class Preprocessor(abc.ABC): - @staticmethod @abc.abstractmethod def preprocess(batch): diff --git a/test/unit_tests/conftest.py b/test/unit_tests/conftest.py index 7886cb9..634d175 100644 --- a/test/unit_tests/conftest.py +++ b/test/unit_tests/conftest.py @@ -45,14 +45,16 @@ def estimator_adapter(estimator_type, keras_model, output_batch_generator, monke @pytest.fixture def keras_model(input_size): import warnings + warnings.filterwarnings("ignore", category=DeprecationWarning) import os - os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' + + os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" import tensorflow as tf - tf.keras.backend.set_image_data_format('channels_last') + tf.keras.backend.set_image_data_format("channels_last") inputs = tf.keras.Input(shape=input_size) conv = tf.keras.layers.Conv2D(3, 3) diff --git a/test/unit_tests/estimator_test.py b/test/unit_tests/estimator_test.py index c68b5d4..ff8dafd 100644 --- a/test/unit_tests/estimator_test.py +++ b/test/unit_tests/estimator_test.py @@ -17,7 +17,6 @@ def test_predict(estimator, input_batch, expected_predictions): @pytest.mark.parametrize("batch_size", [0, 1, 2, 16, 32, 64]) def test_batch_format(input_batch): - def channels_are_last(input_batch): return input_batch.shape[-1] == 3 diff --git a/test/unit_tests/predictor_test.py b/test/unit_tests/predictor_test.py index 0a2441d..63f1caa 100644 --- a/test/unit_tests/predictor_test.py +++ b/test/unit_tests/predictor_test.py @@ -24,7 +24,7 @@ def test_chunk_iterable_no_split(): def test_chunk_iterable_last_partial(): a, b, c, d = chunk_iterable(range(10), chunk_size=3) - assert d == (9, ) + assert d == (9,) def test_chunk_iterable_empty():