Skip to content

Commit ac8557a

Browse files
authored
fix(lint): fix F403 and F811 issues (#474)
1 parent 3bc2034 commit ac8557a

File tree

6 files changed

+42
-49
lines changed

6 files changed

+42
-49
lines changed

boaviztapi/routers/cloud_router.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def get_archetype_config(
4444

4545

4646
@cloud_router.post("/instance", description=cloud_provider_description)
47-
async def instance_cloud_impact(
47+
async def instance_cloud_impact_from_configuration(
4848
cloud_instance: Cloud = Body(None, examples=[cloud_example]),
4949
verbose: bool = True,
5050
duration: Optional[float] = config.default_duration,
@@ -71,7 +71,7 @@ async def instance_cloud_impact(
7171

7272

7373
@cloud_router.get("/instance", description=cloud_provider_description)
74-
async def instance_cloud_impact(
74+
async def instance_cloud_impact_from_model(
7575
provider: str = Query(
7676
config.default_cloud_provider, examples=[config.default_cloud_provider]
7777
),

boaviztapi/routers/component_router.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async def cpu_archetype_config(
6565

6666

6767
@component_router.post("/cpu", description=cpu_description)
68-
async def cpu_impact_bottom_up(
68+
async def cpu_impact_bottom_up_from_configuration(
6969
cpu: CPU = Body(None, openapi_examples=components_examples_openapi["cpu"]),
7070
verbose: bool = True,
7171
duration: Optional[float] = config.default_duration,
@@ -85,7 +85,7 @@ async def cpu_impact_bottom_up(
8585

8686

8787
@component_router.get("/cpu", description=cpu_description)
88-
async def cpu_impact_bottom_up(
88+
async def cpu_impact_bottom_up_from_model(
8989
verbose: bool = True,
9090
duration: Optional[float] = config.default_duration,
9191
archetype: str = config.default_cpu,
@@ -116,7 +116,7 @@ async def gpu_archetype_config(
116116

117117

118118
@component_router.post("/gpu", description=gpu_description)
119-
async def gpu_impact_bottom_up(
119+
async def gpu_impact_bottom_up_from_configuration(
120120
gpu: GPU = Body(None, openapi_examples=components_examples_openapi["gpu"]),
121121
verbose: bool = True,
122122
duration: Optional[float] = config.default_duration,
@@ -136,7 +136,7 @@ async def gpu_impact_bottom_up(
136136

137137

138138
@component_router.get("/gpu", description=gpu_description)
139-
async def gpu_impact_bottom_up(
139+
async def gpu_impact_bottom_up_from_model(
140140
verbose: bool = True,
141141
duration: Optional[float] = config.default_duration,
142142
archetype: str = config.default_gpu,
@@ -169,7 +169,7 @@ async def ram_archetype_config(
169169

170170

171171
@component_router.post("/ram", description=ram_description)
172-
async def ram_impact_bottom_up(
172+
async def ram_impact_bottom_up_from_configuration(
173173
ram: RAM = Body(None, openapi_examples=components_examples_openapi["ram"]),
174174
verbose: bool = True,
175175
duration: Optional[float] = config.default_duration,
@@ -189,7 +189,7 @@ async def ram_impact_bottom_up(
189189

190190

191191
@component_router.get("/ram", description=ram_description)
192-
async def ram_impact_bottom_up(
192+
async def ram_impact_bottom_up_from_model(
193193
verbose: bool = True,
194194
duration: Optional[float] = config.default_duration,
195195
archetype: str = config.default_ram,
@@ -222,7 +222,7 @@ async def ssd_archetype_config(
222222

223223

224224
@component_router.post("/ssd", description=ssd_description)
225-
async def disk_impact_bottom_up(
225+
async def ssd_disk_impact_bottom_up_from_configuration(
226226
disk: Disk = Body(None, openapi_examples=components_examples_openapi["ssd"]),
227227
verbose: bool = True,
228228
duration: Optional[float] = config.default_duration,
@@ -243,7 +243,7 @@ async def disk_impact_bottom_up(
243243

244244

245245
@component_router.get("/ssd", description=ssd_description)
246-
async def disk_impact_bottom_up(
246+
async def ssd_disk_impact_bottom_up_from_model(
247247
verbose: bool = True,
248248
duration: Optional[float] = config.default_duration,
249249
archetype: str = config.default_ssd,
@@ -278,7 +278,7 @@ async def hdd_archetype_config(
278278

279279

280280
@component_router.post("/hdd", description=hdd_description)
281-
async def disk_impact_bottom_up(
281+
async def hdd_disk_impact_bottom_up_from_configuration(
282282
disk: Disk = Body(None, openapi_examples=components_examples_openapi["hdd"]),
283283
verbose: bool = True,
284284
duration: Optional[float] = config.default_duration,
@@ -299,7 +299,7 @@ async def disk_impact_bottom_up(
299299

300300

301301
@component_router.get("/hdd", description=hdd_description)
302-
async def disk_impact_bottom_up(
302+
async def hdd_disk_impact_bottom_up_from_model(
303303
verbose: bool = True,
304304
duration: Optional[float] = config.default_duration,
305305
archetype: str = config.default_hdd,
@@ -336,7 +336,7 @@ async def motherboard_archetype_config(
336336

337337

338338
@component_router.post("/motherboard", description=motherboard_description)
339-
async def motherboard_impact_bottom_up(
339+
async def motherboard_impact_bottom_up_from_configuration(
340340
motherboard: Motherboard = Body(
341341
None, openapi_examples=components_examples_openapi["motherboard"]
342342
),
@@ -355,7 +355,7 @@ async def motherboard_impact_bottom_up(
355355

356356

357357
@component_router.get("/motherboard", description=motherboard_description)
358-
async def motherboard_impact_bottom_up(
358+
async def motherboard_impact_bottom_up_from_model(
359359
verbose: bool = True,
360360
duration: Optional[float] = config.default_duration,
361361
criteria: List[str] = Query(config.default_criteria),
@@ -387,7 +387,7 @@ async def power_supply_archetype_config(
387387

388388

389389
@component_router.post("/power_supply", description=power_supply_description)
390-
async def power_supply_impact_bottom_up(
390+
async def power_supply_impact_bottom_up_from_configuration(
391391
power_supply: PowerSupply = Body(
392392
None, openapi_examples=components_examples_openapi["power_supply"]
393393
),
@@ -412,7 +412,7 @@ async def power_supply_impact_bottom_up(
412412

413413

414414
@component_router.get("/power_supply", description=power_supply_description)
415-
async def power_supply_impact_bottom_up(
415+
async def power_supply_impact_bottom_up_from_model(
416416
verbose: bool = True,
417417
duration: Optional[float] = config.default_duration,
418418
archetype: str = config.default_power_supply,
@@ -448,7 +448,7 @@ async def case_archetype_config(
448448

449449

450450
@component_router.post("/case", description=case_description)
451-
async def case_impact_bottom_up(
451+
async def case_impact_bottom_up_from_configuration(
452452
case: Case = Body(None, openapi_examples=components_examples_openapi["case"]),
453453
verbose: bool = True,
454454
duration: Optional[float] = config.default_duration,
@@ -468,7 +468,7 @@ async def case_impact_bottom_up(
468468

469469

470470
@component_router.get("/case", description=case_description)
471-
async def case_impact_bottom_up(
471+
async def case_impact_bottom_up_from_model(
472472
verbose: bool = True,
473473
duration: Optional[float] = config.default_duration,
474474
archetype: str = config.default_case,

boaviztapi/routers/iot_router.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async def get_archetype_config(
3030

3131

3232
@iot.post("/iot_device", description="")
33-
async def iot_device_impact(
33+
async def iot_device_impact_from_configuration(
3434
iot: IoT = Body(None, examples=[""]),
3535
verbose: bool = True,
3636
duration: Optional[float] = config.default_duration,
@@ -47,7 +47,7 @@ async def iot_device_impact(
4747

4848

4949
@iot.get("/iot_device", description="")
50-
async def iot_device_impact(
50+
async def iot_device_impact_from_model(
5151
archetype: str = config.default_iot_device,
5252
verbose: bool = True,
5353
duration: Optional[float] = config.default_duration,

boaviztapi/routers/peripheral_router.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def monitor_get_archetype_config(
5151

5252

5353
@peripheral_router.post("/monitor", description=peripheral_description)
54-
async def monitor_impact(
54+
async def monitor_impact_from_configuration(
5555
monitor: Monitor = Body(None, examples=[end_user_terminal]),
5656
verbose: bool = True,
5757
duration: Optional[float] = config.default_duration,
@@ -68,7 +68,7 @@ async def monitor_impact(
6868

6969

7070
@peripheral_router.get("/monitor", description=peripheral_description)
71-
async def monitor_impact(
71+
async def monitor_impact_from_model(
7272
archetype: str = config.default_monitor,
7373
verbose: bool = True,
7474
duration: Optional[float] = config.default_duration,
@@ -100,7 +100,7 @@ async def usb_stick_get_archetype_config(
100100

101101

102102
@peripheral_router.post("/usb_stick", description=peripheral_description)
103-
async def usb_stick_impact(
103+
async def usb_stick_impact_from_configuration(
104104
usb_stick: UsbStick = Body(None, examples=[end_user_terminal]),
105105
verbose: bool = True,
106106
duration: Optional[float] = config.default_duration,
@@ -117,7 +117,7 @@ async def usb_stick_impact(
117117

118118

119119
@peripheral_router.get("/usb_stick", description=peripheral_description)
120-
async def usb_stick_impact(
120+
async def usb_stick_impact_from_model(
121121
archetype: str = config.default_usb_stick,
122122
verbose: bool = True,
123123
duration: Optional[float] = config.default_duration,
@@ -149,7 +149,7 @@ async def external_ssd_get_archetype_config(
149149

150150

151151
@peripheral_router.post("/external_ssd", description=peripheral_description)
152-
async def external_ssd_impact(
152+
async def external_ssd_impact_from_configuration(
153153
external_ssd: ExternalSSD = Body(None, examples=[end_user_terminal]),
154154
verbose: bool = True,
155155
duration: Optional[float] = config.default_duration,
@@ -166,7 +166,7 @@ async def external_ssd_impact(
166166

167167

168168
@peripheral_router.get("/external_ssd", description=peripheral_description)
169-
async def external_ssd_impact(
169+
async def external_ssd_impact_from_model(
170170
archetype: str = config.default_external_ssd,
171171
verbose: bool = True,
172172
duration: Optional[float] = config.default_duration,
@@ -198,7 +198,7 @@ async def external_hdd_get_archetype_config(
198198

199199

200200
@peripheral_router.post("/external_hdd", description=peripheral_description)
201-
async def external_hdd_impact(
201+
async def external_hdd_impact_from_configuration(
202202
external_hdd: ExternalHDD = Body(None, examples=[end_user_terminal]),
203203
verbose: bool = True,
204204
duration: Optional[float] = config.default_duration,
@@ -215,7 +215,7 @@ async def external_hdd_impact(
215215

216216

217217
@peripheral_router.get("/external_hdd", description=peripheral_description)
218-
async def external_hdd_impact(
218+
async def external_hdd_impact_from_model(
219219
archetype: str = config.default_external_hdd,
220220
verbose: bool = True,
221221
duration: Optional[float] = config.default_duration,
@@ -264,7 +264,7 @@ async def vr_controller_impact_from_configuration(
264264

265265

266266
@peripheral_router.get("/vr_controller", description=peripheral_description)
267-
async def vr_controller_impact(
267+
async def vr_controller_impact_from_model(
268268
archetype: str = config.default_vr_controller,
269269
verbose: bool = True,
270270
duration: Optional[float] = config.default_duration,

boaviztapi/routers/terminal_router.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async def laptop_get_archetype_config(
5858

5959

6060
@terminal_router.post("/laptop", description=terminal_description)
61-
async def laptop_impact(
61+
async def laptop_impact_from_configuration(
6262
laptop: Laptop = Body(None, examples=[end_user_terminal]),
6363
verbose: bool = True,
6464
duration: Optional[float] = config.default_duration,
@@ -75,7 +75,7 @@ async def laptop_impact(
7575

7676

7777
@terminal_router.get("/laptop", description=terminal_description)
78-
async def laptop_impact(
78+
async def laptop_impact_from_model(
7979
archetype: str = config.default_laptop,
8080
verbose: bool = True,
8181
duration: Optional[float] = config.default_duration,
@@ -103,7 +103,7 @@ async def desktop_get_archetype_config(
103103

104104

105105
@terminal_router.post("/desktop", description=terminal_description)
106-
async def desktop_impact(
106+
async def desktop_impact_from_configuration(
107107
desktop: Desktop = Body(None, examples=[end_user_terminal]),
108108
verbose: bool = True,
109109
duration: Optional[float] = config.default_duration,
@@ -120,7 +120,7 @@ async def desktop_impact(
120120

121121

122122
@terminal_router.get("/desktop", description=terminal_description)
123-
async def desktop_impact(
123+
async def desktop_impact_from_model(
124124
archetype: str = config.default_desktop,
125125
verbose: bool = True,
126126
duration: Optional[float] = config.default_duration,
@@ -150,7 +150,7 @@ async def smartphone_get_archetype_config(
150150

151151

152152
@terminal_router.post("/smartphone", description=terminal_description)
153-
async def smartphone_impact(
153+
async def smartphone_impact_from_configuration(
154154
smartphone: Smartphone = Body(None, examples=[end_user_terminal]),
155155
verbose: bool = True,
156156
duration: Optional[float] = config.default_duration,
@@ -167,7 +167,7 @@ async def smartphone_impact(
167167

168168

169169
@terminal_router.get("/smartphone", description=terminal_description)
170-
async def smartphone_impact(
170+
async def smartphone_impact_from_model(
171171
archetype: str = config.default_smartphone,
172172
verbose: bool = True,
173173
duration: Optional[float] = config.default_duration,
@@ -195,7 +195,7 @@ async def tablet_get_archetype_config(
195195

196196

197197
@terminal_router.post("/tablet", description=terminal_description)
198-
async def tablet_impact(
198+
async def tablet_impact_from_configuration(
199199
tablet: Tablet = Body(None, examples=[end_user_terminal]),
200200
verbose: bool = True,
201201
duration: Optional[float] = config.default_duration,
@@ -212,7 +212,7 @@ async def tablet_impact(
212212

213213

214214
@terminal_router.get("/tablet", description=terminal_description)
215-
async def tablet_impact(
215+
async def tablet_impact_from_model(
216216
archetype: str = config.default_tablet,
217217
verbose: bool = True,
218218
duration: Optional[float] = config.default_duration,
@@ -242,7 +242,7 @@ async def television_get_archetype_config(
242242

243243

244244
@terminal_router.post("/television", description=terminal_description)
245-
async def television_impact(
245+
async def television_impact_from_configuration(
246246
television: Television = Body(None, examples=[end_user_terminal]),
247247
verbose: bool = True,
248248
duration: Optional[float] = config.default_duration,
@@ -259,7 +259,7 @@ async def television_impact(
259259

260260

261261
@terminal_router.get("/television", description=terminal_description)
262-
async def television_impact(
262+
async def television_impact_from_model(
263263
archetype: str = config.default_television,
264264
verbose: bool = True,
265265
duration: Optional[float] = config.default_duration,
@@ -287,7 +287,7 @@ async def box_get_archetype_config(
287287

288288

289289
@terminal_router.post("/box", description=terminal_description)
290-
async def box_impact(
290+
async def box_impact_from_configuration(
291291
box: Box = Body(None, examples=[end_user_terminal]),
292292
verbose: bool = True,
293293
duration: Optional[float] = config.default_duration,
@@ -304,7 +304,7 @@ async def box_impact(
304304

305305

306306
@terminal_router.get("/box", description=terminal_description)
307-
async def box_impact(
307+
async def box_impact_from_model(
308308
archetype: str = config.default_box,
309309
verbose: bool = True,
310310
duration: Optional[float] = config.default_duration,
@@ -351,7 +351,7 @@ async def vr_headset_impact_from_configuration(
351351

352352

353353
@terminal_router.get("/vr_headset", description=terminal_description)
354-
async def vr_headset_impact(
354+
async def vr_headset_impact_from_model(
355355
archetype: str = config.default_vr_headset,
356356
verbose: bool = True,
357357
duration: Optional[float] = config.default_duration,

pyproject.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ line-length = 88
6464
target-version = "py313"
6565
force-exclude = true
6666

67-
[tool.ruff.lint]
68-
# TODO - uncomment these ignores one by one and fix in separate PRs
69-
ignore = [
70-
"F403", # Unable to detect undefined names
71-
"F811", # Redefinition of unused
72-
]
73-
7467
[tool.ruff.format]
7568
quote-style = "double"
7669
indent-style = "space"

0 commit comments

Comments
 (0)