Пример #1
0
 def getMol(self, ccId):
     try:
         if not self.__oeMolD:
             oeIo = OeIoUtils()
             self.__oeMolD = oeIo.readOeBinaryMolCache(
                 os.path.join(self.__dirPath, self.__getOeMolFileName()))
             logger.info("Loading OE binary molecule cache length %d",
                         len(self.__oeMolD))
         return self.__oeMolD[ccId]
     except Exception as e:
         logger.exception("Get molecule %r failing with %s", ccId, str(e))
     return None
 def getOeMolD(self):
     try:
         if not self.__oeMolD:
             startTime = time.time()
             oeIo = OeIoUtils()
             self.__oeMolD = oeIo.readOeBinaryMolCache(
                 os.path.join(self.__dirPath,
                              self.__getOeSearchMolFileName()))
             logger.info(
                 "Loading OE binary molecule cache length %d (%.4f seconds)",
                 len(self.__oeMolD),
                 time.time() - startTime)
         return self.__oeMolD
     except Exception as e:
         logger.exception("Failing with %s", str(e))
     return None