Skip to content

Commit cb2c84a

Browse files
authored
Auto code format
1 parent 67af5e4 commit cb2c84a

23 files changed

Lines changed: 104 additions & 54 deletions

File tree

docs_tofupilot/integrations/openhtf/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ def phase_one():
77

88

99
def main():
10-
test = htf.Test(phase_one, procedure_id="FVT1", part_number="PCB01") # Specify procedure and part_number
10+
test = htf.Test(
11+
phase_one, procedure_id="FVT1", part_number="PCB01"
12+
) # Specify procedure and part_number
1113

1214
with TofuPilot(test): # One-line integration
1315
test.execute(lambda: "PCB1A001")

docs_tofupilot/phases/advanced/openhtf/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ def phase_firmware_version_check(test):
1616

1717
# Phase with multiple measurements
1818
@htf.measures(
19-
htf.Measurement("input_voltage").in_range(3.1, 3.5).with_units(units.VOLT),
20-
htf.Measurement("output_voltage").in_range(1.1, 1.3).with_units(units.VOLT),
21-
)
19+
htf.Measurement("input_voltage").in_range(
20+
3.1, 3.5).with_units(
21+
units.VOLT), htf.Measurement("output_voltage").in_range(
22+
1.1, 1.3).with_units(
23+
units.VOLT), )
2224
def phase_voltage_measurements(test):
2325
test.measurements.input_voltage = 3.3
2426
test.measurements.output_voltage = 1.2

docs_tofupilot/phases/dimensions/client/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import random
12
from datetime import datetime
3+
24
from tofupilot import MeasurementOutcome, PhaseOutcome, TofuPilotClient
3-
import random
45

56
client = TofuPilotClient()
67

@@ -14,7 +15,8 @@ def phase_voltage_measure():
1415
voltage = round(random.uniform(3.3, 3.5), 2)
1516
current = round(random.uniform(0.3, 0.8), 3)
1617
resistance = voltage / current
17-
structured_measurements.append((timestamp, voltage, current, resistance))
18+
structured_measurements.append(
19+
(timestamp, voltage, current, resistance))
1820

1921
phase = [
2022
{
@@ -43,7 +45,8 @@ def main():
4345
procedure_id="FVT1", # Create the procedure first in the Application
4446
unit_under_test={"serial_number": "PCB1A001", "part_number": "PCB1"},
4547
phases=phases,
46-
run_passed=all(phase["outcome"] == PhaseOutcome.PASS for phase in phases),
48+
run_passed=all(
49+
phase["outcome"] == PhaseOutcome.PASS for phase in phases),
4750
)
4851

4952

docs_tofupilot/phases/dimensions/openhtf/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import random
2+
13
import openhtf as htf
24
from openhtf.util import units
35
from tofupilot.openhtf import TofuPilot
4-
import random
56

67

78
@htf.measures(

docs_tofupilot/phases/multi-measurements/client/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import random
22
from datetime import datetime
3-
from tofupilot import TofuPilotClient, PhaseOutcome, MeasurementOutcome
3+
4+
from tofupilot import MeasurementOutcome, PhaseOutcome, TofuPilotClient
45

56
client = TofuPilotClient()
67

docs_tofupilot/phases/multi-measurements/openhtf/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
import random
2+
13
import openhtf as htf
24
from openhtf.util import units
35
from tofupilot.openhtf import TofuPilot
4-
import random
56

67

78
@htf.measures(
89
htf.Measurement("is_connected").equals(True), # Boolean measure
910
htf.Measurement("firmware_version").equals("1.2.7"), # String measure
1011
htf.Measurement("input_voltage").in_range(3.2, 3.4).with_units(units.VOLT),
11-
htf.Measurement("input_current").in_range(maximum=1.5).with_units(units.AMPERE),
12+
htf.Measurement("input_current").in_range(
13+
maximum=1.5).with_units(units.AMPERE),
1214
)
1315
def phase_multi_measurements(test):
1416
test.measurements.is_connected = True

docs_tofupilot/phases/optional/client/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def main():
3636

3737
client.create_run(
3838
procedure_id="FVT1", # Create the procedure first in the Application
39-
unit_under_test={
40-
"serial_number": "PCB1A001",
41-
"part_number": "PCB1"},
39+
unit_under_test={"serial_number": "PCB1A001", "part_number": "PCB1"},
4240
phases=phases,
4341
run_passed=all(
4442
phase["outcome"] == PhaseOutcome.PASS for phase in phases),

docs_tofupilot/phases/required/client/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ def main():
2222

2323
client.create_run(
2424
procedure_id="FVT1", # Create the procedure first in the Application
25-
unit_under_test={
26-
"serial_number": "PCB1A001",
27-
"part_number": "PCB1"},
25+
unit_under_test={"serial_number": "PCB1A001", "part_number": "PCB1"},
2826
phases=phases,
2927
run_passed=all(
3028
phase["outcome"] == PhaseOutcome.PASS for phase in phases),

docs_tofupilot/procedures/client/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from datetime import timedelta
2+
23
from tofupilot import TofuPilotClient
34

45

docs_tofupilot/stations/client/main.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Before running the script, ensure you have created a station in the TofuPilot interface
22
# and linked it to the specified procedure ID ("FVT1" in this example).
33
# You also need to save your API key in an environment variable named "STATION_API_KEY"
4-
# or pass it directly as an argument like this: TofuPilotClient(api_key="STATION_API_KEY")
4+
# or pass it directly as an argument like this:
5+
# TofuPilotClient(api_key="STATION_API_KEY")
56

6-
from datetime import timedelta, datetime
7-
from tofupilot import TofuPilotClient, PhaseOutcome
7+
from datetime import datetime, timedelta
8+
9+
from tofupilot import PhaseOutcome, TofuPilotClient
810

911

1012
def phase_one():
@@ -26,7 +28,8 @@ def main():
2628

2729
client.create_run(
2830
procedure_id="FVT1", # Create a station in TofuPilot linked to this procedure ID
29-
run_passed=all(phase["outcome"] == PhaseOutcome.PASS for phase in phases),
31+
run_passed=all(
32+
phase["outcome"] == PhaseOutcome.PASS for phase in phases),
3033
unit_under_test={"serial_number": "PCB1A001", "part_number": "PCBA01"},
3134
phases=phases,
3235
duration=timedelta(minutes=1, seconds=45),

0 commit comments

Comments
 (0)