Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{simulist} v0.3.0 full package review #117

Closed
wants to merge 487 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
487 commits
Select commit Hold shift + click to select a range
bdc3fe4
Update CITATION.cff
actions-user Jan 8, 2024
38fc30c
Add DOI to README & CITATION (#56)
Bisaloo Jan 11, 2024
64ee558
add WIP .sim_network_bp function
joshwlambert Jan 12, 2024
effcdf1
fix sampling contacts and bookkeeping ancestors
joshwlambert Jan 15, 2024
329b3bb
fixed sampling contact distribution with replacement
joshwlambert Jan 16, 2024
e23372a
increase size of allocated vectors
joshwlambert Jan 16, 2024
68ce45a
fixed issue counting chain length
joshwlambert Jan 16, 2024
fb7c2b6
simplified vector indexing in .sim_network_bp
joshwlambert Jan 16, 2024
e351faa
simplified next_gen_size calculation in .sim_network_bp
joshwlambert Jan 16, 2024
41377ab
remove preallocation of id vec and add vector growing to .sim_network_bp
joshwlambert Jan 16, 2024
92cd518
remove input checking from .sim_network_bp as it is an internal function
joshwlambert Jan 16, 2024
acfac02
updated .check_sim_input with new model arguments
joshwlambert Jan 16, 2024
9b48081
updated .sim_contacts_tbl for new simulation model
joshwlambert Jan 16, 2024
756e11b
updated exported simulation function to use new model arguments
joshwlambert Jan 16, 2024
d333197
updated .sim_bp_linelist to use .sim_network_bp
joshwlambert Jan 16, 2024
1332929
updated add_cols function to sample infected individuals
joshwlambert Jan 16, 2024
5152677
removed contact_distribution from functions that no longer use it
joshwlambert Jan 17, 2024
ccde142
removed documentation for old arguments and added documentation for n…
joshwlambert Jan 17, 2024
83619cb
added details to .sim_network_bp documentation
joshwlambert Jan 17, 2024
78310fc
updated man files for updated functions
joshwlambert Jan 17, 2024
f62a1f9
fix typo converting contact_interval to function in sim_contacts
joshwlambert Jan 17, 2024
2f851c2
fixed examples and inherit doc in .sim_network_bp
joshwlambert Jan 17, 2024
f608936
added tests for .sim_network_bp
joshwlambert Jan 17, 2024
5abcb12
added linelist row filtering to sim_outbreak
joshwlambert Jan 17, 2024
aac0ae1
reduced maximum iterations for simulation conditioning
joshwlambert Jan 17, 2024
33cf465
updated tests to pass with new arguments
joshwlambert Jan 17, 2024
0b616cf
pass add_names argument to .sim_network_bp
joshwlambert Jan 18, 2024
c84df98
update simulation functions to use new arguments in vignettes
joshwlambert Jan 18, 2024
bf46d38
remove mention of bpmodels from the package
joshwlambert Jan 18, 2024
b9bec96
Update CITATION.cff
actions-user Jan 18, 2024
46e9d46
update README to use new simulation function arguments
joshwlambert Jan 18, 2024
fedef56
Automatic readme update
actions-user Jan 18, 2024
5577f65
update mean_contacts to contact_distribution
joshwlambert Jan 19, 2024
4bcf50a
update tests to use contact_distribution instead of mean_contacts
joshwlambert Jan 19, 2024
9b55922
update vignettes and README to use contact_distribution instead of me…
joshwlambert Jan 19, 2024
61d2b8e
Automatic readme update
actions-user Jan 19, 2024
af0e5da
linting
joshwlambert Jan 19, 2024
e0a78ce
increase excess degree distribution density upper bound
joshwlambert Jan 31, 2024
13792b3
update seed in .sim_network_bp test to pass
joshwlambert Jan 31, 2024
c7be8c7
added .sample_names function
joshwlambert Feb 5, 2024
003ff14
use .sample_names in .add_names function
joshwlambert Feb 5, 2024
bfce18e
removed warning and break for large line lists with names in .sim_net…
joshwlambert Feb 5, 2024
c338e34
linting
joshwlambert Feb 5, 2024
e6f6755
added network option to create_config
joshwlambert Feb 6, 2024
e41f950
updated create_config tests
joshwlambert Feb 6, 2024
96ba176
add option to turn off network effect in .sim_network_bp and remove a…
joshwlambert Feb 6, 2024
5bb7705
added test for .sim_network_bp without network effect and update othe…
joshwlambert Feb 6, 2024
ce817a1
removed add_names argument from .sim_network_bp call in sim_* functions
joshwlambert Feb 6, 2024
4c3aab3
removed add_names argument from .sim_bp_linelist
joshwlambert Feb 6, 2024
120f2bc
updated sim_contacts and sim_linelist tests
joshwlambert Feb 6, 2024
ca5b4fa
added info box to simulist vignette on network effect in model
joshwlambert Feb 6, 2024
daacbd7
use snapshot tests for regression testing .sim_network_bp
joshwlambert Feb 6, 2024
b19956d
added more info to add_ct argument, closes #59
joshwlambert Feb 7, 2024
5d7e4ec
remove row names before returning linelist and contact table
joshwlambert Feb 8, 2024
901d7b0
updated testdata README with new function arguments
joshwlambert Feb 8, 2024
6bb3f4a
updated testdata .rds files
joshwlambert Feb 8, 2024
39c0d75
use snapshots for regression testing sim_linelist
joshwlambert Feb 9, 2024
cd80fa7
use snapshots for regression testing sim_contacts
joshwlambert Feb 9, 2024
dcecde7
use snapshots for regression testing sim_outbreak
joshwlambert Feb 9, 2024
912eb78
removed old empty create_linelist test file
joshwlambert Feb 9, 2024
dca20d8
refactor .sim_bp_linelist, .sim_clinical_linelist, and .sim_contacts_…
joshwlambert Feb 9, 2024
9194257
update sim_outbreak, sim_linelist and sim_contacts to use .sim_intern…
joshwlambert Feb 9, 2024
6fdd492
reduced cyclomatic complexity of .sim_internal
joshwlambert Feb 9, 2024
cdbc2d2
updated design principles vignette to mention .sim_internal instead o…
joshwlambert Feb 9, 2024
0789c18
updated sim_contacts and sim_outbreak snapshots
joshwlambert Feb 12, 2024
20892c4
renamed sim_utils file utils as simulation utility functions have bee…
joshwlambert Feb 12, 2024
1f8adae
added NULL argument defaults to .sim_internal for arguments not alway…
joshwlambert Feb 15, 2024
46876f9
added simulist architecture diagram
joshwlambert Feb 15, 2024
de6a010
added architecture diagram to design principles vignette
joshwlambert Feb 15, 2024
142222e
reduce cyclomatic complexity of .check_sim_input and remove nolint flag
joshwlambert Feb 12, 2024
6929cd4
add lint-changed-files GHA workflow as no longer run from .github org…
joshwlambert Feb 12, 2024
d873cb3
added plotting transmission chain to vis-linelist vignette
joshwlambert Feb 16, 2024
1a20ef6
added dplyr as suggested dependency for vignette
joshwlambert Feb 16, 2024
760cab2
updated WORDLIST
joshwlambert Feb 16, 2024
1a7c7e0
Update CITATION.cff
actions-user Feb 16, 2024
a40d972
turn off library_call_linter due to tabset vignette
joshwlambert Feb 16, 2024
d56912c
Add v0.2.0 release notes to NEWS (#71)
joshwlambert Feb 16, 2024
c64c276
removed empty create_linelist.R file
joshwlambert Feb 16, 2024
2bf5822
Update DESCRIPTION
chartgerink Feb 19, 2024
14d951e
put expr as first argument of tryCatch
joshwlambert Feb 21, 2024
a2e58c0
add comment when defining infections
joshwlambert Feb 21, 2024
4baed07
use sex instead of gender in .sim_internal and .sample_names
joshwlambert Feb 21, 2024
4b6b533
update snapshot tests from column header renaming
joshwlambert Feb 21, 2024
9a8da4a
update vignettes from column header renaming
joshwlambert Feb 21, 2024
84799f8
added NEWS item on renaming gender to sex
joshwlambert Feb 21, 2024
3c98336
updated testdata after column renaming
joshwlambert Feb 22, 2024
50584e0
normalise DESCRIPTION
joshwlambert Feb 22, 2024
79d8d29
Update CITATION.cff
actions-user Feb 22, 2024
ba67180
fixed bug for age structured contacts
joshwlambert Feb 22, 2024
d13cd48
added test for age structured contacts
joshwlambert Feb 22, 2024
1c5d150
added sim_contacts snapshot
joshwlambert Feb 22, 2024
8b85ff0
name population_age vector
joshwlambert Feb 22, 2024
7286210
remove defining age_range in sim_contacts as it is not used
joshwlambert Feb 22, 2024
4ebea5b
add NULL default to outbreak_start_date in .add_date_contact
joshwlambert Feb 22, 2024
c5dc8bd
add comment to .add_hospitalisation
joshwlambert Feb 22, 2024
317bd33
add comment on sample implicit rounding
joshwlambert Feb 22, 2024
e0af43d
use typed NA in add_cols functions
joshwlambert Feb 22, 2024
bf6eea2
added lower and upper bounds to case_type_probs assertion
joshwlambert Feb 23, 2024
3275037
added lower and upper bound to contact_tracing_status_probs assertion
joshwlambert Feb 23, 2024
bf89eb7
improve create_config function documentation
joshwlambert Feb 23, 2024
018f9dd
optimise .sim_network_bp by moving contact distribution density outsi…
joshwlambert Feb 23, 2024
c156b51
added @chartgerink and @pratikunterwegs as package reviewers
joshwlambert Feb 23, 2024
3bc5d9a
NEWS.md updates from v0.2.0 package review
joshwlambert Feb 23, 2024
59c1bb2
Update CITATION.cff
actions-user Feb 23, 2024
bc4f85e
update MIT badge URL
joshwlambert Feb 23, 2024
57dc369
Automatic readme update
actions-user Feb 23, 2024
b215404
increment minor version
joshwlambert Feb 23, 2024
93d1927
Update CITATION.cff
actions-user Feb 23, 2024
27d3af9
bump to dev version
joshwlambert Mar 11, 2024
7b9a2d5
Update CITATION.cff
actions-user Mar 11, 2024
6161e1e
fixed simulation index allocation bug, closes #89
joshwlambert Mar 11, 2024
12aa313
updated min_outbreak_size to outbreak_size argument
joshwlambert Mar 11, 2024
3a89c64
updated tests with outbreak_size and added new tests for simulation w…
joshwlambert Mar 11, 2024
f31a38e
updated vignettes to use outbreak_size instead of min_outbreak_size
joshwlambert Mar 11, 2024
9872896
lowered maximum outreak size to 10,000
joshwlambert Mar 12, 2024
c4eee7d
restructured simulist vignette to give more info on reproduction number
joshwlambert Mar 21, 2024
dad2d54
added warning about reproduction number to README
joshwlambert Mar 21, 2024
c3dff91
Automatic readme update
actions-user Mar 21, 2024
ceb8b5d
fixes bug in contact time delay in .sim_network_bp, closes #92
joshwlambert Mar 21, 2024
feae880
update test snapshots for simulation after contact delay bug fix, rel…
joshwlambert Mar 21, 2024
a385c9a
add url to _pkgdown
joshwlambert Mar 22, 2024
943f9e8
updated .sim_network_bp to use infectious period instead of contact i…
joshwlambert Mar 22, 2024
0c90e82
updated functions to use infectious period, relates #61
joshwlambert Mar 22, 2024
4aa1282
updated tests and snapshots with infectious period
joshwlambert Mar 22, 2024
920b7e9
updated vignettes to use infectious period, relates #61
joshwlambert Mar 22, 2024
7bb258d
updated README with infectious period, relates #61
joshwlambert Mar 22, 2024
8a2e01e
Automatic readme update
actions-user Mar 22, 2024
529f90f
updated testdata and testdata README
joshwlambert Mar 22, 2024
f7a1df0
updated RoxygenNote in DESCRIPTION
joshwlambert Apr 4, 2024
fd7ab5d
added is_na function
joshwlambert Apr 4, 2024
1c3dc1b
added tests for is_na function
joshwlambert Apr 4, 2024
4fe3827
fixed link in is_na documentation
joshwlambert Apr 5, 2024
f1ea523
added .cross_check_sim_input and allow NA risks in .check_sim_input
joshwlambert Apr 5, 2024
6c16b02
updated .add_hospitalisation and .add_death to allow NA risks
joshwlambert Apr 5, 2024
aea5a2c
updated sim_linelist and sim_outbreak to use .cross_check_sim_input a…
joshwlambert Apr 5, 2024
28b4444
updated documentation on risks
joshwlambert Apr 5, 2024
fdc9621
added tests for .cross_check_sim_input and .check_sim_input with NA r…
joshwlambert Apr 5, 2024
4c47a1c
updated sim_linelist test to use outbreak_size to ensure linelist is …
joshwlambert Apr 5, 2024
07bd172
updated sim_linelist and sim_outbreak snapshots due to number of rand…
joshwlambert Apr 5, 2024
116b7f9
Update CITATION.cff
actions-user Apr 5, 2024
9188787
added sim_linelist tests for onset-to-event and risk NAs
joshwlambert Apr 5, 2024
6ba1d7a
move some input checking and conversion from sim_linelist and sim_out…
joshwlambert Apr 5, 2024
71430c6
fixed .cross_check_sim_input when onset-to-event dist produces NA
joshwlambert Apr 5, 2024
bb4f6e6
added sim_linelist tests that columns are NA when onset-to-event dist…
joshwlambert Apr 5, 2024
252bf73
Automatic readme update
actions-user Apr 5, 2024
b0fd486
linting checking and utility functions
joshwlambert Apr 5, 2024
4c54346
added simulating without hospitalisation and/or death to simulist vig…
joshwlambert Apr 5, 2024
af56831
added onset_to_recovery to sim_linelist and sim_outbreak, WIP #36
joshwlambert Apr 5, 2024
ed581f8
added onset_to_recovery to as_function, WIP #36
joshwlambert Apr 5, 2024
4cc709f
renamed and updated .add_deaths to .add_outcome, WIP #36
joshwlambert Apr 5, 2024
de218bd
updated .sim_internal to call .add_outcome and use outcome columns, W…
joshwlambert Apr 5, 2024
467d256
added onset_to_recovery to .check_sim_input and updated .cross_check_…
joshwlambert Apr 5, 2024
8368c5c
add tidyr to Suggests in DESCRIPTION
joshwlambert Apr 8, 2024
24bae0a
added data reshaping (base R and tidyverse) to fix vis-linelist vignette
joshwlambert Apr 8, 2024
43eff71
Update CITATION.cff
actions-user Apr 8, 2024
0efb945
updated testdata and testdata README
joshwlambert Apr 10, 2024
b971e3d
updated tests and snapshots with onset-to-recovery, relates #36
joshwlambert Apr 10, 2024
c073d76
linting
joshwlambert Apr 10, 2024
9e2a399
added time_varying_death_risk to create_config, WIP #36
joshwlambert Apr 10, 2024
00222a9
updated create_config tests
joshwlambert Apr 10, 2024
e648989
updated .add_outcome to use time-varying death risk if specified in c…
joshwlambert Apr 10, 2024
86c9a07
updated .add_outcome tests
joshwlambert Apr 10, 2024
fd80910
added config argument to .add_outcome call in .sim_internal
joshwlambert Apr 10, 2024
b3fedc9
added bullet point on type checking the config list to the design-pri…
joshwlambert Apr 10, 2024
eda9194
updated create_config documentation
joshwlambert Apr 11, 2024
7a140d3
updated wording of input checking for create_config point in design-p…
joshwlambert Apr 11, 2024
a95ae9a
added first draft of time-varying-cfr vignette, relates #36
joshwlambert Apr 11, 2024
a343aa1
added time-varying-cfr vignette to _pkgdown.yml reference
joshwlambert Apr 11, 2024
3c8579e
updated WORDLIST
joshwlambert Apr 11, 2024
4abee6d
updated hosp_death_risk and non_hosp_death_risk documentation to incl…
joshwlambert Apr 12, 2024
51276c4
updated time-varying-cfr vignette figure captions, code folding and w…
joshwlambert Apr 12, 2024
d929f56
fix .add_outcome test by adding config argument
joshwlambert Apr 12, 2024
f7c19a4
updating .add_outcome to include time-varying cfr for age-strat risks…
joshwlambert Apr 12, 2024
606db94
linting
joshwlambert Apr 12, 2024
6a55733
ensure .check_func_req_args errors with incorrect function argument n…
joshwlambert Apr 16, 2024
f354a2b
added tests for .check_func_req_args
joshwlambert Apr 16, 2024
509a2d7
fixed time-varying death idx sampling
joshwlambert Apr 16, 2024
5c9b323
updated WORDLIST
joshwlambert Apr 16, 2024
b293b88
added nolint flags and echo expression to time-varying-cfr vignette i…
joshwlambert Apr 16, 2024
7158c96
added sim_linelist tests for time-varying cfr
joshwlambert Apr 16, 2024
50093f2
updated snapshots for sim_linelist tests
joshwlambert Apr 16, 2024
4d2d1c9
added comments to .add_outcome
joshwlambert Apr 19, 2024
321d450
update time_varying_death_risk default in create_config to NULL
joshwlambert Apr 19, 2024
5046cf1
explicitly add number of required args in .check.func_req_args call i…
joshwlambert Apr 19, 2024
654f973
simplify time-varying cfr and remove time_varying_risk internal function
joshwlambert Apr 22, 2024
9cc55ec
add lower and upper bound checks for *_risk arguments
joshwlambert Apr 22, 2024
92695fa
updated time-varying-cfr vignette to use new time_varying_death_risk …
joshwlambert Apr 22, 2024
5079668
updated sim_linelist tests and snapshots for updated time-varying cfr
joshwlambert Apr 22, 2024
fee0046
updated sim_outbreak snapshots for updated time-varying cfr
joshwlambert Apr 22, 2024
d9a2c5d
update .check_func_req_args to check arg names and give more informat…
joshwlambert Apr 24, 2024
bcfd687
updated .check_func_req_args tests
joshwlambert Apr 24, 2024
3d71d9d
updated .check_func_req_args call in .add_outcome
joshwlambert Apr 24, 2024
45e4d3e
vectorise time-varying cfr in apply_death_risk
joshwlambert Apr 25, 2024
6c01118
update sim_linelist and sim_outbreak tests and snapshots
joshwlambert Apr 25, 2024
c5d2c9d
Update CITATION.cff
actions-user Apr 25, 2024
169b81a
remove add_ct argument from functions, WIP #41
joshwlambert Apr 25, 2024
7844eb2
remove add_ct argument from tests, WIP #41
joshwlambert Apr 25, 2024
6599b23
added wrangling-linelist vignette
joshwlambert Apr 25, 2024
0042bb9
added bullet point to design-principles vignette on simulation argume…
joshwlambert Apr 25, 2024
48a5e2a
updated _pkgdown.yml articles
joshwlambert Apr 25, 2024
6044a91
linted wrangling-linelist vignette
joshwlambert Apr 25, 2024
0b2979d
updated WORDLIST
joshwlambert Apr 25, 2024
5b2cf64
Use negation for base R col subsetting
joshwlambert Apr 29, 2024
b2cddfb
Use != in base R subsetting
joshwlambert Apr 29, 2024
a79290d
removed eval=FALSE code from wrangling-linelist vignette
joshwlambert Apr 29, 2024
d561393
added .anonymise function, WIP #41
joshwlambert Apr 26, 2024
0a54fac
added tests for .anonymise
joshwlambert Apr 26, 2024
75ff0e5
updated .add_names to use .anonymise, WIP #41
joshwlambert Apr 26, 2024
3441efe
replace add_names argument with anonymise, WIP #41
joshwlambert Apr 26, 2024
3cc4997
add anonymise argument to sim_contacts
joshwlambert Apr 26, 2024
41673f3
updated documentation for anonymise
joshwlambert Apr 26, 2024
6a3bdaf
added test for .add_names with anonymise
joshwlambert Apr 26, 2024
8962a9c
updated tests and snapshots using add_names to anonymise
joshwlambert Apr 26, 2024
7047041
updated Anonymous line list section in simulist.Rmd
joshwlambert Apr 26, 2024
7891f3d
updated WORDLIST
joshwlambert Apr 26, 2024
925a436
add CODECOV_TOKEN to test-coverage yaml
joshwlambert Apr 29, 2024
67e7102
removed is_na function and replace with rlang::is_lgl_na
joshwlambert May 7, 2024
2bd2a82
use *_lgl_idx naming
joshwlambert May 7, 2024
fa8bd4c
add bullet point to design-principles vignette on *_idx and *_lgl_idx…
joshwlambert May 7, 2024
fc08743
update WORDLIST
joshwlambert May 7, 2024
5002dd1
started drafting Related projects section of README
joshwlambert Oct 27, 2023
219c131
Automatic readme update
actions-user Oct 30, 2023
4e43693
Automatic readme update
actions-user Apr 29, 2024
ad7a31a
first draft of related projects section in README, relates #21
joshwlambert Apr 29, 2024
ae44270
updated WORDLIST
joshwlambert Apr 29, 2024
0cd94ba
Automatic readme update
actions-user Apr 29, 2024
2708e0a
add generative-nowcasting to related projects in README, closes #16
joshwlambert May 3, 2024
f24b41d
Automatic readme update
actions-user May 3, 2024
86f9568
update WORDLIST
joshwlambert May 3, 2024
e854296
fix wrangling-linelist VignetteIndexEntry
joshwlambert May 3, 2024
718b1b4
add section on related packages that do not simulate line list data t…
joshwlambert May 20, 2024
f63f8fe
the 2 step simulation for LLsim is added to README
joshwlambert May 20, 2024
eb69db4
add footnotes to explain feature table fields in README
joshwlambert May 20, 2024
32a5525
fix footnotes in README feature table
joshwlambert May 20, 2024
8cae63b
Automatic readme update
actions-user May 20, 2024
f2c21eb
Update {epidict} info in README
joshwlambert May 20, 2024
ea68b07
Automatic readme update
actions-user May 20, 2024
7387548
updated WORDLIST
joshwlambert May 20, 2024
5cf8b76
update spelling and WORDLIST
joshwlambert May 20, 2024
3bdc344
Automatic readme update
actions-user May 20, 2024
6d5f8b7
add pkgdown favicons to resolve pkgdown CI failure
joshwlambert May 20, 2024
13b9022
update package architecture figure
joshwlambert May 20, 2024
955f92f
update NEWS.md with v0.3.0 changes
joshwlambert May 21, 2024
9cb4340
update WORDLIST
joshwlambert May 21, 2024
741adbf
reduce image size of package architecture diagram
joshwlambert May 22, 2024
cabd31a
update GHA workflows
joshwlambert May 22, 2024
a9819a5
add update-copyright-year workflow
joshwlambert May 22, 2024
63d0bde
add contributor point to release_bullets
joshwlambert May 22, 2024
535cfb6
update check.env
joshwlambert May 22, 2024
e41cabb
update .gitignore
joshwlambert May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
^.*\.Rproj$
^\.Rproj\.user$
^CITATION\.cff$
^doc$
^Meta$
^tools$
6 changes: 3 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
- 'LICENSE'
- '.Rbuildignore'
- '.github/workflows/R-CMD-check.yaml'
merge_group:
pull_request:
paths:
- 'data/**'
Expand Down Expand Up @@ -62,11 +63,9 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
# Exists since R 4.3.0 but `false` by default
_R_CHECK_LENGTH_COLON_: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -85,6 +84,7 @@ jobs:
id: rcmdcheck
with:
upload-snapshots: true
error-on: '"note"'

# fail-fast but only if rcmdcheck step fails
- name: Manual fail-fast
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/dependency-change.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
pull_request:
paths:
- 'DESCRIPTION'

name: Analyze dependency changes

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write

jobs:
dependency-changes:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: any::pak, glue, gh

- name: Analyze dependency changes
shell: Rscript {0}
run: |
deps_base <- pak::pkg_deps("${{ github.repository }}@${{ github.base_ref }}", dependencies = TRUE) |>
subset(!directpkg) |>
subset(is.na(priority))
# We install from PR number rather than branch to deal with the case
# of PR coming from forks
deps_head <- pak::pkg_deps("${{ github.repository }}#${{ github.event.number }}", dependencies = TRUE) |>
subset(!directpkg) |>
subset(is.na(priority))

deps_added <- deps_head |>
subset(!ref %in% deps_base$ref)

deps_removed <- deps_base |>
subset(!ref %in% deps_head$ref)

if (nrow(deps_added) + nrow(deps_removed) > 0) {

message("Dependencies have changed! Analyzing...")

if (nrow(deps_added) > 0) {
nudge <- "Reach out on slack (`#code-review` or `#help` channels) to double check if there are base R alternatives to the new dependencies.\n"
} else {
nudge <- ""
}

msg <- glue::glue(
.sep = "\n",
"This pull request:",
"- Adds {nrow(deps_added)} new dependencies (direct and indirect)",
"- Adds {length(unique(deps_added$sysreqs))} new system dependencies",
"- Removes {nrow(deps_removed)} existing dependencies (direct and indirect)",
"- Removes {length(unique(deps_removed$sysreqs))} existing system dependencies",
"",
nudge,
"(Note that results may be inaccurate if you branched from an outdated version of the target branch.)"
)

message("Posting results as a pull request comment.")

gh::gh(
"POST /repos/{repo}/issues/{issue_number}/comments",
repo = "${{ github.repository }}",
issue_number = "${{ github.event.number }}",
body = msg
)

}
52 changes: 52 additions & 0 deletions .github/workflows/lint-changed-files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
workflow_dispatch:
pull_request:
branches: [main, master]
paths:
- '**.R'
- '**.Rmd'
- '**/.lintr'
- '**/.lintr.R'

name: lint-changed-files

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-changed-files:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::gh
any::lintr
any::purrr
epiverse-trace/etdev
needs: check

- name: Install package
run: R CMD INSTALL .

- name: Extract and lint files changed by this PR
run: |
files <- gh::gh("/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files")
changed_files <- purrr::map_chr(files, "filename")
all_files <- list.files(recursive = TRUE)
exclusions_list <- as.list(setdiff(all_files, changed_files))
lintr::lint_package(exclusions = exclusions_list)
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
17 changes: 12 additions & 5 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- 'DESCRIPTION'
- '.Rbuildignore'
- '.github/**'
merge_group:
pull_request:
paths:
- 'README.Rmd'
Expand All @@ -44,15 +45,16 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
pkgdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -69,9 +71,14 @@ jobs:
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Check website links
uses: untitaker/[email protected]
with:
args: docs/

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@4.1.4
if: github.event_name != 'merge_group' && github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.6.0
with:
# We clean on releases because we want to remove old vignettes,
# figures, etc. that have been deleted from the `main` branch.
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/render_readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ name: render-readme
on:
workflow_dispatch:
push:
branches:
# This may seem like a no-op but it prevents triggering on tags
# We use '**' rather '*' to accomodate names like 'dev/branch-1'
- '**'
paths:
- 'README.Rmd'
- '.github/workflows/render_readme.yml'
Expand All @@ -34,6 +38,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
render-readme:
Expand All @@ -42,7 +49,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repos
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup R
uses: r-lib/actions/setup-r@v2
Expand Down Expand Up @@ -85,4 +92,5 @@ jobs:
git add man/figures/
fi
git diff-index --quiet HEAD || git commit -m "Automatic readme update"
git pull --rebase origin ${{ github.ref.name }}
git push origin || echo "No changes to push"
37 changes: 34 additions & 3 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- 'inst/**'
- 'DESCRIPTION'
- '.github/workflows/test-coverage.yaml'
merge_group:
pull_request:
paths:
- 'R/**'
Expand All @@ -31,24 +32,54 @@ concurrency:

name: test-coverage

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: covr::codecov(quiet = FALSE)
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
26 changes: 15 additions & 11 deletions .github/workflows/update-citation-cff.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# The action runs when:
# - A new release is published
# - The DESCRIPTION or inst/CITATION are modified
# - Can be run manually
# For customizing the triggers, visit https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
release:
types: [published]
push:
branches:
- main
paths:
- DESCRIPTION
- inst/CITATION
- .github/workflows/update-citation-cff.yaml
workflow_dispatch:

name: Update CITATION.cff
permissions:
contents: write
pull-requests: write

jobs:
update-citation-cff:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand All @@ -45,11 +47,13 @@ jobs:
cff_write(keys = mykeys)

shell: Rscript {0}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update `CITATION.cff`
title: Update `CITATION.cff`
body: |
This pull request updates the citation file, ensuring all authors are credited and there are no discrepancies.

- name: Commit results
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add CITATION.cff
git commit -m 'Update CITATION.cff' || echo "No changes to commit"
git push origin || echo "No changes to commit"
Please verify the changes before merging.
branch: update-citation-cff
Loading
Loading