Adjusted sensitivity, and a weird edgecase where signoffs hit random people
This commit is contained in:
parent
f30bc04db7
commit
8e4b107bc1
|
|
@ -14,7 +14,7 @@ job_range = "AllJobs" # Note that the first row is headers
|
||||||
point_range = "PointRange"
|
point_range = "PointRange"
|
||||||
|
|
||||||
# How tolerant of spelling errors in names to be
|
# How tolerant of spelling errors in names to be
|
||||||
SHEET_LOOKUP_THRESHOLD = 0.9
|
SHEET_LOOKUP_THRESHOLD = 0.8
|
||||||
|
|
||||||
JOB_VAL = 1
|
JOB_VAL = 1
|
||||||
LATE_VAL = 0.5
|
LATE_VAL = 0.5
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import slack_util
|
||||||
|
|
||||||
SHEET_ID = "1lPj9GjB00BuIq9GelOWh5GmiGsheLlowPnHLnWBvMOM"
|
SHEET_ID = "1lPj9GjB00BuIq9GelOWh5GmiGsheLlowPnHLnWBvMOM"
|
||||||
|
|
||||||
MIN_RATIO = 0.9
|
MIN_RATIO = 0.8
|
||||||
|
|
||||||
|
|
||||||
def alert_user(slack: SlackClient, brother: scroll_util.Brother, saywhat: str) -> None:
|
def alert_user(slack: SlackClient, brother: scroll_util.Brother, saywhat: str) -> None:
|
||||||
|
|
@ -160,8 +160,9 @@ async def signoff_callback(slack: SlackClient, msg: dict, match: Match) -> None:
|
||||||
|
|
||||||
# Score by name similarity, only accepting non-assigned jobs
|
# Score by name similarity, only accepting non-assigned jobs
|
||||||
def scorer(assign: house_management.JobAssignment):
|
def scorer(assign: house_management.JobAssignment):
|
||||||
if assign.signer is None:
|
r = fuzz.ratio(signee.name, assign.assignee.name)
|
||||||
return fuzz.ratio(signee.name, assign.assignee.name)
|
if assign.signer is None and r > MIN_RATIO:
|
||||||
|
return r
|
||||||
|
|
||||||
# Set the assigner, and notify
|
# Set the assigner, and notify
|
||||||
def modifier(context: _ModJobContext):
|
def modifier(context: _ModJobContext):
|
||||||
|
|
@ -186,7 +187,9 @@ async def late_callback(slack: SlackClient, msg: dict, match: Match) -> None:
|
||||||
|
|
||||||
# Score by name similarity. Don't care if signed off or not
|
# Score by name similarity. Don't care if signed off or not
|
||||||
def scorer(assign: house_management.JobAssignment):
|
def scorer(assign: house_management.JobAssignment):
|
||||||
return fuzz.ratio(signee.name, assign.assignee.name)
|
r = fuzz.ratio(signee.name, assign.assignee.name)
|
||||||
|
if r > MIN_RATIO:
|
||||||
|
return r
|
||||||
|
|
||||||
# Just set the assigner
|
# Just set the assigner
|
||||||
def modifier(context: _ModJobContext):
|
def modifier(context: _ModJobContext):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue