Skip to content

Commit

Permalink
Add GGIR times and fix faulty detection of non-wear on incomplete dat…
Browse files Browse the repository at this point in the history
…a days (#57)

* Add GGIR times

* Fix faulty detection of non-wear on incomplete data days
  • Loading branch information
reindervdw-cmi authored Jan 29, 2024
1 parent 3377f71 commit 231a752
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/actigraphy/components/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,12 @@ def _build_figure( # noqa: PLR0913
non_wear_fractions = [
value / max_measurements for value in continuous_non_wear_blocks
]
all_timepoints_included = len(timestamps) == max_measurements
if not all_timepoints_included:
includes_start = timestamps[0].hour == 12 and timestamps[0].minute == 0 # noqa: PLR2004
if not includes_start:
offset = 1 - len(timestamps) / max_measurements
non_wear_fractions = [fraction + offset for fraction in non_wear_fractions]

for index in range(0, len(non_wear_fractions), 2):
sensor_plots.add_rectangle(
Expand Down

0 comments on commit 231a752

Please sign in to comment.