diff --git a/src/analysis.py b/src/analysis.py index e69de29..a3833a5 100644 --- a/src/analysis.py +++ b/src/analysis.py @@ -0,0 +1,11 @@ +from common.csvreader import read_csv +import sys + +def main(): + architecture, budgets, tasks = read_csv() + + + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/src/common/csvreader.py b/src/common/csvreader.py index a5437f4..9b389fb 100644 --- a/src/common/csvreader.py +++ b/src/common/csvreader.py @@ -1,5 +1,6 @@ import pandas as pd import os +import sys from common.architecture import Architecture from common.budget import Budget @@ -69,6 +70,35 @@ def read_tasks(csv:str)-> list[Task]: return tasks +def read_csv() -> tuple[list[Architecture], list[Budget], list[Task]]: + if len(sys.argv) != 4: + print("Usage: python analysis.py ") + sys.exit(1) + + architecture_file = sys.argv[1] + budget_file = sys.argv[2] + tasks_file = sys.argv[3] + + try: + architectures = read_architectures(architecture_file) + budgets = read_budgets(budget_file) + tasks = read_tasks(tasks_file) + + print(f"Successfully read architectures: {architectures}") + print(f"Successfully read budgets: {budgets}") + print(f"Successfully read tasks: {tasks}") + + # Add your analysis code here + + except FileNotFoundError as e: + print(f"Error: File not found - {e}") + sys.exit(1) + except Exception as e: + print(f"Error processing files: {e}") + sys.exit(1) + + return architectures, budgets, tasks + def _get_csv_path(csv:str) -> str: if os.path.exists(csv): return csv