diff --git a/src/utilities/files/simulation_data_types/base_data_simulation_handler.py b/src/utilities/files/simulation_data_types/base_data_simulation_handler.py index e2b02aa..15670d6 100644 --- a/src/utilities/files/simulation_data_types/base_data_simulation_handler.py +++ b/src/utilities/files/simulation_data_types/base_data_simulation_handler.py @@ -1,16 +1,11 @@ +# Python Imports import abc from abc import ABC +import polars as pl class BaseDataSimulationHandler(ABC): - def __init__(self): - self._data = None - @abc.abstractmethod - def load_data(self, path): - pass - - @abc.abstractmethod - def convert_into_dataframe(self): + def load_data(self, path: str) -> pl.DataFrame: pass diff --git a/src/utilities/files/simulation_data_types/csv_data_simulation_handler.py b/src/utilities/files/simulation_data_types/csv_data_simulation_handler.py index 80ec474..474ba94 100644 --- a/src/utilities/files/simulation_data_types/csv_data_simulation_handler.py +++ b/src/utilities/files/simulation_data_types/csv_data_simulation_handler.py @@ -1,10 +1,14 @@ +# Python Imports +import polars as pl + +# Project Imports from src.utilities.files.simulation_data_types.base_data_simulation_handler import BaseDataSimulationHandler class CsvDataSimulationHandler(BaseDataSimulationHandler): - def load_data(self, path): - pass + def load_data(self, path: str) -> pl.DataFrame: + polars_df = pl.read_csv(path) + + return polars_df - def convert_into_dataframe(self): - pass diff --git a/src/utilities/files/simulation_data_types/json_data_simulation_handler.py b/src/utilities/files/simulation_data_types/json_data_simulation_handler.py index 99b037c..e38054a 100644 --- a/src/utilities/files/simulation_data_types/json_data_simulation_handler.py +++ b/src/utilities/files/simulation_data_types/json_data_simulation_handler.py @@ -1,10 +1,13 @@ +# Python Imports +import polars as pl + +# Project Imports from src.utilities.files.simulation_data_types.base_data_simulation_handler import BaseDataSimulationHandler class JsonDataSimulationHandler(BaseDataSimulationHandler): - def load_data(self, path): - pass + def load_data(self, path: str) -> pl.DataFrame: + polars_df = pl.read_json(path) - def convert_into_dataframe(self): - pass + return polars_df diff --git a/src/utilities/files/simulation_data_types/parquet_simulation_data_handler.py b/src/utilities/files/simulation_data_types/parquet_simulation_data_handler.py index c83dfa6..60b5421 100644 --- a/src/utilities/files/simulation_data_types/parquet_simulation_data_handler.py +++ b/src/utilities/files/simulation_data_types/parquet_simulation_data_handler.py @@ -1,10 +1,13 @@ +# Python Imports +import polars as pl + +# Project Imports from src.utilities.files.simulation_data_types.base_data_simulation_handler import BaseDataSimulationHandler class ParquetDataSimulationHandler(BaseDataSimulationHandler): - def load_data(self, path): - pass + def load_data(self, path: str) -> pl.DataFrame: + polars_df = pl.read_parquet(path) - def convert_into_dataframe(self): - pass + return polars_df