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

Identical sleep on #31

Open
muschellij2 opened this issue Dec 10, 2020 · 1 comment
Open

Identical sleep on #31

muschellij2 opened this issue Dec 10, 2020 · 1 comment

Comments

@muschellij2
Copy link
Contributor

I've seen identical sleep_ON times, so

stopifnot(all(
would fail. I'm not sure if this should be a failure rather than a warning, but it makes it so you can't read in the gt3x. Can't share it (IRB), so it's hard give a minimal working example.

@paulhibbing
Copy link
Owner

Thanks John. Sorry you keep running into these checks I put in... I do think they're worth it, to help me spot places where my underlying assumptions are not correct.

In this case, could it just be changed to the following?

stopifnot(all(
  sign(as.numeric(diff(
    events$idle_sleep_events$sleep_ON
  )))%in%0:1
))

Ideally that's a permanent solution, but in my mind it's tentative for now. It should at least get the file to run, and from there I'd like to understand the behavior a little more before settling on a permanent solution. I don't understand why multiple events would be logged for the same timestamp, and I'm also uncertain if both events will have a corresponding sleep_OFF occurrence. If not, this is going to be trickier to fix.

No worries on not being able to share the file. Could you try the above and let me know how it goes? For internal testing, I usually convert the gt3x to csv in ActiLife, and then make sure I get consistent output from read_gt3x and read_AG_raw(file, return_raw = TRUE). It's probably sufficient to compare using all.equal(gt3x, raw, scale = 1, tolerance = 0.001, check.attributes = FALSE), but I like to also run it through PAutilities::test_errors. The latter takes a little bit of finagling, so I'm fine if you want to skip it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants