# Path: umansysprop/boiling_points.py
# def joback_and_reid(compound):
# def stein_and_brown(compound):
# def nannoolal(compound):
# 
# Path: umansysprop/vapour_pressures.py
# def nannoolal(compound, temperature, boiling_point):
# def myrdal_and_yalkowsky(compound, temperature, boiling_point):
# def evaporation(compound, temperature):
# def evaporation2(compound, temperature):
# def simpol(compound, temperature):
#     C = m[2] + m[4] + m[6]
#     O = m[23] + m[25] + m[29] + m[101] + m[105] + (2 * m[106])
#     N = m[39] + m[41] + m[33] + m[35]
#             A_CL = groups.aggregate_matches(
#                     m, data.EVAPORATION_A,
#                     groups=('5', '6', '7', '13', '16', '17', '18', '12CL')
#                     ) / sqrt(CL_groups)
#             A_CL = 0.0
#             A_HB = groups.aggregate_matches(
#                     m, data.EVAPORATION_A,
#                     groups=('8', '9', '10', '11', '14', '15', '19', '20', '12HB')
#                     ) / sqrt(HB_groups)
#             A_HB = 0.0
#         A = A_lin + (A_CL + A_HB) * diacid_factor
#         B_CL_HB = groups.aggregate_matches(
#                 m, data.EVAPORATION_B,
#                 groups=(
#                     '5', '6', '7', '8', '9', '10', '11', '12',
#                     '13', '14', '15', '16', '17', '18', '19', '20')
#                 )
#         B = B_lin + B_CL_HB * diacid_factor
#         A = groups.aggregate_matches(
#                 m, data.EVAPORATION_A, groups=g)
#         B = groups.aggregate_matches(
#                 m, data.EVAPORATION_B, groups=g)
#             A_CL = groups.aggregate_matches(
#                     m, data.EVAPORATION2_A,
#                     groups=('5', '6', '7', '13', '16', '17', '18', '12CL')
#                     ) / sqrt(CL_groups)
#             A_CL = 0.0
#             A_HB = groups.aggregate_matches(
#                     m, data.EVAPORATION2_A,
#                     groups=('8', '9', '10', '11', '14', '15', '19', '20', '12HB')
#                     ) / sqrt(HB_groups)
#             A_HB = 0.0
#         A = A_lin + (A_CL + A_HB) * diacid_factor
#         B_CL_HB = groups.aggregate_matches(
#                 m, data.EVAPORATION2_B,
#                 groups=(
#                     '5', '6', '7', '8', '9', '10', '11', '12',
#                     '13', '14', '15', '16', '17', '18', '19', '20')
#                 )
#         B = B_lin + B_CL_HB * diacid_factor
#         A = groups.aggregate_matches(
#                 m, data.EVAPORATION2_A, groups=g)
#         B = groups.aggregate_matches(
#                 m, data.EVAPORATION_B, groups=g)
# 
# Path: umansysprop/critical_properties.py
# def joback_and_reid(compound, boiling_point):
# def nannoolal(compound, boiling_point):
# 
# Path: umansysprop/liquid_densities.py
# def girolami(compound):
# def _generic(
#         compound, temperature, molar_volume, critical_properties):
# def schroeder(
#         compound, temperature, critical_properties):
# def le_bas(
#         compound, temperature, critical_properties):
# def tyn_and_calus(
#         compound, temperature, critical_properties):


import glob
import pybel
import collections
import sys
import pdb
from umansysprop import boiling_points
from umansysprop import vapour_pressures
from umansysprop import critical_properties
from umansysprop import liquid_densities
       Pybel_object=pybel.readstring(b'smi',input[1])
       Pybel_object_dict[input[1]]=Pybel_object
       
##########################################################################################       
# 2) Create a dictionary of properties based on these Pybel objects

# NOTE: For some of the vapour pressure values, you need to perform a boiling point estimation first
# It is therefore wise to do this initially

# 2a) Boiling points [(K)]

boiling_point_dict=collections.defaultdict(lambda: collections.defaultdict())

for smiles in smiles_array:

    boiling_point_dict[smiles]['joback_and_reid']=boiling_points.joback_and_reid(Pybel_object_dict[smiles])
    boiling_point_dict[smiles]['stein_and_brown']=boiling_points.stein_and_brown(Pybel_object_dict[smiles])
    boiling_point_dict[smiles]['nannoolal']=boiling_points.nannoolal(Pybel_object_dict[smiles])
    

# 2b) Vapour pressures [log10 (atm) at a specific temperature]
# For those vapour pressure methods that require a boiling point, we have 3D dictionaries

vapour_pressure_dict_BP=collections.defaultdict(lambda: collections.defaultdict(lambda: collections.defaultdict()))
vapour_pressure_dict=collections.defaultdict(lambda: collections.defaultdict())
temperature=298.15

for smiles in smiles_array:

    vapour_pressure_dict_BP[smiles]['VP_Nannoolal']['BP_Nannoolal']=vapour_pressures.nannoolal(Pybel_object_dict[smiles], temperature, boiling_point_dict[smiles]['nannoolal'])

# Path: umansysprop/boiling_points.py
# def joback_and_reid(compound):
# def stein_and_brown(compound):
# def nannoolal(compound):
# 
# Path: umansysprop/vapour_pressures.py
# def nannoolal(compound, temperature, boiling_point):
# def myrdal_and_yalkowsky(compound, temperature, boiling_point):
# def evaporation(compound, temperature):
# def evaporation2(compound, temperature):
# def simpol(compound, temperature):
#     C = m[2] + m[4] + m[6]
#     O = m[23] + m[25] + m[29] + m[101] + m[105] + (2 * m[106])
#     N = m[39] + m[41] + m[33] + m[35]
#             A_CL = groups.aggregate_matches(
#                     m, data.EVAPORATION_A,
#                     groups=('5', '6', '7', '13', '16', '17', '18', '12CL')
#                     ) / sqrt(CL_groups)
#             A_CL = 0.0
#             A_HB = groups.aggregate_matches(
#                     m, data.EVAPORATION_A,
#                     groups=('8', '9', '10', '11', '14', '15', '19', '20', '12HB')
#                     ) / sqrt(HB_groups)
#             A_HB = 0.0
#         A = A_lin + (A_CL + A_HB) * diacid_factor
#         B_CL_HB = groups.aggregate_matches(
#                 m, data.EVAPORATION_B,
#                 groups=(
#                     '5', '6', '7', '8', '9', '10', '11', '12',
#                     '13', '14', '15', '16', '17', '18', '19', '20')
#                 )
#         B = B_lin + B_CL_HB * diacid_factor
#         A = groups.aggregate_matches(
#                 m, data.EVAPORATION_A, groups=g)
#         B = groups.aggregate_matches(
#                 m, data.EVAPORATION_B, groups=g)
#             A_CL = groups.aggregate_matches(
#                     m, data.EVAPORATION2_A,
#                     groups=('5', '6', '7', '13', '16', '17', '18', '12CL')
#                     ) / sqrt(CL_groups)
#             A_CL = 0.0
#             A_HB = groups.aggregate_matches(
#                     m, data.EVAPORATION2_A,
#                     groups=('8', '9', '10', '11', '14', '15', '19', '20', '12HB')
#                     ) / sqrt(HB_groups)
#             A_HB = 0.0
#         A = A_lin + (A_CL + A_HB) * diacid_factor
#         B_CL_HB = groups.aggregate_matches(
#                 m, data.EVAPORATION2_B,
#                 groups=(
#                     '5', '6', '7', '8', '9', '10', '11', '12',
#                     '13', '14', '15', '16', '17', '18', '19', '20')
#                 )
#         B = B_lin + B_CL_HB * diacid_factor
#         A = groups.aggregate_matches(
#                 m, data.EVAPORATION2_A, groups=g)
#         B = groups.aggregate_matches(
#                 m, data.EVAPORATION_B, groups=g)
# 
# Path: umansysprop/critical_properties.py
# def joback_and_reid(compound, boiling_point):
# def nannoolal(compound, boiling_point):
# 
# Path: umansysprop/liquid_densities.py
# def girolami(compound):
# def _generic(
#         compound, temperature, molar_volume, critical_properties):
# def schroeder(
#         compound, temperature, critical_properties):
# def le_bas(
#         compound, temperature, critical_properties):
# def tyn_and_calus(
#         compound, temperature, critical_properties):


# Path: umansysprop/examples/Pure_component_properties_example.py
import glob
import pybel
import collections
import sys
import pdb
from umansysprop import boiling_points
from umansysprop import vapour_pressures
from umansysprop import critical_properties
from umansysprop import liquid_densities

       Pybel_object=pybel.readstring(b'smi',input[1])
       Pybel_object_dict[input[1]]=Pybel_object
       
##########################################################################################       
# 2) Create a dictionary of properties based on these Pybel objects

# NOTE: For some of the vapour pressure values, you need to perform a boiling point estimation first
# It is therefore wise to do this initially

# 2a) Boiling points [(K)]

boiling_point_dict=collections.defaultdict(lambda: collections.defaultdict())

for smiles in smiles_array:

    boiling_point_dict[smiles]['joback_and_reid']=boiling_points.joback_and_reid(Pybel_object_dict[smiles])
    boiling_point_dict[smiles]['stein_and_brown']=boiling_points.stein_and_brown(Pybel_object_dict[smiles])
    boiling_point_dict[smiles]['nannoolal']=boiling_points.nannoolal(Pybel_object_dict[smiles])
    

# 2b) Vapour pressures [log10 (atm) at a specific temperature]
# For those vapour pressure methods that require a boiling point, we have 3D dictionaries

vapour_pressure_dict_BP=collections.defaultdict(lambda: collections.defaultdict(lambda: collections.defaultdict()))
vapour_pressure_dict=collections.defaultdict(lambda: collections.defaultdict())
temperature=298.15

for smiles in smiles_array:

    vapour_pressure_dict_BP[smiles]['VP_Nannoolal']['BP_Nannoolal']=vapour_pressures.nannoolal(Pybel_object_dict[smiles], temperature, boiling_point_dict[smiles]['nannoolal'])

    vapour_pressure_dict_BP[smiles]['VP_Nannoolal']['BP_Stein_Brown']=vapour_pressures.nannoolal(Pybel_object_dict[smiles], temperature, boiling_point_dict[smiles]['stein_and_brown'])