Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

buildWithinGenerations() and buildBetweenGenerations() accept beta = "optimized"/"indexed" but pass these strings to helpers that use if (beta) checks, causing errors.

Changes

  • Parameter normalization: Added validation logic in both entry-point functions to convert string aliases to logical values before calling helpers:

    • "optimized"TRUE
    • "base", "original"FALSE
    • "index", "indexed" → throw "not yet implemented" error
  • Consistency fixes: Made both functions check for unimplemented aliases first, support the same set of string values, and use identical error messages

  • Test coverage: Added tests verifying string aliases produce identical results to their boolean equivalents

Example

# These now work identically
simulatePedigree(beta = TRUE)
simulatePedigree(beta = "optimized")

# As do these
simulatePedigree(beta = FALSE)
simulatePedigree(beta = "base")
simulatePedigree(beta = "original")

Downstream functions (createGenDataFrame, determineSex, assignCoupleIDs, adjustKidsPerCouple, markPotentialChildren) now always receive TRUE or FALSE, never strings.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 28, 2026 03:14
…downstream functions

Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
…all string aliases

Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
@smasongarrison smasongarrison marked this pull request as ready for review January 28, 2026 03:17
… alias

Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
Copilot AI changed the title [WIP] Update pedigree simulation code normalization improvements Normalize beta parameter string aliases before calling downstream functions Jan 28, 2026
Copilot AI requested a review from smasongarrison January 28, 2026 03:19
@smasongarrison smasongarrison merged commit 7ee37c3 into dev_main Jan 28, 2026
6 checks passed
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.37%. Comparing base (109e55c) to head (5c43f45).
⚠️ Report is 1 commits behind head on dev_main.

Files with missing lines Patch % Lines
R/simulatePedigree.R 81.81% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           dev_main     #111      +/-   ##
============================================
+ Coverage     84.31%   84.37%   +0.06%     
============================================
  Files            27       27              
  Lines          4228     4238      +10     
============================================
+ Hits           3565     3576      +11     
+ Misses          663      662       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@smasongarrison smasongarrison deleted the copilot/sub-pr-109 branch January 28, 2026 03:30
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.

2 participants