diff --git a/autofocus/predict/app/models/File.py b/autofocus/predict/app/models/File.py index 490c15c..62f6446 100644 --- a/autofocus/predict/app/models/File.py +++ b/autofocus/predict/app/models/File.py @@ -1,4 +1,5 @@ import os + from werkzeug import secure_filename diff --git a/autofocus/predict/app/models/Predictor.py b/autofocus/predict/app/models/Predictor.py index e5d4a42..99a0eef 100644 --- a/autofocus/predict/app/models/Predictor.py +++ b/autofocus/predict/app/models/Predictor.py @@ -35,7 +35,7 @@ def predict_multiple(self, files): Parameters: files: Dict with File objects of image file - + Returns: dict: Dictionary of probabilities for each file in files """ @@ -45,7 +45,6 @@ def predict_multiple(self, files): predictions[key] = self.getProbabilities() return predictions - def getProbabilities(self): """ Return formated Probabilities diff --git a/autofocus/predict/app/models/ZipArchive.py b/autofocus/predict/app/models/ZipArchive.py index 89db1cb..9e85be1 100644 --- a/autofocus/predict/app/models/ZipArchive.py +++ b/autofocus/predict/app/models/ZipArchive.py @@ -1,5 +1,6 @@ import os from zipfile import ZipFile + from .File import File from ..requests.Validator import ALLOWED_IMAGE_FILES from ..utils import allowed_file @@ -46,7 +47,7 @@ def listAllImages(self, extensions=ALLOWED_IMAGE_FILES): Parameters: extensions: Array of allowed image extensions - + Returns: array: Array of filenames matching the extension """ @@ -58,7 +59,7 @@ def hasImages(self, extensions=ALLOWED_IMAGE_FILES): Parameters: extensions: Array of allowed image extensions - + Returns: boolean: True if zip has images """ @@ -74,9 +75,9 @@ def extractAll(self, path=None, members=None): Parameters: path: Path to store files members: Files to extract - + Returns: - array: Array of extracted File objects + array: Array of extracted File objects """ self.zip.extractall(path, members) extractedFiles = {} diff --git a/autofocus/predict/app/requests/PredictRequestValidator.py b/autofocus/predict/app/requests/PredictRequestValidator.py index 7dd4af8..cf062e8 100644 --- a/autofocus/predict/app/requests/PredictRequestValidator.py +++ b/autofocus/predict/app/requests/PredictRequestValidator.py @@ -3,9 +3,7 @@ class PredictRequestValidator(Validator): - """ - Validate request for endpoint predict - """ + """Validate request for endpoint predict""" def validate(self): """ diff --git a/autofocus/predict/app/requests/PredictZipRequestValidator.py b/autofocus/predict/app/requests/PredictZipRequestValidator.py index 34d600f..9a39c3b 100644 --- a/autofocus/predict/app/requests/PredictZipRequestValidator.py +++ b/autofocus/predict/app/requests/PredictZipRequestValidator.py @@ -3,9 +3,7 @@ class PredictZipRequestValidator(Validator): - """ - Validate request for endpoint predict_zip - """ + """Validate request for endpoint predict_zip""" def validate(self): """ diff --git a/autofocus/predict/app/requests/Validator.py b/autofocus/predict/app/requests/Validator.py index 4695d0d..ea634d5 100644 --- a/autofocus/predict/app/requests/Validator.py +++ b/autofocus/predict/app/requests/Validator.py @@ -1,4 +1,5 @@ from abc import ABC, abstractmethod + from flask import abort, jsonify, make_response from flask_api import status @@ -48,11 +49,9 @@ def getError(self): dict: The errors found during validation """ return self.error - + def abort(self): - """ - Abort with errors - """ + """Abort with errors""" abort(make_response( jsonify( status=status.HTTP_400_BAD_REQUEST,