# Path: cellpy/exceptions.py
# class ConfigFileNotRead(Error):
#     """Raised when the configuration file cannot be read"""
# 
#     pass
# 
# class ConfigFileNotWritten(Error):
#     """Raised when the configuration file cannot be written"""
# 
#     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):


import getpass
import glob
import logging
import os
import pathlib
import sys
import warnings
import box
import ruamel
from collections import OrderedDict
from dataclasses import asdict, dataclass
from pprint import pprint
from ruamel.yaml import YAML
from cellpy.exceptions import ConfigFileNotRead, ConfigFileNotWritten
from cellpy.parameters import prms
        "Instruments": _convert_instruments_to_dict(prms.Instruments),
        "Batch": _convert_to_dict(prms.Batch),
    }
    return config_dict


def _read_prm_file(prm_filename):
    """read the prm file"""
    logging.debug("Reading config-file: %s" % prm_filename)
    try:
        with open(prm_filename, "r") as config_file:
            prm_dict = yaml.load(config_file)

    except yaml.YAMLError as e:
        raise ConfigFileNotRead from e
    else:
        if isinstance(prm_dict, dict):
            _update_prms(prm_dict)
        else:
            print(type(prm_dict))


def _read_prm_file_without_updating(prm_filename):
    """read the prm file but do not update the params"""
    logging.debug("Reading config-file: %s" % prm_filename)
    try:
        with open(prm_filename, "r") as config_file:
            prm_dict = yaml.load(config_file)

    except yaml.YAMLError as e:

# Path: cellpy/exceptions.py
# class ConfigFileNotRead(Error):
#     """Raised when the configuration file cannot be read"""
# 
#     pass
# 
# class ConfigFileNotWritten(Error):
#     """Raised when the configuration file cannot be written"""
# 
#     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/prmreader.py
import getpass
import glob
import logging
import os
import pathlib
import sys
import warnings
import box
import ruamel
from collections import OrderedDict
from dataclasses import asdict, dataclass
from pprint import pprint
from ruamel.yaml import YAML
from cellpy.exceptions import ConfigFileNotRead, ConfigFileNotWritten
from cellpy.parameters import prms

        "Instruments": _convert_instruments_to_dict(prms.Instruments),
        "Batch": _convert_to_dict(prms.Batch),
    }
    return config_dict


def _read_prm_file(prm_filename):
    """read the prm file"""
    logging.debug("Reading config-file: %s" % prm_filename)
    try:
        with open(prm_filename, "r") as config_file:
            prm_dict = yaml.load(config_file)

    except yaml.YAMLError as e:
        raise ConfigFileNotRead from e
    else:
        if isinstance(prm_dict, dict):
            _update_prms(prm_dict)
        else:
            print(type(prm_dict))


def _read_prm_file_without_updating(prm_filename):
    """read the prm file but do not update the params"""
    logging.debug("Reading config-file: %s" % prm_filename)
    try:
        with open(prm_filename, "r") as config_file:
            prm_dict = yaml.load(config_file)

    except yaml.YAMLError as e:

        raise ConfigFileNotRead from e