# Path: cellpy/exceptions.py
# class NullData(Error):
#     """Raised when required data is missing (e.g. voltage = None or summary_frames are missing)"""
# 
#     pass
# 
# 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/parameters/internal_settings.py
# class HeaderDict(UserDict):
# class DictLikeClass:
# class BaseSettings(DictLikeClass):
# class InstrumentSettings(DictLikeClass):
# class CellpyUnits(BaseSettings):
# class CellpyLimits(BaseSettings):
# class HeadersNormal(BaseSettings):
# class HeadersSummary(BaseSettings):
# class HeadersStepTable(BaseSettings):
# class HeadersJournal(BaseSettings):
#     def __setitem__(self, key: str, value: str) -> None:
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __missing__(self, key):
#     def _field_names(self):
#     def __iter__(self):
#     def _value_iter(self):
#     def keys(self):
#     def values(self):
#     def items(self):
# def get_headers_summary() -> BaseSettings:
# def get_cellpy_units() -> CellpyUnits:
# def get_headers_normal() -> HeadersNormal:
# def get_headers_step_table() -> HeadersStepTable:
# def get_headers_journal() -> HeadersJournal:
# ATTRS_CELLPYFILE = [
#     "mass",
#     "channel_index",
#     "channel_number",
#     "creator",
#     "cycle_mode",
#     "schedule_file_name",
#     "start_datetime",
#     "test_ID",
#     "cell_no",
#     "name",
#     "nom_cap",
#     "material",
#     "item_ID",
#     "active_electrode_area",
#     "active_electrode_thickness",
#     "electrolyte_type",
#     "electrolyte_volume",
#     "active_electrode_type",
#     "counter_electrode_type",
#     "reference_electrode_type",
#     "experiment_type",
#     "active_electrode_current_collector",
#     "reference_electrode_current_collector",
#     "comment",
# ]
# ATTRS_CELLPYDATA = [
#     "auto_dirs",
#     "capacity_modifiers",
#     "cellpy_datadir",
#     "daniel_number",
#     "ensure_step_table",
#     "file_names",
#     "filestatuschecker",
#     "force_all",
#     "force_step_table_creation",
#     "forced_errors",
#     "limit_loaded_cycles",
#     "load_only_summary",
#     "minimum_selection",
#     "name",
#     "number_of_datasets",
#     "profile",
#     "raw_datadir",
#     "raw_limits",
#     "raw_units",
#     "select_minimal",
#     "selected_cell_number",
#     "selected_scans",
#     "sep",
#     "status_datasets",
#     "summary_exists",
#     "table_names",
#     "tester",
# ]
# ATTRS_DATASET = [
#     "cellpy_file_version",
#     "channel_index",
#     "channel_number",
#     "charge_steps",
#     "creator",
#     "cycle_mode",
#     # "data",
#     "discharge_steps",
#     "file_errors",
#     "ir_steps",
#     "item_ID",
#     "loaded_from",
#     "mass",
#     "mass_given",
#     "material",
#     "merged",
#     "name",
#     "no_cycles",
#     "nom_cap",
#     "ocv_steps",
#     "raw_data_files_length",
#     "raw_limits",
#     "raw_units",
#     "schedule_file_name",
#     "start_datetime",
#     # "summary",
#     "test_ID",
#     "cell_no",
#     "tot_mass",
# ]
# ATTRS_DATASET_DEEP = ["raw_data_files"]


import collections
import datetime
import importlib
import logging
import os
import pickle
import sys
import time
import warnings
import numpy as np
import pandas as pd
        import platform
from functools import wraps
from scipy import interpolate
from cellpy.exceptions import NullData
from cellpy.parameters import prms
from cellpy.parameters.internal_settings import (
    ATTRS_CELLPYFILE,
    cellpy_limits,
    cellpy_units,
    get_headers_normal,
    get_headers_step_table,
    get_headers_summary,
)

        try:
            summary_txt = f"<p><b>summary data-frame (summary)</b><br>{self.summary.describe()._repr_html_()}</p>"
            summary_txt += f"<p><b>summary data-frame (head)</b><br>{self.summary.head()._repr_html_()}</p>"
        except AttributeError:
            summary_txt = "<p><b>summary data-frame </b><br> not found!</p>"
        except ValueError:
            summary_txt = (
                "<p><b>summary data-frame </b><br> does not contain any columns!</p>"
            )

        try:
            steps_txt = f"<p><b>steps data-frame (summary)</b><br>{self.steps.describe()._repr_html_()}</p>"
            steps_txt += f"<p><b>steps data-frame (head)</b><br>{self.steps.head()._repr_html_()}</p>"
        except AttributeError:
            steps_txt = "<p><b>steps data-frame </b><br> not found!</p>"
        except ValueError:
            steps_txt = (
                "<p><b>steps data-frame </b><br> does not contain any columns!</p>"
            )

        return obj + txt + summary_txt + steps_txt + raw_txt

    def __init__(self, **kwargs):
        self.logger = logging.getLogger(__name__)
        self.logger.debug("created DataSet instance")

        # meta-data
        self.cell_no = None
        self.mass = prms.Materials.default_mass  # active material (in mg)

# Path: cellpy/exceptions.py
# class NullData(Error):
#     """Raised when required data is missing (e.g. voltage = None or summary_frames are missing)"""
# 
#     pass
# 
# 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/parameters/internal_settings.py
# class HeaderDict(UserDict):
# class DictLikeClass:
# class BaseSettings(DictLikeClass):
# class InstrumentSettings(DictLikeClass):
# class CellpyUnits(BaseSettings):
# class CellpyLimits(BaseSettings):
# class HeadersNormal(BaseSettings):
# class HeadersSummary(BaseSettings):
# class HeadersStepTable(BaseSettings):
# class HeadersJournal(BaseSettings):
#     def __setitem__(self, key: str, value: str) -> None:
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __missing__(self, key):
#     def _field_names(self):
#     def __iter__(self):
#     def _value_iter(self):
#     def keys(self):
#     def values(self):
#     def items(self):
# def get_headers_summary() -> BaseSettings:
# def get_cellpy_units() -> CellpyUnits:
# def get_headers_normal() -> HeadersNormal:
# def get_headers_step_table() -> HeadersStepTable:
# def get_headers_journal() -> HeadersJournal:
# ATTRS_CELLPYFILE = [
#     "mass",
#     "channel_index",
#     "channel_number",
#     "creator",
#     "cycle_mode",
#     "schedule_file_name",
#     "start_datetime",
#     "test_ID",
#     "cell_no",
#     "name",
#     "nom_cap",
#     "material",
#     "item_ID",
#     "active_electrode_area",
#     "active_electrode_thickness",
#     "electrolyte_type",
#     "electrolyte_volume",
#     "active_electrode_type",
#     "counter_electrode_type",
#     "reference_electrode_type",
#     "experiment_type",
#     "active_electrode_current_collector",
#     "reference_electrode_current_collector",
#     "comment",
# ]
# ATTRS_CELLPYDATA = [
#     "auto_dirs",
#     "capacity_modifiers",
#     "cellpy_datadir",
#     "daniel_number",
#     "ensure_step_table",
#     "file_names",
#     "filestatuschecker",
#     "force_all",
#     "force_step_table_creation",
#     "forced_errors",
#     "limit_loaded_cycles",
#     "load_only_summary",
#     "minimum_selection",
#     "name",
#     "number_of_datasets",
#     "profile",
#     "raw_datadir",
#     "raw_limits",
#     "raw_units",
#     "select_minimal",
#     "selected_cell_number",
#     "selected_scans",
#     "sep",
#     "status_datasets",
#     "summary_exists",
#     "table_names",
#     "tester",
# ]
# ATTRS_DATASET = [
#     "cellpy_file_version",
#     "channel_index",
#     "channel_number",
#     "charge_steps",
#     "creator",
#     "cycle_mode",
#     # "data",
#     "discharge_steps",
#     "file_errors",
#     "ir_steps",
#     "item_ID",
#     "loaded_from",
#     "mass",
#     "mass_given",
#     "material",
#     "merged",
#     "name",
#     "no_cycles",
#     "nom_cap",
#     "ocv_steps",
#     "raw_data_files_length",
#     "raw_limits",
#     "raw_units",
#     "schedule_file_name",
#     "start_datetime",
#     # "summary",
#     "test_ID",
#     "cell_no",
#     "tot_mass",
# ]
# ATTRS_DATASET_DEEP = ["raw_data_files"]


# Path: cellpy/readers/core.py
import collections
import datetime
import importlib
import logging
import os
import pickle
import sys
import time
import warnings
import numpy as np
import pandas as pd
        import platform
from functools import wraps
from scipy import interpolate
from cellpy.exceptions import NullData
from cellpy.parameters import prms
from cellpy.parameters.internal_settings import (
    ATTRS_CELLPYFILE,
    cellpy_limits,
    cellpy_units,
    get_headers_normal,
    get_headers_step_table,
    get_headers_summary,
)


        try:
            summary_txt = f"<p><b>summary data-frame (summary)</b><br>{self.summary.describe()._repr_html_()}</p>"
            summary_txt += f"<p><b>summary data-frame (head)</b><br>{self.summary.head()._repr_html_()}</p>"
        except AttributeError:
            summary_txt = "<p><b>summary data-frame </b><br> not found!</p>"
        except ValueError:
            summary_txt = (
                "<p><b>summary data-frame </b><br> does not contain any columns!</p>"
            )

        try:
            steps_txt = f"<p><b>steps data-frame (summary)</b><br>{self.steps.describe()._repr_html_()}</p>"
            steps_txt += f"<p><b>steps data-frame (head)</b><br>{self.steps.head()._repr_html_()}</p>"
        except AttributeError:
            steps_txt = "<p><b>steps data-frame </b><br> not found!</p>"
        except ValueError:
            steps_txt = (
                "<p><b>steps data-frame </b><br> does not contain any columns!</p>"
            )

        return obj + txt + summary_txt + steps_txt + raw_txt

    def __init__(self, **kwargs):
        self.logger = logging.getLogger(__name__)
        self.logger.debug("created DataSet instance")

        # meta-data
        self.cell_no = None
        self.mass = prms.Materials.default_mass  # active material (in mg)

        self.tot_mass = prms.Materials.default_mass  # total material (in mg)