# Path: flare/output.py
# def set_logger(
#     name: str, stream: bool, fileout_name: str = None, verbose: str = "info"
# ):
#     """
#     set up a logger with handlers
# 
#     :param name: unique name of the logger in logging module
#     :type name: str
#     :param stream: if True, set up a screen output
#     :type stream: bool
#     :param fileout_name: name for log file
#     :type fileout_name: str
#     :param verbose: verbose level
#     :type verbose: str
#     """
#     logger = logging.getLogger(name)
#     logger.propagate = False
#     logger.handlers = []
#     logger.setLevel(getattr(logging, verbose.upper()))
#     if stream:
#         add_stream(logger, verbose)
#     if fileout_name is not None:
#         add_file(logger, fileout_name, verbose)
#     return logger
# 
# Path: flare/utils/element_coder.py
# def element_to_Z(element: str) -> int:
#     """
#     Returns the atomic number Z associated with an elements 1-2 letter name.
#     Returns the same integer if an integer is passed in.
# 
#     :param element:
#     :return:
#     """
# 
#     if element in _user_element_to_Z:
#         return _user_element_to_Z[element]
# 
#     # If already integer, do nothing
#     if isinstance(element, (int, np.integer)):
#         return element
#     if type(element).__module__ == "numpy" and np.issubdtype(type(element), np.integer):
#         return element
# 
#     # If a string-casted integer, do nothing
#     if isinstance(element, str) and element.isnumeric():
#         return int(element)
# 
#     # Check that a valid element was passed in then return
#     if _element_to_Z.get(element, None) is None:
#         warn(
#             f"Element as specified not found in list of element-Z mappings. "
#             f"If you would like to specify a custom element, use an integer"
#             f" of your choosing instead. Setting element {{element}} to intege"
#             f"r 0"
#         )
#     return _element_to_Z.get(element, 0)
# 
# def Z_to_element(Z: int) -> str:
#     """
#     Maps atomic numbers Z to element name, e.g. 1->"H".
# 
#     :param Z: Atomic number corresponding to element.
#     :return: One or two-letter name of element.
#     """
# 
#     if Z in _user_Z_to_element:
#         return _user_Z_to_element[Z]
# 
#     # Check proper formatting
#     if isinstance(Z, str):
#         if Z.isnumeric():
#             Z = int(Z)
#         else:
#             raise ValueError("Input Z is not a number. It should be an integer")
# 
#     return _Z_to_element[Z]


import inspect
import json
import logging
import math
import numpy as np
import pickle
import time
from copy import deepcopy
from itertools import combinations_with_replacement, permutations
from numpy.random import random
from numpy import array as nparray
from numpy import max as npmax
from typing import List, Callable, Union
from warnings import warn
from sys import stdout
from os import devnull
from flare.output import set_logger
from flare.utils.element_coder import element_to_Z, Z_to_element




class Parameters:
    """"""

    all_kernel_types = ["twobody", "threebody", "manybody"]
    cutoff_types = {"cut3b": "threebody"}
    ndim = {"twobody": 2, "threebody": 3, "manybody": 2, "cut3b": 2}
    n_kernel_parameters = {"twobody": 2, "threebody": 2, "manybody": 2, "cut3b": 0}

    cutoff_types_keys = list(cutoff_types.keys())
    cutoff_types_values = list(cutoff_types.values())


# Path: flare/output.py
# def set_logger(
#     name: str, stream: bool, fileout_name: str = None, verbose: str = "info"
# ):
#     """
#     set up a logger with handlers
# 
#     :param name: unique name of the logger in logging module
#     :type name: str
#     :param stream: if True, set up a screen output
#     :type stream: bool
#     :param fileout_name: name for log file
#     :type fileout_name: str
#     :param verbose: verbose level
#     :type verbose: str
#     """
#     logger = logging.getLogger(name)
#     logger.propagate = False
#     logger.handlers = []
#     logger.setLevel(getattr(logging, verbose.upper()))
#     if stream:
#         add_stream(logger, verbose)
#     if fileout_name is not None:
#         add_file(logger, fileout_name, verbose)
#     return logger
# 
# Path: flare/utils/element_coder.py
# def element_to_Z(element: str) -> int:
#     """
#     Returns the atomic number Z associated with an elements 1-2 letter name.
#     Returns the same integer if an integer is passed in.
# 
#     :param element:
#     :return:
#     """
# 
#     if element in _user_element_to_Z:
#         return _user_element_to_Z[element]
# 
#     # If already integer, do nothing
#     if isinstance(element, (int, np.integer)):
#         return element
#     if type(element).__module__ == "numpy" and np.issubdtype(type(element), np.integer):
#         return element
# 
#     # If a string-casted integer, do nothing
#     if isinstance(element, str) and element.isnumeric():
#         return int(element)
# 
#     # Check that a valid element was passed in then return
#     if _element_to_Z.get(element, None) is None:
#         warn(
#             f"Element as specified not found in list of element-Z mappings. "
#             f"If you would like to specify a custom element, use an integer"
#             f" of your choosing instead. Setting element {{element}} to intege"
#             f"r 0"
#         )
#     return _element_to_Z.get(element, 0)
# 
# def Z_to_element(Z: int) -> str:
#     """
#     Maps atomic numbers Z to element name, e.g. 1->"H".
# 
#     :param Z: Atomic number corresponding to element.
#     :return: One or two-letter name of element.
#     """
# 
#     if Z in _user_Z_to_element:
#         return _user_Z_to_element[Z]
# 
#     # Check proper formatting
#     if isinstance(Z, str):
#         if Z.isnumeric():
#             Z = int(Z)
#         else:
#             raise ValueError("Input Z is not a number. It should be an integer")
# 
#     return _Z_to_element[Z]


# Path: flare/parameters.py
import inspect
import json
import logging
import math
import numpy as np
import pickle
import time
from copy import deepcopy
from itertools import combinations_with_replacement, permutations
from numpy.random import random
from numpy import array as nparray
from numpy import max as npmax
from typing import List, Callable, Union
from warnings import warn
from sys import stdout
from os import devnull
from flare.output import set_logger
from flare.utils.element_coder import element_to_Z, Z_to_element





class Parameters:
    """"""

    all_kernel_types = ["twobody", "threebody", "manybody"]
    cutoff_types = {"cut3b": "threebody"}
    ndim = {"twobody": 2, "threebody": 3, "manybody": 2, "cut3b": 2}
    n_kernel_parameters = {"twobody": 2, "threebody": 2, "manybody": 2, "cut3b": 0}

    cutoff_types_keys = list(cutoff_types.keys())
    cutoff_types_values = list(cutoff_types.values())


    logger = set_logger("Parameters", stream=True, fileout_name=None, verbose="info")