Skip to content

[CTIS QSF tools] Generate changelog from diffing codebook #1630

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

Merged
merged 13 commits into from
Jun 8, 2022

Conversation

nmdefries
Copy link
Contributor

Description

Currently, the survey changelog is generated by joining descriptive fields from the codebook onto QSF diffs. Since the codebook is meant to be a parsed version of the QSFS that matches the microdata and the diffs are meant to report raw fields from the QSFs, a lot of processing is required to make the two compatible (e.g. some survey items are renamed in specific waves). This means that the code to create the survey changelog is complex, making it both hard to maintain and likely to contain bugs.

This PR generates the changelog instead by joining the codebook with itself, and diffing pairs of columns (old and new version of a characteristic) for each observation.

Fix a few issues with the codebook, mostly related to display logic edge cases.

Changelog

  • generate-codebook.R
  • generate-changelog.R

@nmdefries nmdefries requested a review from capnrefsmmat June 6, 2022 20:06
@nmdefries nmdefries marked this pull request as ready for review June 6, 2022 20:06
@capnrefsmmat
Copy link
Contributor

I trust you've run this and compared the output, e.g. diffing the old changelog against the new one?

@nmdefries
Copy link
Contributor Author

nmdefries commented Jun 7, 2022

Yep.

Differences are minimal -- a few buggy lines in the changelog have been removed (e.g. the old version showed display logic as having changed if just the QID of the conditional question changed, even if all text, logic, and answer choices were the same). There are a few additional obs (O(10)) included since this version diffs a few extra fields. And a few changelog lines have changed type. "Matrix subquestion changed" specifically has been broken down into more specific categories. But most lines are the same.

Copy link
Contributor

@capnrefsmmat capnrefsmmat left a comment

Choose a reason for hiding this comment

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

Code looks good, and I'll trust that checking the generated codebook has covered most possible problems

@nmdefries
Copy link
Contributor Author

@krivard This is ready to merge.

@krivard krivard merged commit ff69ef4 into main Jun 8, 2022
@krivard krivard deleted the ndefries/changelog-from-codebook branch June 8, 2022 16:47
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.

3 participants