# Path: chemistry/calcore/config.py
# CALCULATE_CMD_TYPE = namedtuple("CALCULATE_CMD_TYPE",
#         ['DRAGON', 'MOPAC', 'GAUSSIAN'])('dragon6shell -s ', 'mopac ', 'g09 ')
# 
# CALCULATE_DATA_PATH = namedtuple('CALCULATE_DATA_PATH',
#         ['DRAGON', 'MOPAC', 'GAUSSIAN'])(DRAGON_PATH, MOPAC_PATH, GAUSSIAN_PATH)


from os.path import join
from .config import CALCULATE_CMD_TYPE, CALCULATE_DATA_PATH
from utils import chemistry_logger
from chemistry.calcore.utils import CalcoreCmd
# coding: utf-8


class GaussianOptimizeModel():
    '''Optimize .gjf --> .log --> .mol'''
    def __init__(self, gjf_fname_list):
        self.gjf_fname_list_no_ext = []

        for fname in gjf_fname_list:
            self.gjf_fname_list_no_ext.append(fname.split('.')[0])

    def gjf4dragon(self, model_name):
        for name in self.gjf_fname_list_no_ext:
            mol_path = join(CALCULATE_DATA_PATH.DRAGON, model_name, name,
                            '%s.mol' % name)

# Path: chemistry/calcore/config.py
# CALCULATE_CMD_TYPE = namedtuple("CALCULATE_CMD_TYPE",
#         ['DRAGON', 'MOPAC', 'GAUSSIAN'])('dragon6shell -s ', 'mopac ', 'g09 ')
# 
# CALCULATE_DATA_PATH = namedtuple('CALCULATE_DATA_PATH',
#         ['DRAGON', 'MOPAC', 'GAUSSIAN'])(DRAGON_PATH, MOPAC_PATH, GAUSSIAN_PATH)


# Path: chemistry/calcore/gaussian_optimize.py
from os.path import join
from .config import CALCULATE_CMD_TYPE, CALCULATE_DATA_PATH
from utils import chemistry_logger
from chemistry.calcore.utils import CalcoreCmd

# coding: utf-8


class GaussianOptimizeModel():
    '''Optimize .gjf --> .log --> .mol'''
    def __init__(self, gjf_fname_list):
        self.gjf_fname_list_no_ext = []

        for fname in gjf_fname_list:
            self.gjf_fname_list_no_ext.append(fname.split('.')[0])

    def gjf4dragon(self, model_name):
        for name in self.gjf_fname_list_no_ext:
            mol_path = join(CALCULATE_DATA_PATH.DRAGON, model_name, name,
                            '%s.mol' % name)

            gjf_path = join(CALCULATE_DATA_PATH.GAUSSIAN, model_name, name,