Skip to content

Commit 40473ea

Browse files
committed
Format code with Black 25.x to match CI
1 parent e8f5199 commit 40473ea

File tree

5 files changed

+27
-21
lines changed

5 files changed

+27
-21
lines changed

bases/rsptx/assignment_server_api/routers/assignment_summary.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,11 @@ def create_assignment_summary(assignment_id, course, dburl):
141141
]
142142
try:
143143
merged.iloc[0, 3:] = merged.iloc[0, 3:].apply(
144-
lambda x: "{:.2f}".format(float(x.split("(")[0]))
145-
if type(x) is str and "(" in x
146-
else "{:.2f}".format(float(x))
144+
lambda x: (
145+
"{:.2f}".format(float(x.split("(")[0]))
146+
if type(x) is str and "(" in x
147+
else "{:.2f}".format(float(x))
148+
)
147149
)
148150
except Exception as e:
149151
print(

bases/rsptx/assignment_server_api/routers/instructor.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,9 +1220,9 @@ async def do_download_assignment(
12201220
csv_buffer,
12211221
media_type="text/csv",
12221222
)
1223-
response.headers[
1224-
"Content-Disposition"
1225-
] = f"attachment; filename=assignment_{assignment_id}.csv"
1223+
response.headers["Content-Disposition"] = (
1224+
f"attachment; filename=assignment_{assignment_id}.csv"
1225+
)
12261226

12271227
return response
12281228

@@ -1603,9 +1603,11 @@ async def get_datafiles(
16031603
"filename": df.filename,
16041604
"course_id": df.course_id,
16051605
"owner": df.owner,
1606-
"main_code": df.main_code[:100] + "..."
1607-
if df.main_code and len(df.main_code) > 100
1608-
else df.main_code, # Truncate for list view
1606+
"main_code": (
1607+
df.main_code[:100] + "..."
1608+
if df.main_code and len(df.main_code) > 100
1609+
else df.main_code
1610+
), # Truncate for list view
16091611
}
16101612
)
16111613

bases/rsptx/book_server_api/routers/personalized_parsons/generate_parsons_blocks.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ def generate_partial_Parsons(
204204
blocks = fixed_lines + unchanged_lines + matched_fixed_lines
205205
for fixed_line_key in distractor_tuple_dict.keys():
206206
blocks = [
207-
(line[0], line[1], line[2].rstrip() + " #matched-fixed\n")
208-
if line[2].strip() == fixed_line_key[2].strip()
209-
else (line[0], line[1], line[2])
207+
(
208+
(line[0], line[1], line[2].rstrip() + " #matched-fixed\n")
209+
if line[2].strip() == fixed_line_key[2].strip()
210+
else (line[0], line[1], line[2])
211+
)
210212
for line in blocks
211213
]
212214
fixed_line_code = fixed_line_key[2]

components/rsptx/build_tools/build.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,9 @@ def wheel(config):
431431

432432
res = subprocess.run(lock_opts, capture_output=True)
433433
if res.returncode != 0:
434-
status[
435-
proj
436-
] = f"[red]Fail[/red] probable dependency conflict see {projdir}/build.log"
434+
status[proj] = (
435+
f"[red]Fail[/red] probable dependency conflict see {projdir}/build.log"
436+
)
437437
lt.update(generate_wheel_table(status))
438438
if config.verbose:
439439
console.print(

components/rsptx/lti1p3/pylti1p3/tool_config/abstract.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ def check_iss_has_many_clients(self, iss: str) -> bool:
3939
return iss_type == IssuerToClientRelation.MANY_CLIENTS_IDS_PER_ISSUER
4040

4141
def set_iss_has_one_client(self, iss: str):
42-
self.issuers_relation_types[
43-
iss
44-
] = IssuerToClientRelation.ONE_CLIENT_ID_PER_ISSUER
42+
self.issuers_relation_types[iss] = (
43+
IssuerToClientRelation.ONE_CLIENT_ID_PER_ISSUER
44+
)
4545

4646
def set_iss_has_many_clients(self, iss: str):
47-
self.issuers_relation_types[
48-
iss
49-
] = IssuerToClientRelation.MANY_CLIENTS_IDS_PER_ISSUER
47+
self.issuers_relation_types[iss] = (
48+
IssuerToClientRelation.MANY_CLIENTS_IDS_PER_ISSUER
49+
)
5050

5151
async def find_registration(self, iss: str, *args, **kwargs) -> Registration:
5252
"""

0 commit comments

Comments
 (0)