Skip to content

Add unit tests for sampling and text utilities - #277

Open
jaisinha77777 wants to merge 1 commit into
google-deepmind:mainfrom
jaisinha77777:add-tests-sampling-text
Open

Add unit tests for sampling and text utilities#277
jaisinha77777 wants to merge 1 commit into
google-deepmind:mainfrom
jaisinha77777:add-tests-sampling-text

Conversation

@jaisinha77777

Copy link
Copy Markdown

Adds unit test coverage for two previously untested helper modules:

  • concordia/utils/sampling.pyextract_choice_response (single-char, trailing paren/period, parenthesized-in-string, and no-match cases) and dynamically_adjust_temperature (below / at / above the attempt midpoint).
  • concordia/utils/text.pywrap (width handling, newline preservation, empty input) and truncate (max_length, delimiters, and combined).

All 31 tests pass locally via python -m pytest concordia/utils/sampling_test.py concordia/utils/text_test.py.

Adds coverage for concordia/utils/sampling.py (extract_choice_response, dynamically_adjust_temperature) and concordia/utils/text.py (wrap, truncate).
@google-cla

google-cla Bot commented Jun 29, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jaisinha77777

Copy link
Copy Markdown
Author

@googlebot I signed it!

2 similar comments
@jaisinha77777

Copy link
Copy Markdown
Author

@googlebot I signed it!

@jaisinha77777

Copy link
Copy Markdown
Author

@googlebot I signed it!

@jaisinha77777

Copy link
Copy Markdown
Author

Hi maintainers,

All CI checks, CLA verification, and tests are passing successfully. This PR adds unit test coverage for previously untested utility functions .

I would appreciate any feedback or review when convenient. Thanks for your time!

@jaisinha77777

Copy link
Copy Markdown
Author

Hi @vezhnick, gentle ping on this one — it's been about a month with no review yet.

It's a small, low-risk addition: unit tests only (31 tests for utils/sampling.py and utils/text.py, both previously untested), no changes to library code. CLA is signed, all checks are green, and the branch still merges cleanly against current main.

No rush if the queue is backed up — just wanted to make sure it hadn't slipped through. Happy to rebase or adjust anything if needed.

@vezhnick vezhnick left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@vezhnick vezhnick self-assigned this Jul 29, 2026
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