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

undo 3 line changes from commit 3b9e2b7, fixes #1221 #1222

Merged
merged 4 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

- Part 1: Tidied up code in internal function detect_nonwear_clipping.R to ease future reviews. #1212

- Part 4: Undo changes to 3 line in g.part4 function from commit 3b9e2b7 (in between 3.1-1 and 3.1-2 release in June 2024) which broke functionality for handling sleep that starts before the double DST hour in the autumn and ends inside it. #1221

# CHANGES IN GGIR VERSION 3.1-4

- Part 3: Update threshold used for HorAngle to 60 degree, and auto-setting HASPT.ignore.invalid to NA when NotWorn guider is used. #1186
Expand Down
7 changes: 4 additions & 3 deletions R/g.part4.R
Original file line number Diff line number Diff line change
Expand Up @@ -814,9 +814,10 @@ g.part4 = function(datadir = c(), metadatadir = c(), f0 = f0, f1 = f1,
# in the autumn and ends inside the dst hour
negval = which(nocs < 0)
if (length(negval) > 0) {
kk0 = as.numeric(spocum.t$start[negval]) # episode onsets
kk1 = as.numeric(spocum.t$end[negval]) + 1 # episode endings
nocs[negval] = kk1 - kk0
kk0 = as.numeric(spocum.t$start[which(spocum.t$overlapGuider == 1)]) # episode onsets
kk1 = as.numeric(spocum.t$end[which(spocum.t$overlapGuider == 1)]) # episode endings
kk1[negval] = kk1[negval] + 1
nocs = kk1 - kk0
}
if (length(nocs) > 0) {
spocum.t.dur.noc = sum(nocs)
Expand Down
Loading