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

736 fix matched pair flag #162

Merged
merged 4 commits into from
Feb 4, 2025
Merged

736 fix matched pair flag #162

merged 4 commits into from
Feb 4, 2025

Conversation

robertswh
Copy link
Collaborator

@robertswh robertswh commented Jan 30, 2025

Pull Request Title

Fix matched pair flag

Summary

This request implements ASAP-736 by fixing the matched pair flag function. Also ran into some issues with the ratio_of_means unit tests as a result of this change, so also needed to fix those issues (primarily fixed by adding in the imputation_flag column that the function needed, fixing a bug in join_manual_constructions where a column was duplicated and dropping some columns from expected outputs).

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Checklists

This pull request meets the following requirements:

Creator Checklist

  • Installable with all dependencies recorded
  • Runs without error
  • Follows PEP8 and project-specific conventions
  • Appropriate use of comments, for example, no descriptive comments
  • Functions documented using Numpy style docstrings
  • Assumptions and decisions log considered and updated if appropriate
  • Unit tests have been updated to cover essential functionality for a reasonable range of inputs and conditions
  • Other forms of testing such as end-to-end and user-interface testing have been considered and updated as required

If you feel some of these conditions do not apply for this pull request, please
add a comment to explain why.

Reviewer Checklist

  • Test suite passes (locally as a minimum)
  • Peer reviewed with review recorded

Additional Information

Please provide any additional information or context that would help the reviewer understand the changes in this pull request.

Related Issues

Link any related issues or pull requests here.

@NathanKelly-ONS NathanKelly-ONS marked this pull request as ready for review February 3, 2025 17:13
df[df[imputation_flag].isin(["fir", "fic", "fimc", "bir", "c"])].index,
"actual_response",
] = None

df[f"{forward_or_backward}_match_{target}"] = (
df.groupby([strata, reference])
Copy link
Collaborator

@AntonZogk AntonZogk Feb 4, 2025

Choose a reason for hiding this comment

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

for future reference fill_group could be used here ( highlighted the wrong rows, i was referring line 60)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks Anton, would love to hear more about this - I tried searching "fill_group pandas" but nothing is coming up!

Copy link
Collaborator

@AntonZogk AntonZogk left a comment

Choose a reason for hiding this comment

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

All looking good, just one comment which needs sorting

@AntonZogk AntonZogk merged commit a2811f3 into main Feb 4, 2025
8 checks passed
@AntonZogk AntonZogk deleted the 736-fix-matched-pair-flag branch February 4, 2025 16:23
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