Skip to content

Commit

Permalink
Fix is_stage_5_passed
Browse files Browse the repository at this point in the history
  • Loading branch information
bjhardcastle committed Nov 23, 2024
1 parent 38cf6b1 commit 8d2bcad
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/npc_sessions/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2002,8 +2002,6 @@ def is_stage_5_passed(self) -> bool:
f"Could not find {subject_id} in training spreadsheets (and not a known Templeton session) - returning is_stage_5_passed = False, but this may be incorrect"
)
return False

df = df[df["task version"].str.startswith("stage 5")]
if df.empty:
return False
return np.isnan(
Expand All @@ -2012,9 +2010,9 @@ def is_stage_5_passed(self) -> bool:
df=df,
sessions=np.where(
[
str(d).split(" ")[0]
< self.session_start_time.strftime("%Y-%m-%d")
for d in df["start time"].values
(str(start_time).split(" ")[0] < self.session_start_time.strftime("%Y-%m-%d"))
and str(task_version).startswith("stage 5")
for start_time, task_version in df[["start time", "task version"]].values
]
)[0],
stage=5,
Expand Down

0 comments on commit 8d2bcad

Please sign in to comment.