# Path: cellpy/parameters/prms.py
# class CellPyConfig:
# class PathsClass(CellPyConfig):
# class FileNamesClass(CellPyConfig):
# class ReaderClass(CellPyConfig):
# class DataSetClass(CellPyConfig):
# class DbClass(CellPyConfig):
# class DbColsClass(CellPyConfig):
# class MaterialsClass(CellPyConfig):
# class BatchClass(CellPyConfig):
# class InstrumentsClass(CellPyConfig):


import logging
import os
import pathlib
import re
import tempfile
import time
import warnings
import numpy as np
import pandas as pd
from dataclasses import asdict
from datetime import datetime
from cellpy.parameters import prms
    from cellpy import log, prms


# logger = logging.getLogger(__name__)


class DbSheetCols(object):
    def __init__(self, level=0):
        db_cols_from_prms = asdict(prms.DbCols)
        for table_key, values in db_cols_from_prms.items():
            setattr(self, table_key, values[level])

    def __repr__(self):
        return f"<DbCols: {self.__dict__}>"


class Reader(object):
    def __init__(
        self, db_file=None, db_datadir=None, db_datadir_processed=None, db_frame=None
    ):
        """Simple excel reader.

        Args:
            db_file (str, pathlib.Path): xlsx-file to read.
            db_datadir(str, pathlib.Path): path where raw date is located.
            db_datadir_processed (str, pathlib.Path): path where cellpy files are located.
            db_frame (pandas.DataFrame): use this instead of reading from xlsx-file.
        """

        self.db_sheet_table = prms.Db.db_table_name
        self.db_header_row = prms.Db.db_header_row

# Path: cellpy/parameters/prms.py
# class CellPyConfig:
# class PathsClass(CellPyConfig):
# class FileNamesClass(CellPyConfig):
# class ReaderClass(CellPyConfig):
# class DataSetClass(CellPyConfig):
# class DbClass(CellPyConfig):
# class DbColsClass(CellPyConfig):
# class MaterialsClass(CellPyConfig):
# class BatchClass(CellPyConfig):
# class InstrumentsClass(CellPyConfig):


# Path: cellpy/readers/dbreader.py
import logging
import os
import pathlib
import re
import tempfile
import time
import warnings
import numpy as np
import pandas as pd
from dataclasses import asdict
from datetime import datetime
from cellpy.parameters import prms
    from cellpy import log, prms



# logger = logging.getLogger(__name__)


class DbSheetCols(object):
    def __init__(self, level=0):
        db_cols_from_prms = asdict(prms.DbCols)
        for table_key, values in db_cols_from_prms.items():
            setattr(self, table_key, values[level])

    def __repr__(self):
        return f"<DbCols: {self.__dict__}>"


class Reader(object):
    def __init__(
        self, db_file=None, db_datadir=None, db_datadir_processed=None, db_frame=None
    ):
        """Simple excel reader.

        Args:
            db_file (str, pathlib.Path): xlsx-file to read.
            db_datadir(str, pathlib.Path): path where raw date is located.
            db_datadir_processed (str, pathlib.Path): path where cellpy files are located.
            db_frame (pandas.DataFrame): use this instead of reading from xlsx-file.
        """

        self.db_sheet_table = prms.Db.db_table_name
        self.db_header_row = prms.Db.db_header_row

        self.db_unit_row = prms.Db.db_unit_row