@@ -453,6 +453,7 @@ def get_setting(self, name: str):
453453
454454 def get_all_settings (self ):
455455 """Return ordered settings as a list of dicts."""
456+
456457 # Fetching some settings may fail depending on device state.
457458 # Report these values as 'None' and continue fetching other settings.
458459 def catch (f ):
@@ -870,7 +871,8 @@ def get_transform(self) -> typing.Tuple[bool, bool, bool]:
870871 def _update_transform (self ):
871872 """Update transform (after setting the client or readout transform)."""
872873 lr , ud , rot = (
873- self ._readout_transform [i ] ^ self ._client_transform [i ] for i in range (3 )
874+ self ._readout_transform [i ] ^ self ._client_transform [i ]
875+ for i in range (3 )
874876 )
875877 if self ._readout_transform [2 ] and self ._client_transform [2 ]:
876878 lr = not lr
@@ -1556,15 +1558,16 @@ def move_to(self, position: typing.Mapping[str, float]) -> None:
15561558 """
15571559 raise NotImplementedError ()
15581560
1559- class DigitalIO (Device , metaclass = abc .ABCMeta ):
1561+
1562+ class DigitalIO (DataDevice , metaclass = abc .ABCMeta ):
15601563 """ABC for digital IO devices.
15611564
15621565 Digital IO devices (DIO) have a num,ber of digital lines that can
15631566 be for output, or optionally input and can switch between a on and
15641567 off state.
15651568
15661569 Args:
1567- numLines: total number of digital lines numberes 0 to n-1.
1570+ numLines: total number of digital lines numberes 0 to n-1.
15681571
15691572 """
15701573
@@ -1576,25 +1579,25 @@ def __init__(self, numLines: int, **kwargs) -> None:
15761579 )
15771580 self ._numLines = numLines
15781581
1579- #array to map wether lines are input or output
1580- # true is output, start with all lines defined for output.
1581- self ._IOMap = [True ]* self ._numLines
1582-
1582+ # array to map wether lines are input or output
1583+ # true is output, start with all lines defined for output.
1584+ self ._IOMap = [True ] * self ._numLines
1585+
15831586 def get_num_lines (self ):
15841587 """Returns the number of Io lines present in this instance"""
15851588 return self ._numLines
15861589
1587- @abc .abstractmethod
1590+ @abc .abstractmethod
15881591 def set_IO_state (self , line : int , state : bool ):
15891592 """Sets the state of a single Digital line to either Output or Input
15901593
15911594 Args:
15921595 line: The line to have its mode set.
1593-
1596+
15941597 state: True for Output or False for Input."""
15951598 raise NotImplementedError ()
15961599
1597- @abc .abstractmethod
1600+ @abc .abstractmethod
15981601 def get_IO_state (self , line ):
15991602 """Returns the state of a single Digital line, either Output or Input
16001603
@@ -1610,48 +1613,47 @@ def set_all_IO_state(self, stateArray):
16101613 stateArray: Boolean array for the lines, True in output False
16111614 is Input"""
16121615 for i , state in enumerate (stateArray ):
1613- #set each line as defined in stateArray
1614- self .set_IO_state (i ,state )
1615-
1616+ # set each line as defined in stateArray
1617+ self .set_IO_state (i , state )
16161618
16171619 def get_all_IO_state (self ):
16181620 """Returns the state of a all Digital line, either Output or Input
16191621
1620- Returns a boolean array one entry for each line,
1622+ Returns a boolean array one entry for each line,
16211623 True for Output and False for Input"""
16221624
1623- stateArray = [None ]* self ._numLines
1625+ stateArray = [None ] * self ._numLines
16241626 for i in range (self ._numLines ):
1625- stateArray [i ]= self .get_IO_state (i )
1627+ stateArray [i ] = self .get_IO_state (i )
16261628 return stateArray
16271629
1628- @abc .abstractmethod
1629- def write_line (self ,line ,ouput ):
1630+ @abc .abstractmethod
1631+ def write_line (self , line , ouput ):
16301632 """Sets the level of a single output line
16311633
16321634 Args:
16331635 line: the line to be set
16341636 output: the level True for high and Flase for low."""
1635-
1637+
16361638 raise NotImplementedError ()
16371639
1638- def write_all_lines (self ,ouput_array ):
1640+ def write_all_lines (self , ouput_array ):
16391641 """Sets the output level of every output line.
16401642
16411643 Args:
1642- output_array: Boolean array of output states True for high,
1643- False for low, array entries for lines set
1644+ output_array: Boolean array of output states True for high,
1645+ False for low, array entries for lines set
16441646 as inputs are ignored."""
1645-
1646- if len (output_array ) != self ._numLines :
1647- raise ("Output array must be numLines in length" )
1647+
1648+ if len (ouput_array ) != self ._numLines :
1649+ raise ("Output array must be numLines in length" )
16481650 for i in range (self ._numLines ):
1649- #set line i to the IOMap entry, true for output false for input.
1650- if ( not self ._IOMap [i ]) :
1651- self .write_line (i ,output_array [i ])
1651+ # set line i to the IOMap entry, true for output false for input.
1652+ if not self ._IOMap [i ]:
1653+ self .write_line (i , ouput_array [i ])
16521654
1653- @abc .abstractmethod
1654- def read_line (self ,line ):
1655+ @abc .abstractmethod
1656+ def read_line (self , line ):
16551657 """Read a single input line.
16561658 Args:
16571659 line: the line to read
@@ -1661,8 +1663,8 @@ def read_line(self,line):
16611663 def read_all_lines (self ):
16621664 """Read all the input lines.
16631665 Return: Boolean Array with outline enteries set to None."""
1664-
1665- readarray = [None ]* self ._numLines
1666+
1667+ readarray = [None ] * self ._numLines
16661668 for i in range (self ._numLines ):
1667- readarray [i ]= self .read_line (i )
1668- return ( readarray )
1669+ readarray [i ] = self .read_line (i )
1670+ return readarray
0 commit comments