mnds18/agentic-ts-forecasting-system
0
1"""2project_manager_agent.py3Project Manager Agent to build CSV plan and Gantt chart4"""5 6import pandas as pd7import matplotlib.pyplot as plt8import os9from datetime import datetime, timedelta10from agents.orchestration_agent import agent_logger11 12@agent_logger("PM", "Generate Plan and Gantt")13def generate_plan_and_gantt():14 plan = pd.DataFrame([15 ("Requirement Gathering", "BA", 2, "2025-04-01", "2025-04-02", "Complete"),16 ("Data Generation", "DS", 1, "2025-04-03", "2025-04-03", "Complete"),17 ("Model Training", "DS", 2, "2025-04-04", "2025-04-05", "Complete"),18 ("Peer Review", "QA", 1, "2025-04-06", "2025-04-06", "Complete"),19 ("Documentation", "BA", 1, "2025-04-07", "2025-04-07", "Complete"),20 ("API Setup", "MLOps", 1, "2025-04-08", "2025-04-08", "Pending"),21 ("Gantt Chart", "PM", 1, "2025-04-09", "2025-04-09", "Pending"),22 ("Slides Prep", "BA", 1, "2025-04-10", "2025-04-10", "Pending"),23 ("Streamlit UI", "DS", 2, "2025-04-11", "2025-04-12", "Pending"),24 ("Dockerization", "MLOps", 2, "2025-04-13", "2025-04-14", "Pending")25 ], columns=["Task", "Owner", "Effort (hrs)", "Start", "Due", "Status"])26 27 os.makedirs("outputs", exist_ok=True)28 plan.to_csv("outputs/project_plan.csv", index=False)29 30 fig, ax = plt.subplots(figsize=(10, 4))31 for idx, row in plan.iterrows():32 ax.barh(row["Task"], pd.to_datetime(row["Due"]) - pd.to_datetime(row["Start"]), left=pd.to_datetime(row["Start"]))33 ax.set_title("๐ Gantt Chart: Project Timeline")34 ax.set_xlabel("Timeline")35 plt.tight_layout()36 plt.savefig("outputs/project_gantt.png")37 return plan38 39 40 