Upload app.py
Browse files
app.py
CHANGED
|
@@ -207,8 +207,8 @@ def simulate_stepwise_report(cleaned: pd.DataFrame, capacities: Dict[str, int])
|
|
| 207 |
|
| 208 |
mr = max_rank_in(cleaned)
|
| 209 |
lines = []
|
| 210 |
-
lines.append(f"### Total Students (จำนวนนักศึกษาทั้งหมด): {total_students}
|
| 211 |
-
lines.append(f"### Total Capacity (ความจุรวม): {sum(cap.values())}
|
| 212 |
lines.append("")
|
| 213 |
|
| 214 |
for r in range(1, mr + 1):
|
|
@@ -243,7 +243,7 @@ def simulate_stepwise_report(cleaned: pd.DataFrame, capacities: Dict[str, int])
|
|
| 243 |
|
| 244 |
chosen_names = cleaned.loc[chosen, "NAME"].astype(str).tolist()
|
| 245 |
sample = ", ".join(chosen_names[:10]) + ("..." if len(chosen_names) > 10 else "")
|
| 246 |
-
lines.append(f"- {ward_display(w)}
|
| 247 |
|
| 248 |
# After assignment at this rank
|
| 249 |
lines.append("")
|
|
@@ -492,7 +492,7 @@ with gr.Blocks(title=APP_TITLE) as demo:
|
|
| 492 |
med_num, med1_num, med2_num, surg_num, ped_num, comm_num, psy_num, obs_num])
|
| 493 |
|
| 494 |
# >>> Moved CLEAN button here (before reports) <<<
|
| 495 |
-
clean_btn = gr.Button("Clean data (ดูพรีวิว)", variant="
|
| 496 |
|
| 497 |
preview = gr.Dataframe(label="Cleaned preview (first 30 rows)", visible=True)
|
| 498 |
cleaned_file = gr.File(label="Download cleaned.csv")
|
|
@@ -504,7 +504,7 @@ with gr.Blocks(title=APP_TITLE) as demo:
|
|
| 504 |
outputs=[status, preview, cleaned_file, gr.State()]
|
| 505 |
)
|
| 506 |
|
| 507 |
-
assign_btn = gr.Button("Assign (สุ่มตามลำดับอันดับ)")
|
| 508 |
assigned_preview = gr.Dataframe(label="Assigned preview (first 30 rows)")
|
| 509 |
assigned_file = gr.File(label="Download assigned.csv")
|
| 510 |
not_assigned_file = gr.File(label="Download not_assigned.csv")
|
|
|
|
| 207 |
|
| 208 |
mr = max_rank_in(cleaned)
|
| 209 |
lines = []
|
| 210 |
+
lines.append(f"### Total Students (จำนวนนักศึกษาทั้งหมด): {total_students}")
|
| 211 |
+
lines.append(f"### Total Capacity (ความจุรวม): {sum(cap.values())}")
|
| 212 |
lines.append("")
|
| 213 |
|
| 214 |
for r in range(1, mr + 1):
|
|
|
|
| 243 |
|
| 244 |
chosen_names = cleaned.loc[chosen, "NAME"].astype(str).tolist()
|
| 245 |
sample = ", ".join(chosen_names[:10]) + ("..." if len(chosen_names) > 10 else "")
|
| 246 |
+
lines.append(f"- {ward_display(w)} : {len(chosen_names)} | {sample}")
|
| 247 |
|
| 248 |
# After assignment at this rank
|
| 249 |
lines.append("")
|
|
|
|
| 492 |
med_num, med1_num, med2_num, surg_num, ped_num, comm_num, psy_num, obs_num])
|
| 493 |
|
| 494 |
# >>> Moved CLEAN button here (before reports) <<<
|
| 495 |
+
clean_btn = gr.Button("Clean data (ดูพรีวิว)", variant="secondary")
|
| 496 |
|
| 497 |
preview = gr.Dataframe(label="Cleaned preview (first 30 rows)", visible=True)
|
| 498 |
cleaned_file = gr.File(label="Download cleaned.csv")
|
|
|
|
| 504 |
outputs=[status, preview, cleaned_file, gr.State()]
|
| 505 |
)
|
| 506 |
|
| 507 |
+
assign_btn = gr.Button("Assign (สุ่มตามลำดับอันดับ)", variant="primary")
|
| 508 |
assigned_preview = gr.Dataframe(label="Assigned preview (first 30 rows)")
|
| 509 |
assigned_file = gr.File(label="Download assigned.csv")
|
| 510 |
not_assigned_file = gr.File(label="Download not_assigned.csv")
|