Skip to content

Enhance adjusted sample summary output#194

Closed
neuralsorcerer wants to merge 10 commits intofacebookresearch:mainfrom
neuralsorcerer:sum
Closed

Enhance adjusted sample summary output#194
neuralsorcerer wants to merge 10 commits intofacebookresearch:mainfrom
neuralsorcerer:sum

Conversation

@neuralsorcerer
Copy link
Copy Markdown
Collaborator

Added adjustment details to the Sample string representation, including method, trimming parameters, and quick weight diagnostics such as design effect and effective sample size when available.

Copilot AI review requested due to automatic review settings December 3, 2025 06:12
@meta-cla meta-cla bot added the cla signed label Dec 3, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the string representation of adjusted Sample objects by adding detailed diagnostic information about the adjustment process. When a Sample has been adjusted, users now see the adjustment method, any weight trimming parameters applied, and key weight diagnostics including design effect and effective sample size.

Key Changes:

  • Added adjustment details section to Sample.str() that displays adjustment method, trimming parameters (when present), and weight diagnostics (design effect and effective sample size)
  • Updated tests to verify the new adjustment details are properly displayed in the string representation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
balance/sample_class.py Implements the new adjustment details section in the __str__ method, extracting method and trimming parameters from the model dict, computing design effect and effective sample size when applicable
tests/test_sample.py Adds test assertions to verify that adjustment details, method name, and design effect are present in the string representation of adjusted samples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@talgalili
Copy link
Copy Markdown
Contributor

Cool!
Could you please add a screenshot of how it looks after the change?
Ideally also update the docstring.

Copy link
Copy Markdown
Contributor

@talgalili talgalili left a comment

Choose a reason for hiding this comment

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

Thanks @neuralsorcerer

Could you please add a simple 'Examples' section, so I'll be able to see how the output is supposed to look like?
(this would make it easier to decide if it's closing the original issue, or if something is missing)

@neuralsorcerer
Copy link
Copy Markdown
Collaborator Author

Could you please add a simple 'Examples' section, so I'll be able to see how the output is supposed to look like?

Added a simple example as part of docstring.

Copy link
Copy Markdown
Contributor

@talgalili talgalili left a comment

Choose a reason for hiding this comment

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

Thanks.
I think we're almost there.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 3, 2025 12:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@talgalili talgalili left a comment

Choose a reason for hiding this comment

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

nit: pyre missing.

@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Dec 3, 2025

@talgalili has imported this pull request. If you are a Meta employee, you can view this in D88296085.

Copilot AI review requested due to automatic review settings December 4, 2025 05:28
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@neuralsorcerer has updated the pull request. You must reimport the pull request before landing.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@neuralsorcerer has updated the pull request. You must reimport the pull request before landing.

@talgalili talgalili added this to the balance 0.14.0 milestone Dec 4, 2025
@meta-codesync meta-codesync bot closed this in 44df914 Dec 4, 2025
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Dec 4, 2025

@talgalili merged this pull request in 44df914.

@neuralsorcerer neuralsorcerer deleted the sum branch December 4, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Update the printout of an adjusted object to include information about the correction used.

4 participants