Skip to content

Commit 81bcf44

Browse files
committed
Added some things
1 parent 766a1b9 commit 81bcf44

File tree

5 files changed

+763
-1
lines changed

5 files changed

+763
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ cython_debug/
156156

157157
APIKEY.config
158158

159+
Debug file*.txt
160+
159161
# PyCharm
160162
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161163
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore

Debug/gen_list_all_unis.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import json, time
2+
3+
with open("tier1.json", 'r') as t1 :
4+
tier1s = json.load(t1)
5+
with open("tier2.json", 'r') as t2 :
6+
tier2s = json.load(t2)
7+
with open("tier3.json", 'r') as t3 :
8+
tier3s = json.load(t3)
9+
with open("tier4.json", 'r') as t4 :
10+
tier4s = json.load(t4)
11+
with open("tier5.json", 'r') as t5 :
12+
tier5s = json.load(t5)
13+
14+
all_universities = {
15+
"Date Generated" : time.strftime("%Y-%m-%d %H:%M:%S %Z",time.localtime())
16+
}
17+
18+
all_universities.update(tier1s)
19+
all_universities.update(tier2s)
20+
all_universities.update(tier3s)
21+
all_universities.update(tier4s)
22+
all_universities.update(tier5s)
23+
24+
print(all_universities)
25+
26+
with open("all tiers.json", 'w') as ta :
27+
json.dump(all_universities, ta, indent=4)

Debug/print_uni_eval_score.py

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import json, sys, os
2+
## This makes the scripts behave with the code...
3+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
4+
import universities
5+
6+
T1_UNIS = []
7+
T2_UNIS = []
8+
T3_UNIS = []
9+
T4_UNIS = []
10+
T5_UNIS = []
11+
uni_score_list = ""
12+
13+
with open("tier1.json", 'r') as t1 :
14+
tier1s = json.load(t1)
15+
16+
for i in tier1s :
17+
## Ugly but works
18+
T1_UNIS.append(universities.university(i, tier1s[i]["acc_rate"], 5, tier1s[i]["75_sat"], tier1s[i]["50_sat"], tier1s[i]["25_sat"], tier1s[i]["tags"]))
19+
uni_score_list += (i + " : " + str(T1_UNIS[len(T1_UNIS)-1].universityDifficulty)) + "\n"
20+
21+
with open("tier2.json", 'r') as t2 :
22+
tier2s = json.load(t2)
23+
24+
for i in tier2s :
25+
T2_UNIS.append(universities.university(i, tier2s[i]["acc_rate"], 4, tier2s[i]["75_sat"], tier2s[i]["50_sat"], tier2s[i]["25_sat"], tier2s[i]["tags"]))
26+
uni_score_list += (i + " : " + str(T2_UNIS[len(T2_UNIS)-1].universityDifficulty)) + "\n"
27+
28+
29+
with open("tier3.json", 'r') as t3 :
30+
tier3s = json.load(t3)
31+
32+
for i in tier3s :
33+
T3_UNIS.append(universities.university(i, tier3s[i]["acc_rate"], 3, tier3s[i]["75_sat"], tier3s[i]["50_sat"], tier3s[i]["25_sat"], tier3s[i]["tags"]))
34+
uni_score_list += (i + " : " + str(T3_UNIS[len(T3_UNIS)-1].universityDifficulty)) + "\n"
35+
36+
with open("tier4.json", 'r') as t4 :
37+
tier4s = json.load(t4)
38+
39+
for i in tier4s :
40+
T4_UNIS.append(universities.university(i, tier4s[i]["acc_rate"], 2, tier4s[i]["75_sat"], tier4s[i]["50_sat"], tier4s[i]["25_sat"], tier4s[i]["tags"]))
41+
uni_score_list += (i + " : " + str(T4_UNIS[len(T4_UNIS)-1].universityDifficulty)) + "\n"
42+
43+
with open("tier5.json", 'r') as t5 :
44+
tier5s = json.load(t5)
45+
46+
for i in tier5s :
47+
T5_UNIS.append(universities.university(i, tier5s[i]["acc_rate"], 1, tier5s[i]["75_sat"], tier5s[i]["50_sat"], tier5s[i]["25_sat"], tier5s[i]["tags"]))
48+
uni_score_list += (i + " : " + str(T5_UNIS[len(T5_UNIS)-1].universityDifficulty)) + "\n"
49+
50+
51+
## Also a bit janky but also works
52+
ALL_UNIS = T1_UNIS + T2_UNIS + T3_UNIS + T4_UNIS + T5_UNIS
53+
54+
with open("Debug file1.txt", "w") as out_file :
55+
out_file.write(str(ALL_UNIS))
56+
57+
with open("Debug file2.txt", "w") as out_file :
58+
out_file.write(str(uni_score_list))

0 commit comments

Comments
 (0)