Skip to content

Commit 94e8857

Browse files
committed
Remove unusued imports and variables found via pyflakes.
1 parent b651727 commit 94e8857

File tree

12 files changed

+8
-21
lines changed

12 files changed

+8
-21
lines changed

microscope/cameras/atmcd.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@
3131
"""
3232

3333
import logging
34-
import re, sys, functools, os, platform
34+
import sys, functools, os, platform
3535
import ctypes
3636
from ctypes import Structure, POINTER
3737
from ctypes import c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong
3838
from ctypes import c_ubyte, c_short, c_float, c_double, c_char, c_char_p
39-
from ctypes import c_void_p
4039
from numpy.ctypeslib import ndpointer
4140

4241

@@ -1132,7 +1131,6 @@ def __str__(self):
11321131

11331132

11341133
from threading import Lock
1135-
import functools
11361134
from microscope import devices
11371135
from microscope.devices import keep_acquiring, Setting, Binning, ROI
11381136
import time

microscope/cameras/pvcam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ def _on_enable(self):
12551255
t_exp = int(self.exposure_time * 1e6)
12561256
else:
12571257
self._params[PARAM_EXP_RES].set_value(EXP_RES_ONE_MILLISEC)
1258-
t_exp = value = int(self.exposure_time * 1e3)
1258+
t_exp = int(self.exposure_time * 1e3)
12591259
# Configure camera, allocate buffer, and register callback.
12601260
if self._trigger == TRIG_SOFT:
12611261
# Software triggering for single frames.

microscope/cameras/ximea.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import numpy as np
2525

2626
from microscope import devices
27-
from microscope.devices import keep_acquiring, Binning, ROI
27+
from microscope.devices import keep_acquiring, ROI
2828

2929
#import ximea python module.
3030
from ximea import xiapi

microscope/devices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ def set_binning(self, binning):
768768
@abc.abstractmethod
769769
def _get_roi(self):
770770
"""Return the ROI as it is on hardware."""
771-
return ROI(left, top, width, height)
771+
raise NotImplementedError()
772772

773773
def get_roi(self):
774774
"""Return ROI as a rectangle (left, top, width, height).

microscope/deviceserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def keep_alive():
335335
try:
336336
s.join(30)
337337
except:
338-
_logger.error("... could not join PID %s." % (old_pid))
338+
_logger.error("... could not join PID %s." % (s.pid))
339339
else:
340340
old_pid = s.pid
341341
del (s)

microscope/filterwheels/thorlabs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818

1919
import io
20-
import time
2120

2221
import serial
2322

microscope/gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Device(tkinter.Frame):
3838
def __init__(self, device, master=None, *args, **kwargs):
3939
tkinter.Frame.__init__(self, master, *args, **kwargs)
4040
self.device = device
41-
seld.draw_table()
41+
self.draw_table()
4242

4343
def draw_table(self):
4444
row_idx = 0

microscope/stages/linkam.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@
3131
* get_id returns an empty string, not the device serial number."""
3232

3333
import ctypes
34-
from ctypes import addressof, byref, POINTER
34+
from ctypes import byref, POINTER
3535
from enum import Enum, IntEnum
3636
from microscope import devices
37-
from microscope.devices import Setting
3837
import datetime, time
3938

4039
_max_version_length = 20
@@ -73,7 +72,7 @@ def view_of_info(self):
7372
return self.info
7473
else:
7574
offset = getattr(_CommsInfo, 'info').offset
76-
return _USBCommsInfo.from_buffer(self, getattr(_CommsInfo, 'info').offset)
75+
return _USBCommsInfo.from_buffer(self, offset)
7776

7877

7978
class _SerialCommsInfo(ctypes.Structure):
@@ -1113,7 +1112,6 @@ def set_value(self, svt, val):
11131112
else:
11141113
svt = _StageValueType(svt)
11151114
vtype = _StageValueTypeToVariant.get(svt, "vFloat32")
1116-
v = _Variant(**{vtype: val})
11171115
return self._process_msg(Msg.SetValue,
11181116
_StageValueType(svt).value,
11191117
_Variant(**{vtype: val})).vBoolean

microscope/testsuite/devices.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ def _fetch_data(self):
233233
light = int(255 - 128 * np.random.rand())
234234
width = self._roi.width // self._binning.h
235235
height = self._roi.height // self._binning.v
236-
size = (width, height)
237236
image = self._image_generator.get_image(width, height, dark, light, index=self._sent)
238237
self._sent += 1
239238
return image

microscope/testsuite/mock_devices.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131
"""
3232

3333
import enum
34-
import functools
3534
import io
3635

37-
3836
import serial.serialutil
3937

4038

0 commit comments

Comments
 (0)