initial project
This commit is contained in:
4
data/dummy/batch_codes/25/batches.csv
Normal file
4
data/dummy/batch_codes/25/batches.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
batch_code,department,program,session
|
||||
25021519,CS,BSCS,25
|
||||
25021520,CS,BSSE,25
|
||||
25031519,EE,BSEE,25
|
||||
|
4
data/dummy/batch_codes/26/batches.csv
Normal file
4
data/dummy/batch_codes/26/batches.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
batch_code,department,program,session
|
||||
26021519,CS,BSCS,26
|
||||
26021520,CS,BSSE,26
|
||||
26031519,EE,BSEE,26
|
||||
|
2
data/dummy/blocks/blocks.csv
Normal file
2
data/dummy/blocks/blocks.csv
Normal file
@@ -0,0 +1,2 @@
|
||||
block_id,block_name
|
||||
A,Block A
|
||||
|
7
data/dummy/blocks/rooms.csv
Normal file
7
data/dummy/blocks/rooms.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
room_id,room_name,block_id,room_type,capacity
|
||||
A-101,Room 101,A,classroom,60
|
||||
A-102,Room 102,A,classroom,60
|
||||
A-103,Room 103,A,classroom,50
|
||||
A-201,Room 201,A,classroom,60
|
||||
A-L01,Computer Lab 1,A,lab,35
|
||||
A-L02,Computer Lab 2,A,lab,35
|
||||
|
25
data/dummy/courses/course_offering.csv
Normal file
25
data/dummy/courses/course_offering.csv
Normal file
@@ -0,0 +1,25 @@
|
||||
course_id,batch_code,instructor_code
|
||||
CS101,25021519,1001
|
||||
CS102,25021519,1001
|
||||
CS201,25021519,1002
|
||||
CS202,25021519,1002
|
||||
CS101,25021520,1001
|
||||
CS102,25021520,1001
|
||||
CS201,25021520,1002
|
||||
CS202,25021520,1002
|
||||
EE101,25031519,1004
|
||||
EE102,25031519,1004
|
||||
CS101,26021519,1001
|
||||
CS102,26021519,1001
|
||||
CS201,26021519,1002
|
||||
CS202,26021519,1002
|
||||
CS101,26021520,1001
|
||||
CS102,26021520,1001
|
||||
CS201,26021520,1002
|
||||
CS202,26021520,1002
|
||||
EE101,26031519,1004
|
||||
EE102,26031519,1004
|
||||
GEN101,25021519|25021520|25031519,1002
|
||||
GEN102,25021519|25021520|25031519,1006
|
||||
GEN101,26021519|26021520|26031519,1002
|
||||
GEN102,26021519|26021520|26031519,1006
|
||||
|
9
data/dummy/courses/courses.csv
Normal file
9
data/dummy/courses/courses.csv
Normal file
@@ -0,0 +1,9 @@
|
||||
course_id,course_name,course_type,credit_hours,is_general
|
||||
CS101,Programming Fundamentals,theory,3,no
|
||||
CS102,Programming Fundamentals Lab,lab,1,no
|
||||
CS201,Data Structures,theory,3,no
|
||||
CS202,Data Structures Lab,lab,1,no
|
||||
EE101,Basic Electronics,theory,3,no
|
||||
EE102,Basic Electronics Lab,lab,1,no
|
||||
GEN101,Functional English,theory,3,yes
|
||||
GEN102,Islamic Studies,theory,2,yes
|
||||
|
160
data/dummy/generate_dummy_data.py
Normal file
160
data/dummy/generate_dummy_data.py
Normal file
@@ -0,0 +1,160 @@
|
||||
"""
|
||||
Generates small illustrative dummy CSV datasets under data/dummy/ so the
|
||||
timetable template generator has something to schedule and render.
|
||||
|
||||
Run once:
|
||||
python data/dummy/generate_dummy_data.py
|
||||
"""
|
||||
|
||||
import csv
|
||||
import os
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def write_csv(relative_path, header, rows):
|
||||
path = os.path.join(BASE_DIR, relative_path)
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
with open(path, "w", newline="", encoding="utf-8") as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(header)
|
||||
writer.writerows(rows)
|
||||
print(f"wrote {len(rows)} rows -> {path}")
|
||||
|
||||
|
||||
def main():
|
||||
# ---- blocks & rooms (Building/Block A only) ----
|
||||
write_csv(
|
||||
"blocks/blocks.csv",
|
||||
["block_id", "block_name"],
|
||||
[["A", "Block A"]],
|
||||
)
|
||||
|
||||
write_csv(
|
||||
"blocks/rooms.csv",
|
||||
["room_id", "room_name", "block_id", "room_type", "capacity"],
|
||||
[
|
||||
["A-101", "Room 101", "A", "classroom", 60],
|
||||
["A-102", "Room 102", "A", "classroom", 60],
|
||||
["A-103", "Room 103", "A", "classroom", 50],
|
||||
["A-201", "Room 201", "A", "classroom", 60],
|
||||
["A-L01", "Computer Lab 1", "A", "lab", 35],
|
||||
["A-L02", "Computer Lab 2", "A", "lab", 35],
|
||||
],
|
||||
)
|
||||
|
||||
# ---- departments / programs / batches ----
|
||||
# batch_code = session(2) + program_id(6) e.g. 25021519
|
||||
batches_25 = [
|
||||
["25021519", "CS", "BSCS", "25"],
|
||||
["25021520", "CS", "BSSE", "25"],
|
||||
["25031519", "EE", "BSEE", "25"],
|
||||
]
|
||||
batches_26 = [
|
||||
["26021519", "CS", "BSCS", "26"],
|
||||
["26021520", "CS", "BSSE", "26"],
|
||||
["26031519", "EE", "BSEE", "26"],
|
||||
]
|
||||
|
||||
write_csv(
|
||||
"batch_codes/25/batches.csv",
|
||||
["batch_code", "department", "program", "session"],
|
||||
batches_25,
|
||||
)
|
||||
write_csv(
|
||||
"batch_codes/26/batches.csv",
|
||||
["batch_code", "department", "program", "session"],
|
||||
batches_26,
|
||||
)
|
||||
|
||||
all_batches = batches_25 + batches_26
|
||||
|
||||
# ---- instructors (4-digit employee codes) ----
|
||||
instructors = [
|
||||
["1001", "Dr. Ahsan Raza", "CS"],
|
||||
["1002", "Ms. Sana Tariq", "CS"],
|
||||
["1003", "Mr. Bilal Khan", "CS"],
|
||||
["1004", "Dr. Farah Iqbal", "EE"],
|
||||
["1005", "Mr. Usman Ali", "EE"],
|
||||
["1006", "Ms. Hira Shah", "CS"],
|
||||
]
|
||||
write_csv(
|
||||
"instructor/instructors.csv",
|
||||
["instructor_code", "instructor_name", "department"],
|
||||
instructors,
|
||||
)
|
||||
|
||||
# ---- courses ----
|
||||
# is_general courses are shared across all batches of the same session
|
||||
# (so they can be scheduled together on Tuesday with no clash).
|
||||
courses = [
|
||||
["CS101", "Programming Fundamentals", "theory", 3, "no"],
|
||||
["CS102", "Programming Fundamentals Lab", "lab", 1, "no"],
|
||||
["CS201", "Data Structures", "theory", 3, "no"],
|
||||
["CS202", "Data Structures Lab", "lab", 1, "no"],
|
||||
["EE101", "Basic Electronics", "theory", 3, "no"],
|
||||
["EE102", "Basic Electronics Lab", "lab", 1, "no"],
|
||||
["GEN101", "Functional English", "theory", 3, "yes"],
|
||||
["GEN102", "Islamic Studies", "theory", 2, "yes"],
|
||||
]
|
||||
write_csv(
|
||||
"courses/courses.csv",
|
||||
["course_id", "course_name", "course_type", "credit_hours", "is_general"],
|
||||
courses,
|
||||
)
|
||||
|
||||
# ---- course offerings: which course is taught to which batch, by whom ----
|
||||
# General courses (GEN101/GEN102) are offered once per session (25/26)
|
||||
# and shared across every batch in that session.
|
||||
offerings = []
|
||||
|
||||
dept_theory_lab = {
|
||||
"CS": [("CS101", "CS102"), ("CS201", "CS202")],
|
||||
"EE": [("EE101", "EE102")],
|
||||
}
|
||||
dept_instructors = {
|
||||
"CS": ["1001", "1002", "1003", "1006"],
|
||||
"EE": ["1004", "1005"],
|
||||
}
|
||||
|
||||
for batch_code, department, program, session in all_batches:
|
||||
pairs = dept_theory_lab[department]
|
||||
instr_pool = dept_instructors[department]
|
||||
for i, (theory_id, lab_id) in enumerate(pairs):
|
||||
instr = instr_pool[i % len(instr_pool)]
|
||||
offerings.append([theory_id, batch_code, instr])
|
||||
offerings.append([lab_id, batch_code, instr])
|
||||
|
||||
# general courses: one offering per (course, session), batch_group lists
|
||||
# every batch code sharing that session, separated by "|"
|
||||
for session, batch_group in (
|
||||
("25", [b[0] for b in batches_25]),
|
||||
("26", [b[0] for b in batches_26]),
|
||||
):
|
||||
offerings.append(["GEN101", "|".join(batch_group), "1002"])
|
||||
offerings.append(["GEN102", "|".join(batch_group), "1006"])
|
||||
|
||||
write_csv(
|
||||
"courses/course_offering.csv",
|
||||
["course_id", "batch_code", "instructor_code"],
|
||||
offerings,
|
||||
)
|
||||
|
||||
# ---- students (roll_no = batch_code-seq) ----
|
||||
students = []
|
||||
for batch_code, department, program, session in all_batches:
|
||||
for seq in range(1, 6): # 5 sample students per batch
|
||||
roll_no = f"{batch_code}-{seq:03d}"
|
||||
students.append([roll_no, batch_code, f"Student {roll_no}"])
|
||||
|
||||
write_csv(
|
||||
"roll_no/students.csv",
|
||||
["roll_no", "batch_code", "student_name"],
|
||||
students,
|
||||
)
|
||||
|
||||
print("\nDummy data generation complete.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
7
data/dummy/instructor/instructors.csv
Normal file
7
data/dummy/instructor/instructors.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
instructor_code,instructor_name,department
|
||||
1001,Dr. Ahsan Raza,CS
|
||||
1002,Ms. Sana Tariq,CS
|
||||
1003,Mr. Bilal Khan,CS
|
||||
1004,Dr. Farah Iqbal,EE
|
||||
1005,Mr. Usman Ali,EE
|
||||
1006,Ms. Hira Shah,CS
|
||||
|
31
data/dummy/roll_no/students.csv
Normal file
31
data/dummy/roll_no/students.csv
Normal file
@@ -0,0 +1,31 @@
|
||||
roll_no,batch_code,student_name
|
||||
25021519-001,25021519,Student 25021519-001
|
||||
25021519-002,25021519,Student 25021519-002
|
||||
25021519-003,25021519,Student 25021519-003
|
||||
25021519-004,25021519,Student 25021519-004
|
||||
25021519-005,25021519,Student 25021519-005
|
||||
25021520-001,25021520,Student 25021520-001
|
||||
25021520-002,25021520,Student 25021520-002
|
||||
25021520-003,25021520,Student 25021520-003
|
||||
25021520-004,25021520,Student 25021520-004
|
||||
25021520-005,25021520,Student 25021520-005
|
||||
25031519-001,25031519,Student 25031519-001
|
||||
25031519-002,25031519,Student 25031519-002
|
||||
25031519-003,25031519,Student 25031519-003
|
||||
25031519-004,25031519,Student 25031519-004
|
||||
25031519-005,25031519,Student 25031519-005
|
||||
26021519-001,26021519,Student 26021519-001
|
||||
26021519-002,26021519,Student 26021519-002
|
||||
26021519-003,26021519,Student 26021519-003
|
||||
26021519-004,26021519,Student 26021519-004
|
||||
26021519-005,26021519,Student 26021519-005
|
||||
26021520-001,26021520,Student 26021520-001
|
||||
26021520-002,26021520,Student 26021520-002
|
||||
26021520-003,26021520,Student 26021520-003
|
||||
26021520-004,26021520,Student 26021520-004
|
||||
26021520-005,26021520,Student 26021520-005
|
||||
26031519-001,26031519,Student 26031519-001
|
||||
26031519-002,26031519,Student 26031519-002
|
||||
26031519-003,26031519,Student 26031519-003
|
||||
26031519-004,26031519,Student 26031519-004
|
||||
26031519-005,26031519,Student 26031519-005
|
||||
|
Reference in New Issue
Block a user