Skip to content

Commit

Permalink
Merge pull request #28 from ffverse/dev
Browse files Browse the repository at this point in the history
Release 1.1.0 to CRAN
  • Loading branch information
tanho63 committed Sep 11, 2021
2 parents 0b5c5f5 + 700993d commit 6cb80af
Show file tree
Hide file tree
Showing 103 changed files with 3,554 additions and 1,775 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
^codecov\.yml$
^doc$
^Meta$
^CRAN-RELEASE$
4 changes: 3 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
branches:
- main
- dev
- dev
workflow_dispatch:

name: R-CMD-check
Expand Down Expand Up @@ -66,6 +66,8 @@ jobs:
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_github("nflverse/nflreadr")
remotes::install_github("ffverse/ffscrapr@dev")
shell: Rscript {0}

- name: Check
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
run: |
pak::local_system_requirements(execute = TRUE)
pak::local_install_dev_deps()
pak::pak("nflverse/nflreadr")
pak::pak("ffverse/ffscrapr@dev")
pak::pak("covr")
shell: Rscript {0}

Expand Down
25 changes: 11 additions & 14 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,49 +1,46 @@
Package: ffsimulator
Title: Simulate Fantasy Football Seasons
Version: 1.0.0
Version: 1.1.0
Authors@R:
person(given = "Tan",
family = "Ho",
role = c("aut", "cre","cph"),
role = c("aut", "cre", "cph"),
email = "[email protected]",
comment = c(ORCID = "0000-0001-8388-5155"))
Description: Uses bootstrap resampling to run fantasy football season
simulations supported by historical rankings and 'nflfastR' data,
calculating optimal lineups, and returning aggregated results.
License: MIT + file LICENSE
URL: https://ffsimulator.ffverse.com, https://github.com/ffverse/ffsimulator
URL: https://ffsimulator.ffverse.com,
https://github.com/ffverse/ffsimulator
BugReports: https://github.com/ffverse/ffsimulator/issues
Depends:
R (>= 3.5.0)
Imports:
checkmate (>= 2.0.0),
dplyr (>= 1.0.0),
ffscrapr (>= 1.4.3),
cli (>= 3.0.0),
data.table (>= 1.14.0),
ffscrapr (>= 1.4.6),
glue (>= 1.3.0),
httr (>= 1.4.0),
magrittr (>= 1.0.0),
purrr (>= 0.3.0),
nflreadr (>= 1.0.0),
Rglpk (>= 0.6.0),
rlang (>= 0.4.0),
stringr (>= 1.4.0),
tibble (>= 3.0.0),
tidyr (>= 1.0.0)
tidytable (>= 0.6.4)
Suggests:
covr (>= 3.0.0),
forcats (>= 0.5.0),
furrr (>= 0.2.0),
future (>= 1.0.0),
ggplot2 (>= 3.0.0),
ggridges (>= 0.5.0),
knitr (>= 1.0),
progressr (>= 0.8.0),
rmarkdown (>= 2.6),
scales (>= 1.0.0),
testthat (>= 3.0.0),
vdiffr (>= 1.0.2)
VignetteBuilder:
knitr
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
Config/testthat/edition: 3
16 changes: 16 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,35 @@ S3method(ffs_rosters,flea_conn)
S3method(ffs_rosters,mfl_conn)
S3method(ffs_rosters,sleeper_conn)
S3method(plot,ff_simulation)
S3method(plot,ff_simulation_week)
S3method(print,ff_simulation)
S3method(print,ff_simulation_week)
export("%>%")
export(.ffs_cache)
export(autoplot.ff_simulation)
export(autoplot.ff_simulation_week)
export(espn_connect)
export(ff_connect)
export(ff_scoringhistory)
export(ff_simulate)
export(ff_simulate_week)
export(ff_starter_positions)
export(ffs_adp_outcomes)
export(ffs_adp_outcomes_week)
export(ffs_build_schedules)
export(ffs_copy_template)
export(ffs_franchises)
export(ffs_generate_projections)
export(ffs_generate_projections_week)
export(ffs_latest_rankings)
export(ffs_optimise_lineups)
export(ffs_optimize_lineups)
export(ffs_repeat_schedules)
export(ffs_rosters)
export(ffs_schedule)
export(ffs_score_rosters)
export(ffs_starter_positions)
export(ffs_summarise_inseason)
export(ffs_summarise_season)
export(ffs_summarise_simulation)
export(ffs_summarise_week)
Expand All @@ -32,6 +44,9 @@ export(ffs_summarize_week)
export(fleaflicker_connect)
export(mfl_connect)
export(sleeper_connect)
importFrom(data.table,.N)
importFrom(data.table,.SD)
importFrom(data.table,`:=`)
importFrom(ffscrapr,espn_connect)
importFrom(ffscrapr,ff_connect)
importFrom(ffscrapr,ff_scoringhistory)
Expand All @@ -43,4 +58,5 @@ importFrom(magrittr,"%>%")
importFrom(rlang,.data)
importFrom(rlang,.env)
importFrom(rlang,`%||%`)
importFrom(stats,median)
importFrom(utils,str)
30 changes: 30 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# ffsimulator 1.1.0

This release of ffsimulator adds new features and refactors a lot of the backend for improved calculation efficiency.

## New features

- `ff_simulate_week()` is a new function (and supporting internal function family) that simulates upcoming inseason weeks with daily-updated upcoming week ranks.
- `ff_simulate()` gains an `actual_schedule` argument to simulate actual schedule + unplayed games.
- `ff_simulate()` and `ff_simulate_week()` gain a `verbose` argument that is set ON by default and can also be turned off with `options(ffsimulator.verbose = FALSE)`
- `ffs_copy_template()` helps build custom simulations by copying a template of starter code to a desired filepath.
- Simulations now support kickers (you can thank SFB for that!) and gain a `pos_filter` argument.

## Backend changes

Many backend changes - some are breaking (***grimaces and points at the experimental badge***).

- Parallel options removed in favour of data.table options. ***BREAKING*** - parallel is gone.
- Column assertions should be clearer on each error message.
- Many functions, including `ffs_optimise_lineups()`, `ffs_score_rosters()`, and more are now written in data.table - this helps improve speed for all sizes of simulations.
- `injury_model` argument is now renamed to `gp_model`. ***BREAKING*** - argument name changed.
- `autoplot()` refactored to hide legend and axis titles via geom/scale and not via theme - this allows for much easier theming (since you can apply a whole new theme via `+`).
- `ffs_build_schedules()` now matches syntax from `ffscrapr::ff_schedule()` - `team` is now `franchise_id` and `opponent` is now `opponent_id` - ***BREAKING*** - output column names changed.
- `ffs_build_schedules()` is now responsible for joining franchises to the schedule, and not `ffs_summarise_week()`, and now takes a franchises dataframe as created by `ffs_franchises()` ***BREAKING***
- `ffs_repeat_schedules()` supports the actual_schedule feature by repeating it by `n_seasons`.
- Print methods cleaned up.

Immensely grateful to everyone who used and shared the first release of this package - it's been very motivating! Special thanks to [@JoeSydlowski](https://github.com/joesydlowski), [@topfunky](https://github.com/topfunky), [@mrcaseb](https://github.com/mrcaseb) for their contributions and feedback.

---

# ffsimulator 1.0.0

The `ffsimulator` package uses bootstrap resampling to run fantasy football season simulations supported by historical rankings and nflfastR data, calculating optimal lineups, and returning aggregated results.
Expand Down
Loading

0 comments on commit 6cb80af

Please sign in to comment.