-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_data.py
More file actions
61 lines (46 loc) · 2.03 KB
/
debug_data.py
File metadata and controls
61 lines (46 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import json
def analyze_cie():
try:
with open('public/cie_data.json', 'r') as f:
data = json.load(f)
missing_year = [item for item in data if not item.get('Year')]
missing_session = [item for item in data if not item.get('Session')]
accounting_0452 = [item for item in data if '0452' in item.get('Subject', '')]
print(f"CIE Total: {len(data)}")
print(f"CIE Missing Year: {len(missing_year)}")
print(f"CIE Missing Session: {len(missing_session)}")
if missing_year:
print("Sample Missing Year:", missing_year[0])
print(f"Accounting 0452 Count: {len(accounting_0452)}")
# Check if any Accounting 0452 have missing year/session
acc_missing = [item for item in accounting_0452 if not item.get('Year') or not item.get('Session')]
print(f"Accounting 0452 Missing Year/Session: {len(acc_missing)}")
if acc_missing:
print("Sample Acc Missing:", acc_missing[0])
except Exception as e:
print(f"Error CIE: {e}")
def analyze_ial():
try:
with open('public/ial_data.json', 'r') as f:
data = json.load(f)
print(f"IAL Total: {len(data)}")
# Check for MA03 or WMA03
ma03 = [item for item in data if 'MA03' in item.get('Unit_Code', '')]
wma03 = [item for item in data if 'WMA03' in item.get('Unit_Code', '')]
print(f"IAL MA03 count: {len(ma03)}")
print(f"IAL WMA03 count: {len(wma03)}")
if ma03:
print("Sample MA03:", ma03[0])
# Check Subject mapping coverage
# We'll simulate the mapping logic
prefixes = set()
for item in data:
code = item.get('Unit_Code', '')
if code:
prefixes.add(code[:3])
print(f"Unique Prefixes: {sorted(list(prefixes))}")
except Exception as e:
print(f"Error IAL: {e}")
if __name__ == "__main__":
analyze_cie()
analyze_ial()