Skip to content

Commit 4eda6a0

Browse files
sbfnksbfnk-bot
andcommitted
Prepare for 0.5.0 release
- Update version to 0.5.0 - Add release summary and acknowledgments to NEWS.md Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com>
1 parent 199f72d commit 4eda6a0

File tree

5 files changed

+68
-34
lines changed

5 files changed

+68
-34
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: socialmixr
22
Title: Social Mixing Matrices for Infectious Disease Modelling
3-
Version: 0.4.0.9000
3+
Version: 0.5.0
44
Authors@R: c(
55
person("Sebastian", "Funk", , "sebastian.funk@lshtm.ac.uk", role = c("aut", "cre")),
66
person("Lander", "Willem", role = "aut"),
@@ -18,7 +18,7 @@ Description: Provides methods for sampling contact matrices from diary
1818
data for use in infectious disease modelling, as discussed in Mossong
1919
et al. (2008) <doi:10.1371/journal.pmed.0050074>.
2020
License: MIT + file LICENSE
21-
Depends:
21+
Depends:
2222
R (>= 3.5.0)
2323
Imports:
2424
checkmate,

NEWS.md

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,72 @@
1-
# socialmixr (development version)
1+
# socialmixr 0.5.0
22

3-
* Added `assign_age_groups()` and `survey_country_population()` (#131, #226)
3+
This release focuses on improved modularity and flexibility for contact matrix
4+
workflows. Key highlights include new standalone functions for age group
5+
assignment and population data retrieval, more intuitive handling of age
6+
limits, and the beginning of a transition to the
7+
[contactsurveys](https://github.com/epiforecasts/contactsurveys) package for
8+
survey downloads.
49

5-
* `as_contact_survey()` no longer requires `country` and `year` columns. These columns are now auto-detected if present, but surveys without them can be loaded successfully (#193, #199).
10+
## Breaking changes
611

7-
* Reduced verbosity by removing messages about removing participants/contacts with missing ages (#228).
12+
* `contact_matrix()` now preserves all user-specified `age_limits`, even when
13+
no participants exist in some age groups. Previously, age groups beyond the
14+
maximum participant age were silently dropped. Empty age groups now show
15+
0 participants and NA values in the matrix. This may change matrix dimensions
16+
for existing code (@Bisaloo, #144, #231).
817

9-
## Breaking changes
18+
* `contact_matrix(counts = TRUE)$matrix` now returns an array rather than an
19+
xtabs object. This matches the existing output format of
20+
`contact_matrix(counts = FALSE)$matrix` (@Bisaloo, #118).
21+
22+
* When `age_limits` is not specified, it is now inferred from both participant
23+
and contact ages, not just participant ages. This may result in more age
24+
groups if contacts include ages beyond the participant age range (#230).
1025

11-
* When `age.limits` is not specified, it is now inferred from both participant and contact ages, not just participant ages. This may result in more age groups if contacts include ages beyond the participant age range (#230).
26+
## New features
1227

13-
* `contact_matrix()` now preserves all user-specified `age.limits`, even when no participants exist in some age groups. Previously, age groups beyond the maximum participant age were silently dropped. Empty age groups now show 0 participants and NA values in the matrix. This may change matrix dimensions for existing code (#144, #231).
28+
* `as_contact_survey()` no longer requires `country` and `year` columns. These
29+
columns are now auto-detected if present, but surveys without them can be
30+
loaded successfully (#193, #199).
1431

15-
* `contact_matrix(counts = TRUE)$matrix` is now an array rather than an xtabs object. This matches the existing output format of `contact_matrix(counts = FALSE)$matrix` (#118).
32+
* New `assign_age_groups()` and `survey_country_population()` functions allow
33+
modular pre-processing of survey data (#131, #226).
34+
35+
* Reduced verbosity by removing messages about removing participants/contacts
36+
with missing ages (#228).
1637

1738
## Bug fixes
1839

19-
* `load_survey()` now correctly loads longitudinal surveys with repeated observations per participant (e.g., sday files with wave/studyDay columns). Previously, these columns were silently dropped (#192, #194).
40+
* `clean()` now correctly processes age values with units (e.g., "6 months",
41+
"52 weeks") (@LloydChapman, #250, #256).
2042

21-
* `contact_matrix()` now warns when a survey contains multiple observations per participant, as results will aggregate across all observations (#260).
43+
* `contact_matrix()` now warns when a survey contains multiple observations per
44+
participant, as results will aggregate across all observations (#260).
2245

23-
* A bug was fixed leading to excess contacts with `NA` age if the lowest age group did not start at 0.
46+
* `load_survey()` now correctly loads longitudinal surveys with repeated
47+
observations per participant (e.g., sday files with wave/studyDay columns).
48+
Previously, these columns were silently dropped (@njtierney, #192, #194).
2449

25-
* Fixed bugs in `clean()` that caused errors or incorrect results when processing age values with units (e.g., "6 months", "52 weeks") (#256).
50+
* Fixed a bug leading to excess contacts with `NA` age if the lowest age group
51+
did not start at 0 (@lwillem, #170).
2652

2753
## Deprecations
2854

29-
* The `missing_contact_age = "sample"` option in `contact_matrix()` and `assign_age_groups()` has been soft-deprecated and will be removed in a future version. Use `"remove"` to exclude contacts with missing ages, `"keep"` to retain them as a separate age group, or `"ignore"` to drop only those contacts (#273).
55+
* Argument names with dots (e.g., `age.limits`) have been deprecated in favour
56+
of underscores (e.g., `age_limits`) in `contact_matrix()`,
57+
`as_contact_survey()`, `pop_age()`, and `clean()`. The old argument names
58+
still work but will produce deprecation warnings (#160).
3059

31-
* Argument names with dots (e.g., `age.limits`) have been deprecated in favour of underscores (e.g., `age_limits`) in `contact_matrix()`, `as_contact_survey()`, `pop_age()`, and `clean()`. The old argument names still work but will produce deprecation warnings (#160).
60+
* `get_survey()`, `download_survey()`, `get_citation()`, `list_surveys()`, and
61+
`survey_countries()` have been soft-deprecated and moved to
62+
[contactsurveys](https://github.com/epiforecasts/contactsurveys). This is
63+
part of decoupling these features from socialmixr to reduce dependencies
64+
(@njtierney, #179, #207). These will continue to work until version 1.0.0.
3265

33-
* We have soft-deprecated `get_survey()`, `download_survey()`, `get_citation()` and `list_surveys()` and moved these to [contactsurveys](https://github.com/epiforecasts/contactsurveys). We have also soft-deprecated `survey_countries()` as this called `get_survey()` internally. This is part of decoupling these features from socialmixr to reduce dependencies (#207 and #179). These will continue to be supported until we move to a major release (version 1.0.0) of socialmixr. In the meantime, we recommend that users use the [contactsurveys](https://github.com/epiforecasts/contactsurveys) package, as these functions have improved caching and support there.
66+
* The `missing_contact_age = "sample"` option in `contact_matrix()` and
67+
`assign_age_groups()` has been soft-deprecated. Use `"remove"` to exclude
68+
contacts with missing ages, `"keep"` to retain them as a separate age group,
69+
or `"ignore"` to drop only those contacts (#273).
3470

3571
# socialmixr 0.4.0
3672

@@ -48,7 +84,7 @@
4884
```r
4985
# No longer works!
5086
contact_matrix("10.5281/zenodo.1095664")
51-
87+
5288
# Recommended workflow
5389
get_survey("10.5281/zenodo.1095664") |>
5490
contact_matrix()
@@ -70,7 +106,7 @@
70106
## Internal changes
71107

72108
* Code quality is now ensured through continuous integration and the lintr package (#69).
73-
* [Cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) of `download_survey()` has been reduced by externalising the `find_common_prefix()` function and failing early instead of relying on unnecessary if/else sequences
109+
* [Cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) of `download_survey()` has been reduced by externalising the `find_common_prefix()` function and failing early instead of relying on unnecessary if/else sequences
74110
* More generous filename checks now pass files named e.g. "..._participants_common..." an not only "...participant_common..."
75111
* The package now sets a custom user agent when downloading survey data (#82).
76112
* A problem was fixed where attempted joins of files could lead to blowing up memory use (#75).
@@ -135,7 +171,7 @@ to wpp2017 package
135171
* more consistency checks and tests
136172
* performance improvements when weighting
137173
* 'pop_age' can now be called by the user
138-
174+
139175
# socialmixr 0.1.2
140176

141177
* improved downloading form Zenodo; only a single download is used now

R/assign-age-groups.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
#' @export
3636
#' @autoglobal
3737
#' @examples
38-
#' polymod_grouped <- polymod |> assign_age_groups()
38+
#' polymod_grouped <- assign_age_groups(polymod)
3939
#' polymod_grouped
40-
#' polymod_custom <- polymod |> assign_age_groups(age_limits = c(0, 5, 10, 15))
40+
#' polymod_custom <- assign_age_groups(polymod, age_limits = c(0, 5, 10, 15))
4141
#' polymod_custom
4242
assign_age_groups <- function(
4343
survey,

cran-comments.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# Test environments
22

3-
* local macOS install
4-
* winbuilder
5-
* GitHub actions
3+
* local macOS install (aarch64-apple-darwin, R 4.4.x)
4+
* GitHub Actions (ubuntu-latest, windows-latest, macos-latest)
5+
* R-hub
6+
* win-builder
67

78
# R CMD check results
89

910
There were no ERRORs, WARNINGs or NOTEs.
1011

1112
# revdepcheck results
1213

13-
We checked 2 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
14+
We checked 2 reverse dependencies, comparing R CMD check results across CRAN
15+
and dev versions of this package.
1416

15-
* We saw 0 new problems
16-
* We failed to check 0 packages
17-
18-
# Previous CRAN issues
19-
20-
A NOTE has been fixed.
17+
* We saw 0 new problems
18+
* We failed to check 0 packages

man/assign_age_groups.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)