Skip to content

Convert setPheno and crossing functions to S4 generics; add Pop/MultiPop methods, centralize internals, and update docs#20

Open
mghaderizefreh wants to merge 2 commits intoHighlanderLab:develfrom
mghaderizefreh:genericPop
Open

Convert setPheno and crossing functions to S4 generics; add Pop/MultiPop methods, centralize internals, and update docs#20
mghaderizefreh wants to merge 2 commits intoHighlanderLab:develfrom
mghaderizefreh:genericPop

Conversation

@mghaderizefreh
Copy link
Copy Markdown

Summary

  • Refactors key APIs to S4 generics to enable method dispatch and easier extension to new classes.
  • No intended changes to user-facing behavior for existing Pop workflows.

Key changes

  • setPheno
    • Converted to an S4 generic
      (setGeneric("setPheno", ...)).
    • Added methods for Pop and MultiPop (is this needed?).
    • Extracted shared implementation into
      .setPheno_internal().
    • Exported method in NAMESPACE and updated Rd with method aliases and usage.
  • Crossing API (R/crossing.R)
    • Converted the following to S4 generics with Pop methods and shared internal implementations:
      • makeCross → .makeCross_internal
      • makeCross2 → .makeCross2_internal
        (methods for females = Pop, males = Pop)
      • randCross → .randCross_internal
      • randCross2 → .randCross2_internal
        (methods for females = Pop, males = Pop)
      • selectCross → .selectCross_internal
      • self → .self_internal
      • makeDH → .makeDH_internal
  • Minor spelling fixes in error messages and docs:
  • sortPed error now references “maxCycle” consistently.

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.

1 participant