File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from common .csvreader import read_csv
2+ import sys
3+
4+ def main ():
5+ architecture , budgets , tasks = read_csv ()
6+
7+
8+
9+
10+ if __name__ == "__main__" :
11+ main ()
Original file line number Diff line number Diff line change 11import pandas as pd
22import os
3+ import sys
34
45from common .architecture import Architecture
56from common .budget import Budget
@@ -69,6 +70,35 @@ def read_tasks(csv:str)-> list[Task]:
6970
7071 return tasks
7172
73+ def read_csv () -> tuple [list [Architecture ], list [Budget ], list [Task ]]:
74+ if len (sys .argv ) != 4 :
75+ print ("Usage: python analysis.py <architecture.csv> <budget.csv> <tasks.csv>" )
76+ sys .exit (1 )
77+
78+ architecture_file = sys .argv [1 ]
79+ budget_file = sys .argv [2 ]
80+ tasks_file = sys .argv [3 ]
81+
82+ try :
83+ architectures = read_architectures (architecture_file )
84+ budgets = read_budgets (budget_file )
85+ tasks = read_tasks (tasks_file )
86+
87+ print (f"Successfully read architectures: { architectures } " )
88+ print (f"Successfully read budgets: { budgets } " )
89+ print (f"Successfully read tasks: { tasks } " )
90+
91+ # Add your analysis code here
92+
93+ except FileNotFoundError as e :
94+ print (f"Error: File not found - { e } " )
95+ sys .exit (1 )
96+ except Exception as e :
97+ print (f"Error processing files: { e } " )
98+ sys .exit (1 )
99+
100+ return architectures , budgets , tasks
101+
72102def _get_csv_path (csv :str ) -> str :
73103 if os .path .exists (csv ):
74104 return csv
You can’t perform that action at this time.
0 commit comments