Exemplo n.º 1
0
# ---- main 

natoms = input('Enter number of atoms: ') 

# open database
print 'database file name = storage.sqlite' 

if os.path.exists('storage.sqlite'):
    db = Database(db="storage.sqlite")
    print 'database file exists'
    if hasattr(db,'minima'):
        print ' number of minima =  ', len(db.minima())
        
    if hasattr(db,'ts'):
        print  ' number of ts = ', len(db.ts() ) 

    print '\n Note that minima and ts will be appended to existing set without testing for duplicates \n'
else:
    db = Database(db="storage.sqlite")

# --- Minima 
# counter to keep track of added minima
ct=1
minima={}

# for timing
tt = t0 = time.time()

if os.path.exists('extractedmin') and os.path.exists('min.data'):
    print 'Loading minima from extractedmin and min.data ..'