create_caches2.py
def read_data(data_root):
      '''read a types file and put it in mols_to_write'''
      while True:
        sys.stdout.flush()
        mol = mols_to_read.get()
        if mol == None:
          break
        fname = mol
        if len(data_root):
          fname = data_root+'/'+mol
        try:
            with open(fname,'rb') as gninatype:
              data = gninatype.read()
              assert(len(data) % 16 == 0)
              if len(data) == 0:
                  print(fname,"EMPTY")
              else: 
                  mols_to_write.put((mol,data))
        except Exception as e:
              print(fname)
              print(e)
      mols_to_write.put(None)
read a types file and put it in mols_to_write
read a types file and put it in mols_to_write
read a types file and put it in mols_to_write
def read_data(data_root):
      while True:
        sys.stdout.flush()
        mol = mols_to_read.get()
        if mol == None:
          break
        fname = mol
        if len(data_root):
          fname = data_root+'/'+mol
        try:
            with open(fname,'rb') as gninatype:
              data = gninatype.read()
              assert(len(data) % 16 == 0)
              if len(data) == 0:
                  print(fname,"EMPTY")
              else: 
                  mols_to_write.put((mol,data))
        except Exception as e:
              print(fname)
              print(e)
      mols_to_write.put(None)
def read_data ( data_root ) : while True : sys . stdout . flush ( ) mol = mols_to_read . get ( ) if mol == None : break fname = mol if len ( data_root ) : fname = data_root + '/' + mol try : with open ( fname , 'rb' ) as gninatype : data = gninatype . read ( ) assert ( len ( data ) % 16 == 0 ) if len ( data ) == 0 : print ( fname , "EMPTY" ) else : mols_to_write . put ( ( mol , data ) ) except Exception as e : print ( fname ) print ( e ) mols_to_write . put ( None )
read a types file and put it in mols_to_write
read a types file and put it in mols_to_write
'''read a types file and put it in mols_to_write'''
data_root