linting and typing fixes

This commit is contained in:
Richard 2021-07-19 20:29:13 +01:00
parent b7c9d3b73b
commit 72f3c11fdd
7 changed files with 13 additions and 10 deletions

View file

@ -24,7 +24,7 @@ import os
from datetime import datetime
import pkg_resources
from flask import abort, send_file, jsonify
from flask import abort, jsonify, send_file
from flask_cors import CORS, cross_origin
from labthings import create_app
from labthings.extensions import find_extensions
@ -39,6 +39,7 @@ from openflexure_microscope.paths import (
OPENFLEXURE_VAR_PATH,
logs_file_path,
)
from .openapi import add_spec_extras

View file

@ -7,6 +7,7 @@ from typing import Callable, Dict, List, Optional, Tuple
import numpy as np
from labthings import current_action, fields, find_component
from labthings.extensions import BaseExtension
from labthings.utilities import get_docstring, get_summary
from labthings.views import ActionView, View
from scipy import ndimage
@ -15,7 +16,6 @@ from openflexure_microscope.devel import abort
from openflexure_microscope.microscope import Microscope
from openflexure_microscope.stage.base import BaseStage
from openflexure_microscope.utilities import set_properties
from labthings.utilities import get_docstring, get_summary
### Autofocus utilities
@ -218,7 +218,7 @@ def extension_action(args=None):
# Run the action
return func(**arguments)
def get(self, *args, **kwargs):
def get(self, *args, **kwargs): # pylint: disable=useless-super-delegation
# Explicitly wrap the `get` method to allow us to add a docstring
return super().get(*args, **kwargs)
@ -346,7 +346,7 @@ class AutofocusExtension(BaseExtension):
camera: BaseCamera = microscope.camera
stage: BaseStage = microscope.stage
if not dz:
dz = np.linspace(-300, 300, 7)
dz: List[int] = list(np.linspace(-300, 300, 7))
with set_properties(stage, backlash=256), stage.lock, camera.lock:
sharpnesses: List[float] = []

View file

@ -2,10 +2,10 @@ import datetime
import logging
import time
import uuid
import marshmallow
from functools import reduce
from typing import Dict, List, Optional, Tuple
import marshmallow
from labthings import (
current_action,
fields,

View file

@ -1,7 +1,7 @@
from .actions import enabled_root_actions
from .camera import *
from .captures import *
from .docs import *
from .instrument import *
from .stage import *
from .streams import *
from .docs import *

View file

@ -1,6 +1,6 @@
from labthings.views import View
from labthings import current_labthing
from flask import Response
from labthings import current_labthing
from labthings.views import View
class APISpecJSONView(View):

View file

@ -19,8 +19,8 @@ from openflexure_microscope.stage.sanga import SangaDeltaStage, SangaStage
try:
from openflexure_microscope.camera.pi import PiCameraStreamer
except Exception as e: # pylint: disable=W0703
logging.error(e)
except Exception as exc: # pylint: disable=W0703
logging.error(exc)
logging.warning("Unable to import PiCameraStreamer")
from labthings import CompositeLock