import pandas as pd


class Cary4E:
    """The Agilent Cary 4E UV-Vis Spectrometer."""

    manufacturer = "Agilent"
    """Name of Manufacturer."""

    name = "cary_4e"
    """Name of Instrument Model."""

    # TODO - this should be supported versions of model
    supported_models = ["Cary 4E"]
    """List of supported models."""

    def __init__(self, model, sn=None):
        """
        Args:
            model (str): The model name of the instrument.
            sn (str or int, optional): The serial number of the instrument. Defaults to None.
        """
        self.model = model
        self.sn = sn

    @staticmethod
    def load_eem(filepath):
        """Loads an Excitation Emission Matrix which is generated by the instrument.

        Args:
            filepath (str): The filepath of the data file.

        Raises:
            NotImplementedError: On the TODO list...
        """
        raise NotImplementedError()

    @staticmethod
    def load_absorbance(filepath):
        """Loads an absorbance spectrum which is generated by the instrument.

        Args:
            filepath (str): The filepath of the data file.

        Returns:
            pandas.DataFrame: An absorbance spectrum.
        """
        absorb_df = pd.read_csv(
            filepath,
            sep=",",
            header=None,
            index_col=0,
            names=["wavelength", "absorbance"],
        )
        absorb_df = absorb_df.sort_index()
        absorb_df.index = absorb_df.index.astype("float64")
        return absorb_df

    @staticmethod
    def load_water_raman(filepath):
        """Loads a water Raman spectrum which is generated by the instrument.

        Args:
            filepath (str): The filepath of the data file.

        Raises:
            NotImplementedError: On the TODO list...
        """
        raise NotImplementedError()

    @staticmethod
    def load_spectral_corrections():
        """TODO - Should load instrument specific spectral corrections which will be used in data preprocessing.

        Raises:
            NotImplementedError: On the TODO list...
        """
        raise NotImplementedError()
