Skip to content

Commit 0ebab18

Browse files
committed
Reformat some files to comply with psf/black#2726
1 parent 90f0481 commit 0ebab18

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

pslab/bus/uart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class _UARTPrimitive:
3636
"""
3737

3838
_MIN_BRGVAL = 0
39-
_MAX_BRGVAL = 2 ** 16 - 1
39+
_MAX_BRGVAL = 2**16 - 1
4040

4141
_brgval = _BRGVAL
4242
_mode = _MODE

pslab/external/gas_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _correction(self):
109109
t = self._temperature()
110110
h = self._humidity()
111111
a, b, c, d = *self._TEMPERATURE_CORRECTION, self._HUMIDITY_CORRECTION
112-
return a * t ** 2 + b * t + c + d * (h - 0.65)
112+
return a * t**2 + b * t + c + d * (h - 0.65)
113113

114114
@property
115115
def _sensor_resistance(self):

pslab/external/motor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ def _get_duty_cycle(self, angle):
6868
angle /= self._angle_range # Normalize
6969
angle *= self._max_angle_pulse - self._min_angle_pulse # Scale
7070
angle += self._min_angle_pulse # Offset
71-
return angle / (self._frequency ** -1 * MICROSECONDS)
71+
return angle / (self._frequency**-1 * MICROSECONDS)

pslab/instrument/analog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class AnalogInput:
7474

7575
def __init__(self, name: str):
7676
self._name = name
77-
self._resolution = 2 ** 10 - 1
77+
self._resolution = 2**10 - 1
7878

7979
if self._name == "CH1":
8080
self.programmable_gain_amplifier = 1
@@ -140,7 +140,7 @@ def resolution(self) -> int:
140140
def resolution(self, value: int):
141141
if value not in (10, 12):
142142
raise ValueError("Resolution must be 10 or 12 bits.")
143-
self._resolution = 2 ** value - 1
143+
self._resolution = 2**value - 1
144144
self._calibrate()
145145

146146
def _calibrate(self):

pslab/instrument/logic_analyzer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def measure_frequency(
9292

9393
try:
9494
period = (t[1] - t[0]) * 1e-6 / 16
95-
frequency = period ** -1
95+
frequency = period**-1
9696
except IndexError:
9797
frequency = 0
9898

@@ -123,7 +123,7 @@ def _measure_frequency_firmware(
123123
else:
124124
return 0
125125
else:
126-
return period ** -1
126+
return period**-1
127127

128128
def _get_high_frequency(self, channel: str) -> float:
129129
"""Measure high frequency signals using firmware.
@@ -403,7 +403,7 @@ def _capture_two(self):
403403
self._device.get_ack()
404404

405405
def _capture_four(self, e2e_time: float):
406-
rollover_time = (2 ** 16 - 1) / CP.CLOCK_RATE
406+
rollover_time = (2**16 - 1) / CP.CLOCK_RATE
407407
e2e_time = 0 if e2e_time is None else e2e_time
408408

409409
if e2e_time > rollover_time * self._PRESCALERS[3]:
@@ -513,7 +513,7 @@ def _fetch_int(self, channel: DigitalInput) -> np.ndarray:
513513

514514
for i, diff in enumerate(np.diff(raw_timestamps)):
515515
if diff <= 0: # Counter has rolled over.
516-
raw_timestamps[i + 1 :] += 2 ** 16 - 1
516+
raw_timestamps[i + 1 :] += 2**16 - 1
517517

518518
return raw_timestamps
519519

pslab/instrument/power_supply.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class Source:
119119
"PV3": 1,
120120
"PCS": 0,
121121
}
122-
_RESOLUTION = 2 ** 12 - 1
122+
_RESOLUTION = 2**12 - 1
123123
_MULTI_WRITE = 0b01000000
124124

125125
def __init__(self, mcp4728: I2CSlave, name: str):

pslab/instrument/waveform_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _get_wavelength(frequency: float, table_size: int = 1) -> Tuple[int, int]:
6464
"""
6565
for prescaler in _PRESCALERS:
6666
timegap = int(round(CP.CLOCK_RATE / frequency / prescaler / table_size))
67-
if 0 < timegap < 2 ** 16:
67+
if 0 < timegap < 2**16:
6868
return timegap, prescaler
6969

7070
e = (

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy