more chnages

This commit is contained in:
Talhadeveloperr
2026-09-09 17:07:11 +05:00
parent a7bb2f3dae
commit 1c5b8f38c8
57 changed files with 147 additions and 31 deletions

View File

@@ -25,6 +25,7 @@ from template_controller import build_schedule # noqa: E402
from conflict_checker import check_all_conflicts # noqa: E402
from conflict_checker.student_conflict_checker import format_student_conflicts # noqa: E402
from conflict_checker.teacher_conflict_checker import format_teacher_conflicts # noqa: E402
from template_logger import reset_log, log_error, log_info # noqa: E402
from batch_wise_template import generate_batch_wise_templates # noqa: E402
from department_wise_template import generate_department_wise_templates # noqa: E402
@@ -36,6 +37,8 @@ RESULT_DIR = os.path.join(ROOT_DIR, "result", "templates")
def main():
reset_log()
data_csv_marker = os.path.join(ROOT_DIR, "data", "dummy", "blocks", "rooms.csv")
if not os.path.exists(data_csv_marker):
print("Dummy data not found — generating it first...")
@@ -48,19 +51,19 @@ def main():
data, sessions = build_schedule()
print(f"Scheduled {len(sessions)} sessions.\n")
print("Running conflict checks (student/batch and teacher)...")
log_info("Running conflict checks (student/batch and teacher)...")
report = check_all_conflicts(sessions)
if report["has_conflicts"]:
for line in format_student_conflicts(report["student_conflicts"]):
print(f" STUDENT CONFLICT: {line}")
log_error(f"STUDENT CONFLICT: {line}")
for line in format_teacher_conflicts(report["teacher_conflicts"]):
print(f" TEACHER CONFLICT: {line}")
print(
log_error(f"TEACHER CONFLICT: {line}")
log_error(
f"Found {len(report['student_conflicts'])} student conflict(s) and "
f"{len(report['teacher_conflicts'])} teacher conflict(s).\n"
f"{len(report['teacher_conflicts'])} teacher conflict(s)."
)
else:
print("No conflicts found — schedule is clash-free for students and teachers.\n")
log_info("No conflicts found — schedule is clash-free for students and teachers.")
generators = [
("batch-wise", generate_batch_wise_templates),