Пример #1
0
 def __init__(self, xl_file):
     book = load_workbook(xl_file)
     sheet = book.get_active_sheet()
     data = sheet.range("d2:g25")
     results = []
     for row in data:
         team1, s1, s2, team2 = (cell.value for cell in row)
         team1 = self.fix_name(team1)
         team2 = self.fix_name(team2)
         results.append((u'%s-%s'%(team1, team2), (s1, s2)))
     self.data = results
Пример #2
0
 def __init__(self, xl_file):
     book = load_workbook(xl_file)
     sheet = book.get_active_sheet()
     data = sheet.range("d2:g25")
     results = []
     for row in data:
         team1, s1, s2, team2 = (cell.value for cell in row)
         team1 = self.fix_name(team1)
         team2 = self.fix_name(team2)
         results.append((u'%s-%s' % (team1, team2), (s1, s2)))
     self.data = results
Пример #3
0
import json
import symbols
import prices
import prediction
import results

#Open config.json
f = open("config.json", encoding='utf-8')
#Load config.json
config = json.load(f)
print("Reading Symbols")
symbol_list = symbols.get_list(config)
print(str(len(symbol_list)) + " Files Found")

#Create ValidationFile.csv File
print("Create Result File")
results.create(config)

steps = 0
resultlist = prediction.create_resultlist(config)
while True:
    steps += 1
    print("Saving Prices File……")
    validationList = prices.save_prices_file(config, symbol_list)
    print("Start Prediction……")
    resultlist = prediction.calculate_winrate(config, validationList,
                                              resultlist, steps)
    results.append(config, resultlist)
    print("Step " + str(steps) + " Finished.")
Пример #4
0
def make_username_generators(current_guess):
    results = []
    for next_guess in users.charset():
        results.append(users.generate_username(current_guess + next_guess))
    return results
Пример #5
0
def make_username_generators(current_guess):
    results = []
    for next_guess in users.charset():
        results.append(users.generate_username(current_guess + next_guess))
    return results
Пример #6
0
label = r'Average island radius growth rate / $(v_g / F^{0.11})$'
plt.ylabel(label)
label = r'Time-averaged total rate $ < R >_t/F^{0.79} $'
plt.xlabel(label)
plt.grid(True)
temperatures = list(range(120, 321, 5))

workingPath = os.getcwd()
results = results.Results()
for i in range(-6, 1):
    folder = "flux3.5e" + str(i)
    flux = float("3.5e" + str(i))
    print(folder)
    try:
        os.chdir(folder)
        results.append(mk.getIslandDistribution(temperatures, False, False))
    except OSError:
        print("error changing to {}".format(folder))
    os.chdir(workingPath)
    vs = results.growthSlope()
    vg = results.gyradius()
    y = vs / (vg / flux**0.11)
    x = results.totalRatio() / flux**0.79
    plt.loglog(x, y, label=folder)
    plt.legend(loc='upper left', prop={'size': 6})
    plt.savefig("vsVgVsRate.png")

plt.close()

print("Good bye!")
Пример #7
0
def EvaluateDataset(gt_sequences, results_sequence):
    results = []
    for gt, res in zip(gt_sequences, results_sequence):
        results.append(EvaluateSequence(gt, res))

    return results