Skip to content

edit tutorials with new socialmixr and contactsurveys interoperability#145

Merged
avallecam merged 19 commits intomainfrom
140-contactsurveys-socialmixr-interoperability
Mar 23, 2026
Merged

edit tutorials with new socialmixr and contactsurveys interoperability#145
avallecam merged 19 commits intomainfrom
140-contactsurveys-socialmixr-interoperability

Conversation

@avallecam
Copy link
Member

@avallecam avallecam commented Mar 20, 2026

Closes #140

Summary

  • Fix deprecated age.limitsage_limits in compare-interventions.Rmd and template.Rmd
  • Update contact-matrices.Rmd with the new loading pattern (contactsurveys::download_survey() + socialmixr::load_survey()), add return_demography = TRUE, new callouts for country name warning and demography requirement, and standardized object names
  • Apply the same pattern uniformly to all downstream episodes: simulating-transmission.Rmd, modelling-interventions.Rmd, compare-interventions.Rmd, disease-burden.Rmd, vaccine-comparisons.Rmd, template.Rmd

Test plan

  • Render contact-matrices.Rmd and verify the new callouts display correctly
  • Verify contacts_byage$demography is populated (requires return_demography = TRUE)
  • Render each downstream episode and confirm no broken object references
  • Check that levels(survey_load$participants$country) output matches expected countries for POLYMOD and Zambia surveys

🤖 Generated with Claude Code

avallecam and others added 3 commits March 20, 2026 20:02
The dot notation age.limits was deprecated in favor of age_limits.
Update compare-interventions.Rmd (2 occurrences) and template.Rmd (3 occurrences).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add library(contactsurveys) and replace socialmixr::polymod loading
  with contactsurveys::download_survey() + socialmixr::load_survey()
  using the Zenodo DOI for POLYMOD and Zambia surveys
- Add return_demography = TRUE to all contact_matrix() calls
- Standardize object names: contacts_byage, contacts_byage_matrix
- Add callout warning users to always specify countries = argument
- Add text explaining return_demography requirement for {epidemics}

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace socialmixr::polymod and socialmixr::get_survey() with
contactsurveys::download_survey() + socialmixr::load_survey() using
the Zenodo DOI. Add return_demography = TRUE and standardize object
names (contacts_byage, contacts_byage_matrix) across:
- simulating-transmission.Rmd
- modelling-interventions.Rmd
- compare-interventions.Rmd
- disease-burden.Rmd
- vaccine-comparisons.Rmd
- template.Rmd

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 20, 2026

Thank you!

Thank you for your pull request 😃

🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}.

If you have files that automatically render output (e.g. R Markdown), then you should check for the following:

  • 🎯 correct output
  • 🖼️ correct figures
  • ❓ new warnings
  • ‼️ new errors

Rendered Changes

🔍 Inspect the changes: https://github.com/epiverse-trace/tutorials-late/compare/md-outputs..md-outputs-PR-145

The following changes were observed in the rendered markdown documents:

 compare-interventions.md   |  52 +++++++++++---------
 contact-matrices.md        | 119 +++++++++++++++++++++++++++------------------
 disease-burden.md          |  31 +++++++-----
 md5sum.txt                 |  36 +++++++-------
 model-choices.md           |  20 ++++----
 modelling-interventions.md |  34 +++++++------
 setup.md                   |  14 +++---
 simulating-transmission.md |  50 ++++++++++---------
 vaccine-comparisons.md     |  42 ++++++++--------
 9 files changed, 225 insertions(+), 173 deletions(-)
What does this mean?

If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible.

This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation.

⏱️ Updated at 2026-03-23 18:36:34 +0000

github-actions bot pushed a commit that referenced this pull request Mar 20, 2026
@avallecam avallecam requested a review from Degoot-AM March 20, 2026 22:08
avallecam and others added 2 commits March 20, 2026 22:18
Add warning = FALSE to all chunk headers that call
contactsurveys::download_survey() + socialmixr::load_survey(),
suppressing the cosmetic 'No reference provided' warning from socialmixr.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The warning is emitted by load_survey(), not contact_matrix(),
so suppressing it on the contact_matrix() chunk has no effect.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@avallecam
Copy link
Member Author

hi @Degoot-AM an experimental PR using Claude Code to edit all the calls for socialmixr in this repo.

Some thoughts:

  • Nice case study to use for updating the practical files and how-to guides in a similar way.
  • It even generated text updates in the tutorial steps (which I forgot and was not expecting).
  • It needed minimal feedback from me after generating the plan detailed in the issue linked.
  • Only the last commit was a required fix that came from my local review.

This should be ready to review after passing all checks.

github-actions bot pushed a commit that referenced this pull request Mar 20, 2026
Copy link
Contributor

@Degoot-AM Degoot-AM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done ! I have made a few edits.

github-actions bot pushed a commit that referenced this pull request Mar 23, 2026
avallecam and others added 7 commits March 23, 2026 17:21
…n contact-matrices

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…atrices

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ambia

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_byage_uk in compare-interventions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t-matrices

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
github-actions bot pushed a commit that referenced this pull request Mar 23, 2026
@avallecam avallecam merged commit a87b094 into main Mar 23, 2026
6 checks passed
@avallecam avallecam deleted the 140-contactsurveys-socialmixr-interoperability branch March 23, 2026 18:41
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.

edit tutorials with new socialmixr and contactsurveys interoperability

2 participants