Skip to content

Commit

Permalink
Update/fix keywords and notes
Browse files Browse the repository at this point in the history
  • Loading branch information
bjhardcastle committed Oct 1, 2024
1 parent b993f2b commit d335fa2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/npc_sessions/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def session_start_time(self) -> datetime.datetime:
def notes(self) -> str | None:
notes = ""
if self.info:
notes += "; ".join([self.info.notes] + self.info.issues)
notes = "; ".join([notes, self.info.notes] + self.info.issues)
return notes or None

@property
Expand Down Expand Up @@ -649,6 +649,8 @@ def keywords(self) -> list[str]:
self.keywords.append("injection_control")
if self.is_context_naive:
self.keywords.append("context_naive")
if self.is_naive:
self.keywords.append("naive")
if self.is_task and self.is_late_autorewards:
self.keywords.append("late_autorewards")
elif self.is_task:
Expand Down Expand Up @@ -1947,6 +1949,19 @@ def is_injection_control(self) -> bool:
return v
return False

@property
def is_naive(self) -> bool:
if (v := getattr(self, "_is_naive", None)) is not None:
return v
if self.is_templeton:
logger.warning(f"{self.id} is a Templeton session: returning is_naive = False, but we don't currently track this")
return False
if self.info is None:
return True
if not self.info.training_info:
return True
return self.info.behavior_day == 1

@property
def is_context_naive(self) -> bool:
if (v := getattr(self, "_is_context_naive", None)) is not None:
Expand Down

0 comments on commit d335fa2

Please sign in to comment.