# Path: mpinterfaces/transformations.py
# def reduced_supercell_vectors(ab, n):
#     """
#     Returns all possible reduced in-plane lattice vectors and
#     transition matrices for the given starting unit cell lattice
#     vectors(ab) and the supercell size n
#     """
#     uv_list = []
#     tm_list = []
#     for r_tm in get_trans_matrices(n):
#         uv = get_uv(ab, r_tm)
#         uv_r, tm0 = get_reduced_uv(uv, r_tm)
#         uv_list.append(uv_r)
#         tm_list.append(tm0)
#     return uv_list, tm_list
# 
# Path: mpinterfaces/utils.py
# def get_ase_slab(pmg_struct, hkl=(1, 1, 1), min_thick=10, min_vac=10):
#     """
#     takes in the intial structure as pymatgen Structure object
#     uses ase to generate the slab
#     returns pymatgen Slab object
# 
#     Args:
#         pmg_struct: pymatgen structure object
#         hkl: hkl index of surface of slab to be created
#         min_thick: minimum thickness of slab in Angstroms
#         min_vac: minimum vacuum spacing
#     """
#     ase_atoms = AseAtomsAdaptor().get_atoms(pmg_struct)
#     pmg_slab_gen = SlabGenerator(pmg_struct, hkl, min_thick, min_vac)
#     h = pmg_slab_gen._proj_height
#     nlayers = int(math.ceil(pmg_slab_gen.min_slab_size / h))
#     ase_slab = surface(ase_atoms, hkl, nlayers)
#     ase_slab.center(vacuum=min_vac / 2, axis=2)
#     pmg_slab_structure = AseAtomsAdaptor().get_structure(ase_slab)
#     return Slab(lattice=pmg_slab_structure.lattice,
#                 species=pmg_slab_structure.species_and_occu,
#                 coords=pmg_slab_structure.frac_coords,
#                 site_properties=pmg_slab_structure.site_properties,
#                 miller_index=hkl, oriented_unit_cell=pmg_slab_structure,
#                 shift=0., scale_factor=None, energy=None)
# 
# Path: mpinterfaces/default_logger.py
# def get_default_logger(name, output_stream=sys.stdout):
#     logger = logging.getLogger(name)
#     logger.setLevel(logging.DEBUG)
#     logger.propagate = False
#     formatter = logging.Formatter('%(levelname)s:%(name)s:%(message)s')
#     sh = logging.StreamHandler(stream=output_stream)
#     sh.setFormatter(formatter)
#     logger.addHandler(sh)
#     return logger


from six.moves import range
from pymatgen.core.structure import Structure, Molecule
from pymatgen.core.lattice import Lattice
from pymatgen.core.surface import Slab, SlabGenerator
from pymatgen.core.operations import SymmOp
from pymatgen.util.coord import get_angle
from mpinterfaces.transformations import reduced_supercell_vectors
from mpinterfaces.utils import get_ase_slab
from mpinterfaces.default_logger import get_default_logger
import sys
import math
import copy
import numpy as np
    import os
# coding: utf-8
# Copyright (c) Henniggroup.
# Distributed under the terms of the MIT License.

from __future__ import division, print_function, unicode_literals, \
    absolute_import

"""
Defines the Interface(extends class Slab) and
Ligand(extends class Molecule) classes
"""






__author__ = "Kiran Mathew, Joshua J. Gabriel"
__copyright__ = "Copyright 2017, Henniggroup"
__maintainer__ = "Joshua J. Gabriel"
__email__ = "joshgabriel92@gmail.com"
__status__ = "Production"
__date__ = "March 3, 2017"


# Path: mpinterfaces/transformations.py
# def reduced_supercell_vectors(ab, n):
#     """
#     Returns all possible reduced in-plane lattice vectors and
#     transition matrices for the given starting unit cell lattice
#     vectors(ab) and the supercell size n
#     """
#     uv_list = []
#     tm_list = []
#     for r_tm in get_trans_matrices(n):
#         uv = get_uv(ab, r_tm)
#         uv_r, tm0 = get_reduced_uv(uv, r_tm)
#         uv_list.append(uv_r)
#         tm_list.append(tm0)
#     return uv_list, tm_list
# 
# Path: mpinterfaces/utils.py
# def get_ase_slab(pmg_struct, hkl=(1, 1, 1), min_thick=10, min_vac=10):
#     """
#     takes in the intial structure as pymatgen Structure object
#     uses ase to generate the slab
#     returns pymatgen Slab object
# 
#     Args:
#         pmg_struct: pymatgen structure object
#         hkl: hkl index of surface of slab to be created
#         min_thick: minimum thickness of slab in Angstroms
#         min_vac: minimum vacuum spacing
#     """
#     ase_atoms = AseAtomsAdaptor().get_atoms(pmg_struct)
#     pmg_slab_gen = SlabGenerator(pmg_struct, hkl, min_thick, min_vac)
#     h = pmg_slab_gen._proj_height
#     nlayers = int(math.ceil(pmg_slab_gen.min_slab_size / h))
#     ase_slab = surface(ase_atoms, hkl, nlayers)
#     ase_slab.center(vacuum=min_vac / 2, axis=2)
#     pmg_slab_structure = AseAtomsAdaptor().get_structure(ase_slab)
#     return Slab(lattice=pmg_slab_structure.lattice,
#                 species=pmg_slab_structure.species_and_occu,
#                 coords=pmg_slab_structure.frac_coords,
#                 site_properties=pmg_slab_structure.site_properties,
#                 miller_index=hkl, oriented_unit_cell=pmg_slab_structure,
#                 shift=0., scale_factor=None, energy=None)
# 
# Path: mpinterfaces/default_logger.py
# def get_default_logger(name, output_stream=sys.stdout):
#     logger = logging.getLogger(name)
#     logger.setLevel(logging.DEBUG)
#     logger.propagate = False
#     formatter = logging.Formatter('%(levelname)s:%(name)s:%(message)s')
#     sh = logging.StreamHandler(stream=output_stream)
#     sh.setFormatter(formatter)
#     logger.addHandler(sh)
#     return logger


# Path: mpinterfaces/interface.py
from six.moves import range
from pymatgen.core.structure import Structure, Molecule
from pymatgen.core.lattice import Lattice
from pymatgen.core.surface import Slab, SlabGenerator
from pymatgen.core.operations import SymmOp
from pymatgen.util.coord import get_angle
from mpinterfaces.transformations import reduced_supercell_vectors
from mpinterfaces.utils import get_ase_slab
from mpinterfaces.default_logger import get_default_logger
import sys
import math
import copy
import numpy as np
    import os

# coding: utf-8
# Copyright (c) Henniggroup.
# Distributed under the terms of the MIT License.

from __future__ import division, print_function, unicode_literals, \
    absolute_import

"""
Defines the Interface(extends class Slab) and
Ligand(extends class Molecule) classes
"""






__author__ = "Kiran Mathew, Joshua J. Gabriel"
__copyright__ = "Copyright 2017, Henniggroup"
__maintainer__ = "Joshua J. Gabriel"
__email__ = "joshgabriel92@gmail.com"
__status__ = "Production"
__date__ = "March 3, 2017"


logger = get_default_logger(__name__)