Skip to content

Issue1513 features expansion calibrate#1514

Merged
vincentvanhees merged 2 commits into
mainfrom
issue1513_featuresExpansionCalibrate
Jun 2, 2026
Merged

Issue1513 features expansion calibrate#1514
vincentvanhees merged 2 commits into
mainfrom
issue1513_featuresExpansionCalibrate

Conversation

@jhmigueles

@jhmigueles jhmigueles commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1513 => This PR fixes an issue in g.calibrate() where assigning EN2 to the features matrix occasionally triggers an out-of-bounds error (features[count:endCount, 1] = EN2). The original expansion logic relied on a check that failed if the incoming EN2 chunk was larger than the remaining empty rows. The fix pre-calculates the exact expected_EN2_length based on the data chunk (use) and dynamically expands the features matrix by the exact deficit plus a 24-hour buffer, ensuring the assignment never fails.

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).
  • Clean code has been attempted, e.g. intuitive object names and no code redundancy.
  • Documentation updated:
    • Function documentation
    • Chapter vignettes for GitHub IO
    • Vignettes for CRAN
  • Corresponding issue tagged in PR message. If no issue exist, please create an issue and tag it.
  • Updated release notes in inst/NEWS.Rd with a user-readable summary. Please, include references to relevant issues or PR discussions.
  • If you think you made a significant contribution, add your name to the contributors lists in the DESCRIPTION, zenodo.json, and inst/CITATION files.
  • GGIR parameters were added/removed. If yes, please also complete checklist below.

If NEW GGIR parameter(s) were added then these NEW parameter(s) are:

  • documented in man/GGIR.Rd
  • included with a default in R/load_params.R
  • included with value class check in R/check_params.R
  • included in table of vignettes/GGIRParameters.Rmd with references to the GGIR parts the parameter is used in.
  • mentioned in NEWS.Rd as NEW parameter

If GGIR parameter(s) were deprecated these parameter(s) are:

  • documented as deprecated in man/GGIR.Rd
  • removed from R/load_params.R
  • removed from R/check_params.R
  • removed from table in vignettes/GGIRParameters.Rmd
  • mentioned as deprecated parameter in NEWS.Rd
  • added to the list in R/extract_params.R with deprecated parameters such that these do not produce warnings when found in old config.csv files.

@vincentvanhees vincentvanhees merged commit 9bcb9a9 into main Jun 2, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

Out-of-bounds error in g.calibrate() when filling up the features matrix

2 participants