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

Extract GENEActiv starttime from first page header. #57

Merged
merged 12 commits into from
Jan 24, 2024
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- Describe your PR here -->

<!-- Please, make sure the following items are checked -->
Checklist before merging:

- [ ] Existing tests still work (check by running the test suite, e.g. from RStudio).
- [ ] Added tests (if you added functionality) or fixed existing test (if you fixed a bug).
- [ ] Updated or expanded the documentation.
- [ ] Updated release notes in `inst/NEWS.Rd` with a user-readable summary. Please, include references to relevant issues or PR discussions.
- [ ] Added your name to the contributors lists in the `DESCRIPTION` file, if you think you made a significant contribution.
28 changes: 24 additions & 4 deletions .github/workflows/r_codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
Expand All @@ -23,8 +23,28 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: covr
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
8 changes: 8 additions & 0 deletions R/readGENEActiv.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ readGENEActiv = function(filename, start = 0, end = 0, progress_bar = FALSE,
x = gsub(pattern = "Device Model:", replacement = "",
x = fh[grep(pattern = "Device Model", x = fh)[1]]))

if (starttime == "2010-09-16 09:10:00:000") {
l-k- marked this conversation as resolved.
Show resolved Hide resolved
# If recording started at this specific date and time then
# that indicates a known incorrectness of the timestamp (based on
# correspondence with manufacturer). In this case we should use the
# timestamp from first page instead.
starttime = gsub(pattern = "Page Time:", replacement = "",
x = fh[grep(pattern = "Page Time", x = fh)[1]])
}

# Read acceleration, lux and temperature data
rawdata = GENEActivReader(filename = filename,
Expand Down
14 changes: 14 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true
5 changes: 5 additions & 0 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
\name{NEWS}
\title{News for Package \pkg{GGIRread}}
\newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
\section{Changes in version 0.3.3 (GitHub-only-release date:23-01-2024)}{
\itemize{
\item When GENEActiv device battery runs low before downloading data the timestamp in the file header will default to 2010-9-16. This is now corrected by using the timestamp from the first page header instead, issue #56
}
}
\section{Changes in version 0.3.2 (GitHub-only-release date:05-12-2023)}{
\itemize{
\item Improved handling of failed checksum in .cwa files #53 (credits: Lena Kushleyeva)
Expand Down
Loading