applied black

This commit is contained in:
Matthias Bisping 2022-04-14 19:15:19 +02:00
parent 41b33dad65
commit 9e29d2e5f9
10 changed files with 10 additions and 10 deletions

View File

@ -7,4 +7,4 @@ from image_prediction.image_extractor.extractor import ImageMetadataPair
@pytest.fixture
def image_metadata_pairs(images, metadata):
return list(starmap(ImageMetadataPair, zip(images, metadata)))
return list(starmap(ImageMetadataPair, zip(images, metadata)))

View File

@ -4,4 +4,4 @@ import pytest
@pytest.fixture
def input_batch(batch_size, input_size):
return np.random.random_sample(size=(batch_size, *input_size))
return np.random.random_sample(size=(batch_size, *input_size))

View File

@ -22,4 +22,4 @@ def label_format(request):
@pytest.fixture
def classes():
return ["A", "B", "C"]
return ["A", "B", "C"]

View File

@ -124,4 +124,4 @@ def model_handle_mock(estimator_mock):
def predict_proba(self, batch):
return [None for _ in batch]
return ModelHandleMock()
return ModelHandleMock()

View File

@ -58,4 +58,4 @@ def mlruns_dir():
@pytest.fixture
def mlflow_reader(mlruns_dir):
return MlflowModelReader(mlruns_dir)
return MlflowModelReader(mlruns_dir)

View File

@ -35,4 +35,4 @@ def width(request):
@pytest.fixture(params=[0, 1, 2, 16, 32])
def batch_size(request):
return request.param
return request.param

View File

@ -20,4 +20,4 @@ def pdf(image_metadata_pairs):
@pytest.fixture
def real_pdf():
with open(os.path.join(TEST_DATA_DIR, "f2dc689ca794fccb8cd38b95f2bf6ba9.pdf"), "rb") as f:
yield f.read()
yield f.read()

View File

@ -88,4 +88,4 @@ def expected_predictions_mapped_and_formatted(expected_predictions_mapped):
@pytest.fixture
def real_expected_service_response():
with open(os.path.join(TEST_DATA_DIR, "f2dc689ca794fccb8cd38b95f2bf6ba9_predictions.json"), "r") as f:
yield json.load(f)
yield json.load(f)

View File

@ -1,2 +1,2 @@
def map_labels(numeric_labels, classes):
return [classes[nl] for nl in numeric_labels]
return [classes[nl] for nl in numeric_labels]

View File

@ -8,4 +8,4 @@ def get_base_position_metadata(width, height, page_width, page_height):
Info.PAGE_IDX: 0,
Info.PAGE_WIDTH: page_width,
Info.PAGE_HEIGHT: page_height,
}
}