make staff-tier category labels reflect the actual --senior-threshold/--support-threshold values
This commit is contained in:
parent
a621b94512
commit
efce6f3dec
2 changed files with 31 additions and 12 deletions
|
|
@ -85,6 +85,24 @@ SENIOR_STAFF_THRESHOLD = 100_000
|
|||
SUPPORT_STAFF_THRESHOLD = 40_000
|
||||
|
||||
|
||||
def _fmt_threshold(v: float) -> str:
|
||||
if v == int(v) and v % 1000 == 0:
|
||||
return f"${int(v) // 1000}k"
|
||||
return f"${v:,.0f}"
|
||||
|
||||
|
||||
def category_labels(senior_threshold: float = SENIOR_STAFF_THRESHOLD,
|
||||
support_threshold: float = SUPPORT_STAFF_THRESHOLD) -> dict:
|
||||
"""CATEGORY_LABELS with the staff-tier labels reflecting the actual
|
||||
thresholds passed to classify_title(), instead of the defaults."""
|
||||
labels = dict(CATEGORY_LABELS)
|
||||
labels["SENIOR_PROF_STAFF"] = f"Senior Prof/Staff (>={_fmt_threshold(senior_threshold)})"
|
||||
labels["PROF_STAFF"] = (f"Professional Staff ({_fmt_threshold(support_threshold)}"
|
||||
f"-{_fmt_threshold(senior_threshold)})")
|
||||
labels["SUPPORT_STAFF"] = f"Support Staff (<{_fmt_threshold(support_threshold)})"
|
||||
return labels
|
||||
|
||||
|
||||
def _rx(*patterns):
|
||||
return [re.compile(p, re.IGNORECASE) for p in patterns]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue