Skip to content

Commit 754930c

Browse files
committed
Fix pylint and mypy checks
1 parent 2921b96 commit 754930c

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ disable = [
1919
"no-else-return",
2020
"duplicate-code",
2121
"cyclic-import",
22+
"redefined-builtin",
2223
]
2324

2425
[[tool.mypy.overrides]]

src/dwfpy/analog_input.py

-2
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ def get_noise(self, first_sample: int = 0, sample_count: int = -1):
531531
)
532532
return np.array((min_samples, max_samples)).T
533533

534-
# pylint: disable-next=redefined-builtin
535534
def setup(
536535
self,
537536
range: Optional[float] = None,
@@ -816,7 +815,6 @@ def wait_for_status(self, status, read_data: bool = False) -> None:
816815
while self.read_status(read_data=read_data) != status:
817816
time.sleep(0.001)
818817

819-
# pylint: disable-next=redefined-builtin
820818
def setup_channel(
821819
self,
822820
channel: int,

src/dwfpy/device.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def current_limit(self, value: bool) -> None:
482482
self._device.analog_io[1][2].value = value
483483

484484
def setup(
485-
self, voltage: float, current_limit: float = None, enabled: bool = True
485+
self, voltage: float, current_limit: Optional[float] = None, enabled: bool = True
486486
) -> None:
487487
"""Sets up the positive power supply.
488488
@@ -541,7 +541,7 @@ def current_limit(self, value: bool) -> None:
541541
self._device.analog_io[2][2].value = value
542542

543543
def setup(
544-
self, voltage: float, current_limit: float = None, enabled: bool = True
544+
self, voltage: float, current_limit: Optional[float] = None, enabled: bool = True
545545
) -> None:
546546
"""Sets up the negative power supply.
547547

src/dwfpy/protocols.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ def setup_three_wire(
313313
self,
314314
pin_clock: int,
315315
pin_siso: int,
316-
pin_select: int = None,
317-
frequency: float = None,
316+
pin_select: Optional[int] = None,
317+
frequency: Optional[float] = None,
318318
mode: int = 0,
319319
msb_first: bool = True,
320320
) -> None:
@@ -331,8 +331,8 @@ def setup_dual(
331331
pin_clock: int,
332332
pin_dq0: int,
333333
pin_dq1: int,
334-
pin_select: int = None,
335-
frequency: float = None,
334+
pin_select: Optional[int] = None,
335+
frequency: Optional[float] = None,
336336
mode: int = 0,
337337
msb_first: bool = True,
338338
) -> None:
@@ -354,8 +354,8 @@ def setup_quad(
354354
pin_dq1: int,
355355
pin_dq2: int,
356356
pin_dq3: int,
357-
pin_select: int = None,
358-
frequency: float = None,
357+
pin_select: Optional[int] = None,
358+
frequency: Optional[float] = None,
359359
mode: int = 0,
360360
msb_first: bool = True,
361361
) -> None:

0 commit comments

Comments
 (0)