Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: style errors from productivity measurement PR #480

Merged
merged 33 commits into from
Aug 25, 2023
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
058a158
check for long gaps in recording
angelala3252 Jun 7, 2023
6b53fcd
display basic productivity data in html page similar to visualize
angelala3252 Jun 8, 2023
a3a3985
show images for each window change
angelala3252 Jun 8, 2023
9cbb8c1
show productivity info for each window
angelala3252 Jun 8, 2023
61e81d4
WIP find tasks/cycles of ActionEvents
angelala3252 Jun 8, 2023
f9f7743
WIP find tasks/cycles of ActionEvents
angelala3252 Jun 9, 2023
8bf5c21
WIP implementing brent's algorithm
angelala3252 Jun 12, 2023
d3def91
implemented brent's algorithm
angelala3252 Jun 13, 2023
85217bf
add task duration info + style changes to display
angelala3252 Jun 14, 2023
c58d312
comments
angelala3252 Jun 15, 2023
b1a908c
floyd's algorithm and basic implementation of counting errors
angelala3252 Jun 21, 2023
94c4434
implement longest repeated non-overlapping substring algorithm
angelala3252 Jun 23, 2023
e78a67c
removed unused code
angelala3252 Jun 26, 2023
17f2da9
small bug fixes
angelala3252 Jun 26, 2023
08607bf
no empty window titles
angelala3252 Jun 27, 2023
9d05936
Merge branch 'MLDSAI:main' into feat/productivity
angelala3252 Jun 27, 2023
144115b
small fixes
angelala3252 Jun 27, 2023
4135e2d
add title
angelala3252 Jun 28, 2023
70467d3
edge case
angelala3252 Jun 29, 2023
13ceb30
make longest repeated substring recursive
angelala3252 Jul 7, 2023
7567bfc
changed window/tab switching
angelala3252 Jul 31, 2023
a929050
add number of actions in a task
angelala3252 Aug 4, 2023
b537403
add comments
angelala3252 Aug 4, 2023
fac47e7
Merge branch 'OpenAdaptAI:main' into feat/productivity
angelala3252 Aug 4, 2023
0bd7d13
make sure no non-repeating tasks are found
angelala3252 Aug 4, 2023
8ee8cda
fix off by 1 error with window event screenshots
angelala3252 Aug 4, 2023
e22cf38
remove unused functions, comments, and some refactoring
angelala3252 Aug 4, 2023
5c1d1f4
docstrings
angelala3252 Aug 4, 2023
e50e81a
black
angelala3252 Aug 4, 2023
656fe22
Undo changing PLOT_PERFORMANCE
angelala3252 Aug 4, 2023
a9b49ec
style changes
angelala3252 Aug 25, 2023
28133b0
resolve merge conflicts
angelala3252 Aug 25, 2023
a6c183d
Merge branch 'main' of https://github.com/angelala3252/OpenAdapt into…
angelala3252 Aug 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 11 additions & 27 deletions openadapt/productivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,33 @@

Usage:

$ python openadapt/productivity.py"
$ python -m openadapt.productivity
"""

from pprint import pformat
from threading import Timer
from typing import Optional, Tuple
import os
import string
from typing import Optional, Tuple

from bokeh.io import output_file, show
from bokeh.layouts import layout, row
from bokeh.models.widgets import Div
from loguru import logger

from openadapt.crud import get_latest_recording, get_window_events

from openadapt.events import (
get_events,
)

from openadapt.events import get_events
from openadapt.models import ActionEvent, WindowEvent
from openadapt.utils import (
configure_logging,
display_event,
image2utf8,
row2dict,
rows2dicts,
)

from openadapt.visualize import IMG_WIDTH_PCT, MAX_EVENTS, dict2html

from openadapt.models import (
ActionEvent,
Screenshot,
WindowEvent,
)

CSS = string.Template(
"""
CSS = string.Template("""
table {
outline: 1px solid black;
}
Expand All @@ -62,8 +51,7 @@
.screenshot:active img:nth-child(1) {
display: block;
}
"""
).substitute(
""").substitute(
IMG_WIDTH_PCT=IMG_WIDTH_PCT,
)

Expand Down Expand Up @@ -178,7 +166,7 @@ def find_num_tasks(
action_events: list[ActionEvent],
start: ActionEvent,
length: int,
task: Optional[ActionEvent] = None,
task: Optional[list[ActionEvent]] = None,
) -> Tuple[list[ActionEvent], int, float]:
"""
Given a list of ActionEvents, the start of a repeating task, the length of the task, and
Expand Down Expand Up @@ -586,13 +574,11 @@ def calculate_productivity():
</table>
""",
),
Div(
text=f"""
Div(text=f"""
<table>
{dict2html(window_info)}
</table>
"""
),
"""),
),
]
)
Expand Down Expand Up @@ -639,13 +625,11 @@ def calculate_productivity():
</table>
""",
),
Div(
text=f"""
Div(text=f"""
<table>
{dict2html(window_info)}
</table>
"""
),
"""),
),
]
)
Expand Down