Skip to content

Commit 1a2fc47

Browse files
committed
new Black, new opinions. and some linter complaint fixes
1 parent 1eb8eca commit 1a2fc47

18 files changed

Lines changed: 26 additions & 4 deletions

examples/hp6632b_serial.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from scpi.devices import hp6632b
88
from scpi.wrapper import AIOWrapper
99

10+
# pylint: disable=R0801
11+
1012
if __name__ == "__main__":
1113
if len(sys.argv) < 2:
1214
print(f"run with python -i {__file__} /dev/ttyUSB0")

examples/prologix_usb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from scpi.devices.hp6632b import HP6632B
1111
from scpi.devices.generic import MultiMeter
1212

13+
# pylint: disable=R0801
14+
1315
if __name__ == "__main__":
1416
if len(sys.argv) < 2:
1517
print(f"run with python -i {__file__} /dev/ttyUSB0")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ addopts="--cov=scpi --cov-branch"
3737
max-line-length = 120
3838

3939
[tool.pylint.messages_control]
40-
disable=["fixme", "W1202", "C0330"]
40+
disable=["fixme", "W1202", "C0209"]
4141

4242
[tool.coverage.run]
4343
omit = ["tests/*"]

src/scpi/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""SCPI module, the scpi class implements the base command set, devices may extend it.
22
transports are separate from devices (so you can use for example hp6632b with either serial port or GPIB)"""
3+
34
__version__ = "2.4.0" # NOTE Use `bump2version --config-file patch` to bump versions correctly
45
from .scpi import SCPIProtocol, SCPIDevice
56
from .errors import CommandError

src/scpi/devices/TDKLambdaZPlus.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""TDK Lambda power supplies"""
2+
23
# pylint: disable=C0103
34
from typing import Optional, Union, Any
45
from dataclasses import dataclass, field
@@ -256,7 +257,7 @@ def tcp(ipaddr: str, port: int) -> TDKLambdaZplus:
256257

257258

258259
def serial(serial_url: str, baudrate: int = 9600) -> TDKLambdaZplus:
259-
""" Quick helper to connect via serial """
260+
"""Quick helper to connect via serial"""
260261
port = pyserial.serial_for_url(
261262
serial_url,
262263
baudrate=baudrate,

src/scpi/devices/generic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Mixins for different device functionalities"""
2+
23
import decimal
34

45
from ..scpi import SCPIDevice

src/scpi/devices/hp6632b.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""HP/Agilent 3362B specific device implementation and helpers"""
2+
23
from typing import Any
34
import logging
45
import decimal

src/scpi/errors/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""SCPI module specific errors"""
2+
23
from typing import Any
34

45

src/scpi/scpi.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Generic SCPI commands, allow sending and reading of raw data, helpers to parse information"""
2+
23
from typing import Any, Tuple, Sequence, Union, Optional, cast
34
import asyncio
45
import re
@@ -14,6 +15,7 @@
1415
ERROR_RE = re.compile(r'([+-]?\d+),"(.*?)"')
1516
LOGGER = logging.getLogger(__name__)
1617

18+
1719
# FIXME rename to mixin and use as such
1820
class BitEnum: # pylint: disable=R0903
1921
"""Baseclass for bit definitions of various status registers"""
@@ -234,7 +236,7 @@ async def _ask(command: str) -> str:
234236
if auto_check_error:
235237
await self.check_error(command)
236238
if abort_on_timeout:
237-
self.abort_command()
239+
await self.abort_command()
238240
# re-raise the timeout if no other error found
239241
raise err
240242
except asyncio.CancelledError:

src/scpi/transports/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"""Transport layers for the SCPI module"""
2+
23
from .rs232 import RS232Transport
34
from .tcp import TCPTransport

0 commit comments

Comments
 (0)