Skip to content

Commit

Permalink
Remove the config variable from battery, screen, tracker and application
Browse files Browse the repository at this point in the history
  • Loading branch information
rantahar committed Oct 21, 2024
1 parent b7fa06f commit 3209292
Show file tree
Hide file tree
Showing 7 changed files with 883 additions and 983 deletions.
1,510 changes: 767 additions & 743 deletions docs/user_guide/preprocessing/screen.ipynb

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions docs/user_guide/preprocessing/tracker.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -209,34 +209,34 @@
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>user</th>\n",
" <th>median_sum_step</th>\n",
" <th>user</th>\n",
" <th>std_sum_step</th>\n",
" <th>min_sum_step</th>\n",
" <th>avg_sum_step</th>\n",
" <th>max_sum_step</th>\n",
" <th>std_sum_step</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>wiam9xme</td>\n",
" <td>6480.0</td>\n",
" <td>wiam9xme</td>\n",
" <td>3352.347745</td>\n",
" <td>5616</td>\n",
" <td>8437.383562</td>\n",
" <td>13025</td>\n",
" <td>3352.347745</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" user median_sum_step min_sum_step avg_sum_step max_sum_step \\\n",
"0 wiam9xme 6480.0 5616 8437.383562 13025 \n",
" median_sum_step user std_sum_step min_sum_step avg_sum_step \\\n",
"0 6480.0 wiam9xme 3352.347745 5616 8437.383562 \n",
"\n",
" std_sum_step \n",
"0 3352.347745 "
" max_sum_step \n",
"0 13025 "
]
},
"execution_count": 4,
Expand Down Expand Up @@ -269,7 +269,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"{<function tracker_step_distribution at 0x764083087880>: {}} {}\n"
"{<function tracker_step_distribution at 0x76fe73d9b920>: {}} {}\n"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions niimpy/preprocessing/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def app_count(df, bat=None, screen=None, config=None):

# Insert missing data due to the screen being off or battery depleated
if not screen.empty:
screen = s.screen_off(screen, bat, config)
screen = s.screen_off(screen, bat, **config)
if type(screen.index) == pd.MultiIndex:
screen.reset_index(inplace=True)
screen.set_index("index", inplace=True)
Expand All @@ -372,7 +372,7 @@ def app_count(df, bat=None, screen=None, config=None):
df2.fillna({"app_group": "off"}, inplace=True)

if screen.empty and not bat.empty:
shutdown = b.shutdown_info(bat, config)
shutdown = b.shutdown_info(bat, **config)
shutdown = shutdown.replace([-1, -2], "off")
if type(shutdown.index) == pd.MultiIndex:
shutdown.reset_index(inplace=True)
Expand Down Expand Up @@ -449,7 +449,7 @@ def app_duration(df, bat=None, screen=None, config=None):

# Insert missing data due to the screen being off or battery depleated
if not screen.empty:
screen = s.screen_off(screen, bat, config)
screen = s.screen_off(screen, bat, **config)
if type(screen.index) == pd.MultiIndex:
screen.reset_index(inplace=True)
screen.set_index("index", inplace=True)
Expand All @@ -458,7 +458,7 @@ def app_duration(df, bat=None, screen=None, config=None):
df2.fillna({"app_group": "off"}, inplace=True)

if screen.empty and not bat.empty:
shutdown = b.shutdown_info(bat, config)
shutdown = b.shutdown_info(bat, **config)
shutdown = shutdown.replace([-1, -2], "off")
if type(shutdown.index) == pd.MultiIndex:
shutdown.reset_index(inplace=True)
Expand Down
Loading

0 comments on commit 3209292

Please sign in to comment.