Newer
Older
# -*- coding: utf-8 -*-
def get_data(filename):
'''function to read the data form the input csv file to use in the analysis'''
reader = [] # Just in case the file open fails
with open(filename, 'rb') as f:
#returns all the data from the csv file in list form
#f.close() # May need to close the file when done
return list(reader) # only return the reader when you have finished.
your_list = []
your_list += get_data('./scripts/anselm.csv')
your_list += get_data('./scripts/salomon.csv')
your_list += get_data('./scripts/uv2000.csv')
#your_list += get_data('./scripts/phi.csv')
#your_list += get_data('./scripts/new.csv')
counts = dict()
for i in your_list:
counts[i[0]]=counts.get(i[0], 0) + int(i[1])
l = ['A', 'S', 'U', 'P', 'N']
c = []
mask = ''.join(reversed(l))
for i in range(1,len(l)+1):
for comb in itertools.combinations(l, i):
reg = "[^%s]" % ''.join(comb)
print re.sub(reg,"-", mask)
c.append(re.sub(reg,"-", mask))
print ' A - Anselm • S - Salomon • U - UV2000 at Salomon • P - Intel Xeon Phi cards at Salomon • N - new cluster'
print '| Module </br><input id="searchInput" placeholder="🔍 Filter" style="width: 8rem; border-radius: 0.2rem; color: black; padding-left: .2rem;"> | Versions | Clusters |'
software = dict()
versions = ''
clusters = ''
prev = ''
if len(split) > 1:
a = split[0]
b = split[1]
if split[0] <> prev:
software[a] = {}
for m in sorted(software.items(), key=lambda i: i[0].lower()):
versions = []
clusters = []
for key in sorted(m[1], key=LooseVersion ):
versions.append(key)
clusters.append(m[1][key])
print "| %s | %s | %s |" % (software, '</br>'.join(versions), '</br>'.join(clusters))
print
print '---8<--- "modules_matrix_search.md"'