Description
Hello!
I ran g.shell.GGIR
with all the default parameters on a sample 123A_testaccfile.csv
file generated by create_test_acc_csvz()
, and I got an error during part 3 processing:
Part 3
Busy processing ... see /Users/lk/acc_results/output_acc_data/ms3 for progress
Errors and warnings for 123A_testaccfile.csv.RData$message
[1] "object 'daysleep_offset' not found"$call
g.sib.det(M, IMP, I, twd = c(-12, 12), timethreshold = timethreshold,
anglethreshold = anglethreshold, acc.metric = acc.metric,
desiredtz = desiredtz, constrain2range = constrain2range,
dayborder = dayborder, myfun = myfun)
The problem is that in g.sib.det.R
, daysleep_offset
variable isn't assigned a default value for single-midnight files. This was addressed for multi-midnight files in #325 , but the single-midnight scenario was missed.
I'm sending a quick one-line pull request to address this.
But I'm also wondering if you'd want g.sib.det.R
rewritten to to combine the two nearly identical "Estimate Sleep Period Time window" blocks into one (I would give it a shot, but don't want to step on anyone's toes!)
I'm concerned that with time people will be inconsistently editing these two blocks and they will start diverging, creating issues. For instance I'm wondering if it's indeed correct that daysleep_offset
is accounted for in
Lines 336 to 337 in d0af9d0
but not in its single-midnight equivalent:
Lines 245 to 246 in d0af9d0
I might be overthinking this a bit, but please let me know what your thoughts on this code duplication are.
thank you!
-Lena
Activity