Add flake8 bugbear checks
This commit is contained in:
parent
7ea92ad55f
commit
6142a267db
11 changed files with 40 additions and 30 deletions
|
|
@ -346,8 +346,8 @@ class StreamingPiCamera2(BaseCamera):
|
|||
sensor_modes property, and then starts the streams.
|
||||
"""
|
||||
self._initialise_picamera()
|
||||
# populate sensor modes by reading the property
|
||||
self.sensor_modes
|
||||
# Sensor modes is a cached property read it once after initialising the camera
|
||||
_modes = self.sensor_modes
|
||||
self.start_streaming()
|
||||
return self
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,9 @@ class BaseStage(lt.Thing):
|
|||
if isinstance(position, (list, tuple)):
|
||||
return [
|
||||
-int(pos) if inverted else int(pos)
|
||||
for pos, inverted in zip(position, self.axis_inverted.values())
|
||||
for pos, inverted in zip(
|
||||
position, self.axis_inverted.values(), strict=True
|
||||
)
|
||||
]
|
||||
if isinstance(position, Mapping):
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class DummyStage(BaseStage):
|
|||
fraction_complete = (time.time() - start_time) / (dt * max_displacement)
|
||||
self.instantaneous_position = {
|
||||
ax: self._hardware_position[ax] + int(fraction_complete * disp)
|
||||
for ax, disp in zip(self.axis_names, displacement)
|
||||
for ax, disp in zip(self.axis_names, displacement, strict=True)
|
||||
}
|
||||
fraction_complete = 1.0
|
||||
except lt.exceptions.InvocationCancelledError as e:
|
||||
|
|
@ -77,7 +77,7 @@ class DummyStage(BaseStage):
|
|||
self.moving = False
|
||||
self._hardware_position = {
|
||||
ax: self._hardware_position[ax] + int(fraction_complete * disp)
|
||||
for ax, disp in zip(self.axis_names, displacement)
|
||||
for ax, disp in zip(self.axis_names, displacement, strict=True)
|
||||
}
|
||||
self.instantaneous_position = self._hardware_position
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,9 @@ class SangaboardThing(BaseStage):
|
|||
def update_position(self) -> None:
|
||||
"""Read position from the stage and set the corresponding property."""
|
||||
with self.sangaboard() as sb:
|
||||
self._hardware_position = dict(zip(self.axis_names, sb.position))
|
||||
self._hardware_position = dict(
|
||||
zip(self.axis_names, sb.position, strict=True)
|
||||
)
|
||||
|
||||
def _hardware_move_relative(
|
||||
self,
|
||||
|
|
@ -164,7 +166,7 @@ class SangaboardThing(BaseStage):
|
|||
"Brightness control is not yet implemented. Desired brightness: "
|
||||
f"{intended_brightness}. Set brightness: {on_brightness}"
|
||||
)
|
||||
for i in range(number_of_flashes):
|
||||
for _i in range(number_of_flashes):
|
||||
sb.query(f"{led_command} 0")
|
||||
time.sleep(dt)
|
||||
sb.query(f"{led_command} {on_brightness}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue