[WIP] Outline screen feature calculation in TODOs.

communication
junos 2021-07-22 15:19:15 +02:00
parent 77c2ba87d5
commit 78d6e020ae
1 changed files with 20 additions and 0 deletions

View File

@ -30,3 +30,23 @@ def get_screen_data(usernames: Collection) -> pd.DataFrame:
with db_engine.connect() as connection: with db_engine.connect() as connection:
df_screen = pd.read_sql(query_screen.statement, connection) df_screen = pd.read_sql(query_screen.statement, connection)
return df_screen return df_screen
def identify_screen_sequence(df_screen: pd.DataFrame) -> pd.DataFrame:
# TODO Implement a method that identifies "interesting" sequences of screen statuses.
# The main one are:
# - OFF -> ON -> unlocked (a true phone unlock)
# - OFF -> ON -> OFF/locked (no unlocking, i.e. a screen status check)
# Consider that screen data is sometimes unreliable as shown in expl_screen.ipynb:
# "I have also seen off -> on -> unlocked (with 2 - locked missing)
# and off -> locked -> on -> off -> locked (*again*)."
# Either clean the data beforehand or deal with these inconsistencies in this function.
pass
def time_screen_sequence(df_screen: pd.DataFrame) -> pd.DataFrame:
# TODO Use the results of indentify_screen_sequence to calculate time statistics related to transitions.
# For example, from the two main sequences outlined above, the time of "real" phone usage can be calculated,
# i.e. how long the screen was unlocked.
# Another example might be the average time between screen unlocks and/or screen status checks.
pass