Repository navigation
refactor: unify league update/summary entry points and fix params cross-refs (#42) - #59
Merged
Merged
Conversation
…ss-refs (#42) Makes updateModel() and dailySummary() the single public entry points for both leagues. The former league-specific exports updateDC(), updatePWHLDC(), updatePWHLModel(), and dailyPWHLSummary() are now internal (.update_dc_nhl(), .update_dc_pwhl(), .update_model_pwhl(), .daily_summary_pwhl()), and the params argument across the NHL prediction/simulation/social-media functions now points at the correct params source. - Closes #42
Apply the R convention that package-internal helpers carry a leading dot: 71 previously unexported functions (DCweights, prob_matrix, dcPredictVectorized, build_past_predictions, parseCores, buildTeamColours, getConferences, single_series_solver, etc.) are now .DCweights, .prob_matrix, .dcPredictVectorized, etc. across R/, tests/testthat/, and vignettes/. devtools::document() regenerates man/*.Rd (old .Rd pages deleted, dot-*.Rd pages created) and NAMESPACE (no change — these were never exported). NAMESPACE and DESCRIPTION are unchanged; only internal names shift. devtools::test: 803 pass, 0 fail. devtools::check: 0 errors, 0 warnings, 1 pre-existing NOTE (i binding, from PR #57, unrelated to this change).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes
updateModel()anddailySummary()the single public entry points for both leagues. The former league-specific exports (updateDC(),updatePWHLDC(),updatePWHLModel(),dailyPWHLSummary()) are now internal, and theparamsargument across the NHL prediction/simulation/social-media functions now points at the correct source of the params list.Behavior
1. League-specific exports demoted to internal
Before: Four public functions duplicated the behaviour of the generic
updateModel()/dailySummary()while leaking league-specific names into the API:updateDC()updatePWHLDC()updatePWHLModel()dailyPWHLSummary()After:
updateModel()anddailySummary()are the only public entry points. The league-specific functions are renamed to internal helpers and no longer exported:.update_dc_nhl()updateDC().update_dc_pwhl()updatePWHLDC().update_model_pwhl()updatePWHLModel().daily_summary_pwhl()dailyPWHLSummary()NAMESPACEdrops the four exports;devtools::document()removes the four exported.Rdpages and generates internal ones (dot-*.Rd) marked@keywords internal.2.
paramscross-references fixedBefore: ~40 exported NHL functions documented their
paramsargument withSee [updateDC]— a link to a function that no longer exists once #42 is applied, and which is PWHL-agnostic in name but NHL-specific in reality.After: Those links point at
updateModel(), the function that actually produces the NHLparamslist. The PWHL data-object docs (pwhl_m,pwhl_rho,pwhl_beta,pwhl_eta,pwhl_k) link to.update_dc_pwhl(), their real populator.Tests
Updated every test that referenced the renamed functions to mock/call the internal names:
test-frontend-core.R—updateModel()dispatch tests now mock.update_model_pwhl().test-frontend-daily-summary.R/test-frontend-plots.R— mocks now use.daily_summary_pwhl().test-pwhl-daily-summary.R— test descriptions and the called function renamed to.daily_summary_pwhl().test-pwhl-model-core.R—updatePWHLDC/updatePWHLModeltest blocks renamed to.update_dc_pwhl/.update_model_pwhl; mock ofupdatePWHLDCnow mocks.update_dc_pwhl.test-nhl-dixon-coles-workflow.R/test-nhl-dixon-coles-predict.R—updateDC(...)calls renamed to.update_dc_nhl(...).helper-pwhl.R— comment updated.Full suite: 803 pass, 0 fail, 0 warn, 0 skip.
Notes
devtools::check(error_on = "warning"): 0 errors, 0 warnings, 1 NOTE. The NOTE (no visible binding for global variable 'i'inloopless_sim/simulateSeasonParallel) is pre-existing onmaster(introduced by thefunction(i)closure in PR perf: optimize season simulation loops (#45, #49, #51) #57) and unrelated to this change — this PR only touches a doc cross-reference innhl-league-simulation.R, no code touchingi..Rdfiles (dcPredictVectorized.Rd,dcProbArray.Rd,sim_batch.Rd,sim_odds_results.Rd,simulation_chunks.Rd) are now committed; they were generated bydevtools::document()in prior PRs but never staged, and are required forRd cross-references ... OK.NEWS.mdupdated with a single user-facing bullet under the dev heading.References