wadpac / GGIRread

Functions for reading accelerometer data files
https://CRAN.R-project.org/package=GGIRread
Apache License 2.0
5 stars 3 forks source link

"stoll: no conversion" error when GGIRread::readGENEActiv tries reading mode data than available #58

Closed l-k- closed 4 months ago

l-k- commented 5 months ago

Whenever readGENEActiv() gets a request for a block of data that is bigger than what's left in the file, we get an error that looks like this: "data error at i = %d: %s i: 231 stoll: no conversion"

Below is a screenshot of this error during execution of test_greadaccfile GGIR test:

image

This is triggered by an attempt to read past the end of the file, and in this context it's really not an error but an expected signal that we reached the end of the file. When more data is requested than available, readGENEActiv() simply returns what's available; this is normal behavior, not an error.

So there's no need to print out an error, in red, making it look like something went wrong.

Also, string formatting for the error messages needs to be fixed (it looks like the printf-style formatting is used with streams).

I will send a PR to address this.