From 88de3089eabc1aaf5880488ceb7fa9d8474697d5 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 21 Apr 2021 13:38:14 +0100 Subject: [PATCH] Fixed linter errors --- .../default_extensions/picamera_autocalibrate/extension.py | 6 +++--- .../picamera_autocalibrate/recalibrate_utils.py | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py b/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py index e8dc726e..5f0d9c7e 100644 --- a/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py +++ b/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py @@ -205,7 +205,7 @@ class AutoExposureFromRawView(ActionView): } def post(self, args): - with find_picamera() as (picamera, scamera, microscope): + with find_picamera() as (picamera, _, _): adjust_shutter_and_gain_from_raw(picamera, **args) @@ -224,7 +224,7 @@ class AutoWhiteBalanceFromRawView(ActionView): } def post(self, args): - with find_picamera() as (picamera, scamera, microscope): + with find_picamera() as (picamera, _, _): adjust_white_balance_from_raw(picamera, **args) @@ -238,5 +238,5 @@ class GetRawChannelPercentilesView(ActionView): schema = fields.List(fields.Integer) def post(self, args): - with find_picamera() as (picamera, scamera, microscope): + with find_picamera() as (picamera, _, _): return get_channel_percentiles(picamera, args["percentile"]) diff --git a/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py b/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py index e6c6b5fe..352d2354 100644 --- a/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py +++ b/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py @@ -1,6 +1,5 @@ import logging import time -from fractions import Fraction from typing import List, Optional, Tuple import numpy as np @@ -40,7 +39,7 @@ def flat_lens_shading_table(camera: PiCamera) -> np.ndarray: def adjust_exposure_to_setpoint(camera: PiCamera, setpoint: int): """Adjust the camera's exposure time until the maximum pixel value is .""" - logging.info("Adjusting shutter speed to hit setpoint {}".format(setpoint)) + logging.info(f"Adjusting shutter speed to hit setpoint {setpoint}") for _ in range(3): camera.shutter_speed = int( camera.shutter_speed * setpoint / np.max(rgb_image(camera))