bhelsel / agcounts

R package for extracting actigraphy counts from accelerometer data.
Other
9 stars 5 forks source link

Unit tests #2

Closed paulhibbing closed 2 years ago

paulhibbing commented 2 years ago

A future objective could be to set up unit tests with some sample files to make sure the R code produces output that matches with Actilife.

clevengerkimberly commented 2 years ago

I just did this with 66 lab files using a 1, 5, 10, 15, 30, and 60-sec epoch and differences were only due to rounding differences (e.g., means of 47.72 versus 47.68 counts/sec for ActiLife versus agcounts). I will be uploading these findings online soon and will be doing the same with free-living data, hopefully tomorrow.

paulhibbing commented 2 years ago

That's excellent Kim! Having a file or two in the repository here would be nice as well, to ensure that any future changes to the code (e.g., to increase runtime, though I don't see that as an issue anyway) don't lead to changed output. Hadley's chapter is useful here.

clevengerkimberly commented 2 years ago

Thank you- I didn't know what you meant by unit testing, so this is really helpful!

paulhibbing commented 2 years ago

Sure thing -- Also, looking back to my prior comment, hopefully no future efforts are devoted to "increasing runtime". Improving it, maybe. But not increasing...

bhelsel commented 2 years ago

@paulhibbing I added 2 unit tests in agcounts v0.3.0. One of the tests compares the counts generate from agcounts with Actilife counts and the other test checks the expected output at each stage of the algorithm. I'm closing this issue, but welcome your thoughts on additional tests as you see fit in future releases.