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

bug-fixes-for-710 #166

Merged
merged 9 commits into from
Feb 10, 2025
Merged

bug-fixes-for-710 #166

merged 9 commits into from
Feb 10, 2025

Conversation

ldavies99
Copy link
Collaborator

@ldavies99 ldavies99 commented Feb 5, 2025

Pull Request Title

Summary

Add your summary here - keep it brief, to the point, and in plain English.

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.

@ldavies99 ldavies99 changed the title Add missing line bug-fixes-for-710 Feb 5, 2025
Copy link
Collaborator

@Jday7879 Jday7879 left a comment

Choose a reason for hiding this comment

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

Nice work :) Just a couple of comments, I don't think there is anything that needs to be changed. But if you wanted to have look at something, it might be the iterating over rows

@@ -263,28 +263,44 @@ def load_and_join_finalsel(
return df.merge(finalsel_data, on=["reference", "period"], how="left")


def validate_nil_markers(df: pd.DataFrame, logger: logging.Logger) -> pd.DataFrame:
def validate_nil_markers(
cp_df: pd.DataFrame, qv_df: pd.DataFrame, logger: logging.Logger
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if a logger needs to be passed as an argument into every function. This is fine for now, but might be worth looking into when we have more time :)

@ldavies99 ldavies99 requested a review from Jday7879 February 10, 2025 13:09
Copy link
Collaborator

@Jday7879 Jday7879 left a comment

Choose a reason for hiding this comment

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

Really nice work Luke, Like the solution to filter first and then iterate over it. Should speed things up in the cases of large data frames


return df
condition = (qv_cp_df["response_type"] >= 4) & (qv_cp_df["adjusted_value"] != 0)
filtered_qv_df = qv_cp_df[condition]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Really like the new method to create a subset and only iterate over rows which meet this condition! Nice use of not resetting the index in filtered df as this will match unfiltered


validated_qv_df = qv_cp_df.drop(columns=["response_type"])

return validated_qv_df
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for renaming, makes it easier to track which dataframe is which :)

@ldavies99 ldavies99 merged commit d2a098b into main Feb 10, 2025
8 checks passed
@ldavies99 ldavies99 deleted the add-missing-line-for-validation-function branch February 10, 2025 14:02
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.

2 participants