Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ActivityTracker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
willm3
ActivityTracker
Merge requests
!12
Functionally test write to db
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Functionally test write to db
wmalisch/dev2
into
main
Overview
2
Commits
1
Pipelines
0
Changes
3
Merged
willm3
requested to merge
wmalisch/dev2
into
main
1 year ago
Overview
2
Commits
1
Pipelines
0
Changes
3
Expand
Created by: wmalisch
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
a419c048
1 commit,
1 year ago
3 files
+
11
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
src/activity.py
+
6
−
2
Options
from
scipy.signal
import
find_peaks
from
sqlite_db_client
import
SQLiteDBClient
from
src.
sqlite_db_client
import
SQLiteDBClient
from
pathlib
import
Path
import
numpy
as
np
import
time
@@ -15,8 +15,12 @@ class Activity:
try
:
print
(
"
Activity started.
"
)
self
.
running
=
True
magnitudes
=
[]
start_date
=
time
.
strftime
(
'
%Y-%m-%d
'
)
start_time
=
time
.
strftime
(
'
%H:%M:%S
'
)
# Write accelerometer data to disk as a default in case we need to back it up later
timestamp
=
int
(
time
.
time
())
output_file_path
=
Path
(
f
"
outputs/
{
timestamp
}
.csv
"
).
resolve
()
@@ -64,7 +68,7 @@ class Activity:
end_date
=
time
.
strftime
(
'
%Y-%m-%d
'
)
end_time
=
time
.
strftime
(
'
%H:%M:%S
'
)
steps_count
=
len
(
steps
)
self
.
db_client
.
update
_activity_entry
(
timestamp
,
end_date
,
end_time
,
steps_count
)
self
.
db_client
.
insert
_activity_entry
(
start_date
,
start_time
,
end_date
,
end_time
,
steps_count
)
return
True
Loading