Skip to content

Commit b6a7606

Browse files
committed
Remove inheritance from object needed for Python 2 support.
To support Python 2, inheriting from object was required. However, we now only work in Python 3 so this is no longer needed and is raising issues during the build of the API documentation.
1 parent 7d1da91 commit b6a7606

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

microscope/cameras/SDK3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class TimeoutError(CameraError):
120120
STRING = POINTER(AT_WC)
121121

122122
#classes so that we do some magic and automatically add byrefs etc ... can classify outputs
123-
class _meta(object):
123+
class _meta:
124124
pass
125125

126126
class OUTPUT(_meta):
@@ -155,7 +155,7 @@ def stripMeta(val):
155155
else:
156156
return val
157157

158-
class dllFunction(object):
158+
class dllFunction:
159159
def __init__(self, name, args = [], argnames = [], lib='ATCORE'):
160160
self.f = getattr(_stdcall_libraries[lib], name)
161161
self.f.restype = c_int

microscope/cameras/SDK3Cam.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from .import SDK3
2626

27-
class ATProperty(object):
27+
class ATProperty:
2828
def connect(self, handle, propertyName):
2929
self.handle = handle
3030
self.propertyName = propertyName
@@ -112,7 +112,7 @@ class ATCommand(ATProperty):
112112
def __call__(self):
113113
return SDK3.Command(self.handle, self.propertyName)
114114

115-
class camReg(object):
115+
class camReg:
116116
#keep track of the number of cameras initialised so we can initialise and finalise the library
117117
numCameras = 0
118118

@@ -139,7 +139,7 @@ def GetSoftwareVersion():
139139
return SDK3.GetString(SDK3.AT_HANDLE_SYSTEM, 'SoftwareVersion', 255)
140140

141141

142-
class SDK3Camera(object):
142+
class SDK3Camera:
143143
def __init__(self, camNum):
144144
"""camera initialisation - note that this should be called from derived classes
145145
*AFTER* the properties have been defined"""

microscope/cameras/atmcd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def lookup_status(code):
471471
# SDK3 wrapper, with some modifications and additions.
472472

473473
# Classes used to handle outputs and parameters that need buffers.
474-
class _meta(object):
474+
class _meta:
475475
pass
476476

477477
STRING = c_char_p
@@ -555,7 +555,7 @@ def __init__(self, status):
555555
self.status = status
556556

557557

558-
class dllFunction(object):
558+
class dllFunction:
559559
"""A wrapper class for DLL functions to make them available in python."""
560560
def __init__(self, name, args=[], argnames=[], rstatus=False, lib=_dll):
561561
# the library function

microscope/cameras/pvcam.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ class md_frame(ctypes.Structure):
661661

662662
# classes so that we do some magic and automatically add byrefs etc ... can classify outputs
663663
# (Nicked from PYME's Ixon wrapper.)
664-
class _meta(object):
664+
class _meta:
665665
pass
666666

667667

@@ -703,7 +703,7 @@ def stripMeta(val):
703703
CALLBACK = ctypes.CFUNCTYPE(ctypes.c_void_p)
704704

705705

706-
class dllFunction(object):
706+
class dllFunction:
707707
"""Expose a DLL function to python.
708708
709709
(Again, largely nicked from PYME.)"""
@@ -977,7 +977,7 @@ def get_param_dtype(param_id):
977977

978978
# === Python classes ===
979979
# Trigger modes.
980-
class TriggerMode(object):
980+
class TriggerMode:
981981
"""A microscope trigger mode using PVCAM PMODES."""
982982
def __init__(self, id, label, pv_mode, microscope_mode):
983983
self.id = id

microscope/clients.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
LISTENERS = {}
3434

3535

36-
class Client(object):
36+
class Client:
3737
"""Base Client object that makes methods on proxy available locally."""
3838
def __init__(self, url):
3939
self._url = url

microscope/devices.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def device(cls, host, port, conf={}, uid=None):
173173
return dict(cls=cls, host=host, port=int(port), uid=uid, conf=conf)
174174

175175

176-
class FloatingDeviceMixin(object):
176+
class FloatingDeviceMixin:
177177
"""A mixin for devices that 'float'.
178178
179179
Some SDKs handling multiple devices do not allow for explicit
@@ -190,7 +190,7 @@ def get_id(self):
190190
pass
191191

192192

193-
class Device(object):
193+
class Device:
194194
"""A base device class. All devices should subclass this class.
195195
196196
Args:
@@ -839,7 +839,7 @@ class TriggerMode(Enum):
839839
START = 4
840840

841841

842-
class TriggerTargetMixIn(object):
842+
class TriggerTargetMixIn:
843843
"""MixIn for Device that may be the target of a hardware trigger.
844844
845845
Subclasses must set a `_trigger_type` and `_trigger_mode` property
@@ -868,7 +868,7 @@ def set_trigger(self, ttype, tmode):
868868
pass
869869

870870

871-
class SerialDeviceMixIn(object):
871+
class SerialDeviceMixIn:
872872
"""MixIn for devices that are controlled via serial.
873873
874874
Currently handles the flushing and locking of the comms channel

0 commit comments

Comments
 (0)