# Path: apgl/io/MDLGraphsReader.py
# class MDLGraphsReader():
#     def __init__(self):
#         self.atomDict = {}
#         self.atomDict["C"] = 0
#         self.atomDict["H"] = 1
#         self.atomDict["N"] = 2
#         self.atomDict["O"] = 3
# 
#     def readFromFile(self, fileName):
#         inFile = open(fileName,"r")
#         numFeatures = 1
# 
#         graphList = []
#         line = inFile.readline()
# 
#         while line != "":
#             #First 3 lines are useless
#             
#             inFile.readline()
#             inFile.readline()
# 
#             #4th line has edge information
#             line = inFile.readline()
#             valueList = line.split(None)
#             numVertices = int(valueList[0])
#             #Not strictly the number of edges, as molecules can have multiple edges
#             #between a pair of atoms 
#             numEdges = int(valueList[1])
# 
#             vList = VertexList(numVertices, numFeatures)
# 
#             for i in range(numVertices):
#                 line = inFile.readline()
#                 valueList = line.split(None)
#                 vList.setVertex(i, numpy.array([self.atomDict[valueList[3]]]))
# 
#             graph = SparseGraph(vList)
# 
#             for i in range(numEdges):
#                 line = inFile.readline()
#                 valueList = line.split(None)
#                 graph.addEdge(int(valueList[0])-1, int(valueList[1])-1)
#         
#             graphList.append(graph)
# 
#             #Ignore next two lines
#             inFile.readline()
#             inFile.readline()
#             line = inFile.readline()
# 
#         return graphList 
# 
# Path: apgl/util/PathDefaults.py
# class PathDefaults(object):
#     """
#     This class stores some useful global default paths. 
#     """
#     @staticmethod 
#     def readField(field):
#         configFileName = expanduser("~") + os.sep + ".apglrc"
# 
#         if not os.path.exists(configFileName): 
#             print("Creating missing config file: " + configFileName)
#             defaultConfig = "[paths]\n" 
#             defaultConfig += "data = " + expanduser("~") + os.sep + "data" + os.sep + "\n"
#             defaultConfig += "output = " + expanduser("~") + os.sep + "output" + os.sep + "\n"
#             configFile = open(configFileName, "w")
#             configFile.write(defaultConfig)
#             configFile.close()
#             
#         parser = SafeConfigParser()
#         parser.read(configFileName)
#         return parser.get('paths', field)
# 
#     @staticmethod
#     def getSourceDir():
#         """
#         Root directory of source code for APGL. 
#         """
#         dir = os.path.abspath( __file__ )
#         dir, head = os.path.split(dir)
#         dir, head = os.path.split(dir)
#         return dir 
#         
#     @staticmethod
#     def getDataDir():
#         """
#         Location of data files. 
#         """
#         return PathDefaults.readField("data")
# 
#     @staticmethod
#     def getOutputDir():
#         """
#         Location of output files. 
#         """
#         return PathDefaults.readField("output")
#         
#     @staticmethod
#     def getTempDir():
#         return tempfile.gettempdir() + os.sep


import unittest
from apgl.io.MDLGraphsReader import MDLGraphsReader
from apgl.util.PathDefaults import PathDefaults 


class  MDLGraphsReaderTestCase(unittest.TestCase):
    def testMDLGraphsReader(self):
        reader = MDLGraphsReader()

# Path: apgl/io/MDLGraphsReader.py
# class MDLGraphsReader():
#     def __init__(self):
#         self.atomDict = {}
#         self.atomDict["C"] = 0
#         self.atomDict["H"] = 1
#         self.atomDict["N"] = 2
#         self.atomDict["O"] = 3
# 
#     def readFromFile(self, fileName):
#         inFile = open(fileName,"r")
#         numFeatures = 1
# 
#         graphList = []
#         line = inFile.readline()
# 
#         while line != "":
#             #First 3 lines are useless
#             
#             inFile.readline()
#             inFile.readline()
# 
#             #4th line has edge information
#             line = inFile.readline()
#             valueList = line.split(None)
#             numVertices = int(valueList[0])
#             #Not strictly the number of edges, as molecules can have multiple edges
#             #between a pair of atoms 
#             numEdges = int(valueList[1])
# 
#             vList = VertexList(numVertices, numFeatures)
# 
#             for i in range(numVertices):
#                 line = inFile.readline()
#                 valueList = line.split(None)
#                 vList.setVertex(i, numpy.array([self.atomDict[valueList[3]]]))
# 
#             graph = SparseGraph(vList)
# 
#             for i in range(numEdges):
#                 line = inFile.readline()
#                 valueList = line.split(None)
#                 graph.addEdge(int(valueList[0])-1, int(valueList[1])-1)
#         
#             graphList.append(graph)
# 
#             #Ignore next two lines
#             inFile.readline()
#             inFile.readline()
#             line = inFile.readline()
# 
#         return graphList 
# 
# Path: apgl/util/PathDefaults.py
# class PathDefaults(object):
#     """
#     This class stores some useful global default paths. 
#     """
#     @staticmethod 
#     def readField(field):
#         configFileName = expanduser("~") + os.sep + ".apglrc"
# 
#         if not os.path.exists(configFileName): 
#             print("Creating missing config file: " + configFileName)
#             defaultConfig = "[paths]\n" 
#             defaultConfig += "data = " + expanduser("~") + os.sep + "data" + os.sep + "\n"
#             defaultConfig += "output = " + expanduser("~") + os.sep + "output" + os.sep + "\n"
#             configFile = open(configFileName, "w")
#             configFile.write(defaultConfig)
#             configFile.close()
#             
#         parser = SafeConfigParser()
#         parser.read(configFileName)
#         return parser.get('paths', field)
# 
#     @staticmethod
#     def getSourceDir():
#         """
#         Root directory of source code for APGL. 
#         """
#         dir = os.path.abspath( __file__ )
#         dir, head = os.path.split(dir)
#         dir, head = os.path.split(dir)
#         return dir 
#         
#     @staticmethod
#     def getDataDir():
#         """
#         Location of data files. 
#         """
#         return PathDefaults.readField("data")
# 
#     @staticmethod
#     def getOutputDir():
#         """
#         Location of output files. 
#         """
#         return PathDefaults.readField("output")
#         
#     @staticmethod
#     def getTempDir():
#         return tempfile.gettempdir() + os.sep


# Path: apgl/io/test/MDLGraphsReaderTest.py
import unittest
from apgl.io.MDLGraphsReader import MDLGraphsReader
from apgl.util.PathDefaults import PathDefaults 



class  MDLGraphsReaderTestCase(unittest.TestCase):
    def testMDLGraphsReader(self):
        reader = MDLGraphsReader()

        dir = PathDefaults.getDataDir()