67 lines
2.1 KiB
Python
67 lines
2.1 KiB
Python
"""
|
|
count_asst_prof_ucwages.py
|
|
============================
|
|
Cross-check against the GCC-based analysis: count non-medical Assistant
|
|
Professors UC-wide in 2024 using the UC-wages JSON data (uc_wages_data/),
|
|
the same source uc_salary_pipeline.py normally uses. This can't give
|
|
salary+benefits (no benefits field in this source) but it's a useful
|
|
sanity check on headcount, since it's a different upstream source than GCC.
|
|
|
|
Reuses classifier.py's classify_title/is_medical_center, plus the
|
|
assistant-rank filter from analyze_asst_prof_comp.py.
|
|
"""
|
|
|
|
import json
|
|
import glob
|
|
import re
|
|
|
|
from classifier import classify_title, is_medical_center
|
|
from analyze_asst_prof_comp import is_assistant_rank, is_recognised_non_assistant_senate
|
|
from uc_wages_downloader import LOCATIONS
|
|
|
|
FOLDER_TO_CAMPUS = {folder: campus for campus, folder in LOCATIONS.items()}
|
|
|
|
YEAR = 2024
|
|
|
|
|
|
def main():
|
|
counts = {}
|
|
unrecognised_senate_titles = set()
|
|
total = 0
|
|
|
|
for path in sorted(glob.glob(f"uc_wages_data/*/wages_{YEAR}.json")):
|
|
folder = path.split("/")[1]
|
|
campus = FOLDER_TO_CAMPUS[folder]
|
|
with open(path) as f:
|
|
data = json.load(f)
|
|
|
|
n = 0
|
|
for rec in data["records"]:
|
|
title = rec["title"]
|
|
if classify_title(title) != "SENATE_FACULTY":
|
|
continue
|
|
if is_medical_center(title, campus):
|
|
continue
|
|
if not is_assistant_rank(title):
|
|
if not is_recognised_non_assistant_senate(title):
|
|
unrecognised_senate_titles.add(title)
|
|
continue
|
|
n += 1
|
|
|
|
counts[campus] = n
|
|
total += n
|
|
|
|
if unrecognised_senate_titles:
|
|
print("NOTE: Senate-faculty titles not matched by any rank pattern:")
|
|
for t in sorted(unrecognised_senate_titles):
|
|
print(f" - {t}")
|
|
print()
|
|
|
|
print(f"{'Campus':<10}{'N':>6}")
|
|
for campus in sorted(counts):
|
|
print(f"{campus:<10}{counts[campus]:>6}")
|
|
print(f"\nTotal non-medical Assistant Professors, UC system-wide, {YEAR}: {total}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|