Adds constraint-type defaults, partitioner warnings, and model dtype passthrough - #11
Merged
Merged
Conversation
This was referenced Jul 23, 2026
aaronstevenwhite
approved these changes
Jul 24, 2026
Collaborator
|
Please bump the minor version and add a changelog entry, then I will merge to main. |
Collaborator
Author
Done! |
The Format job failed on a ruff version CI never pinned. Both the Lint and Format jobs installed ruff unpinned, so they picked up 0.16, which formats Python inside Markdown code blocks. uv.lock resolves ruff 0.14.14, so a contributor running the documented "uv run ruff format ." saw a clean tree while CI reformatted six docs files it had never touched before. Both jobs now install the locked version, named once in a workflow-level RUFF_VERSION. Also dates the 0.9.0 entry to the day it ships and records the version in uv.lock, which pyproject.toml and bead.__init__ already carry.
bead.__version__ restated the version as a second literal, and the 0.8.0 release bumped pyproject.toml and uv.lock without it, so the package reported 0.7.0 while the installed distribution reported 0.8.0. It now reads the version back out of the distribution metadata, which removes the literal that drifted rather than resynchronising it. The CHANGELOG entry and its compare link are the manual steps that remain, so tests/test_version.py pins them to the declared version alongside a check that the importable version still matches pyproject.toml. Each test was confirmed to fail against a simulated drift of the case it covers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ListConstraintsubclasses now defaultconstraint_typeto their own discriminator value, so constraints no longer have to restate it at construction (UniquenessConstraint(property_expression=...)instead of also passingconstraint_type="uniqueness").bead/lists/constraints.pyListPartitionernow warns once per expression when a constraint property expression cannot be evaluated, and once per type when a constraint type is not enforced during assignment. Previously a misconfigured constraint scored zero on every iteration and was silently ignored.bead/lists/partitioner.pydtype="auto"), rather than being forced to float32. Loading a half-precision checkpoint as float32 doubled its memory.bead/items/adapters/huggingface.pyLanguageModelScorerthrough to the adapter.bead/items/scoring.pyAll four are backward compatible. The new
dtypeparameters are keyword arguments defaulting to"auto", and the constraint defaults only add a value where one previously had to be supplied.Type of Change
Checklist
uv run ruff check .anduv run ruff format .uv run pyrightwith no errorsuv run pytest tests/)Testing
tests/lists/test_constraints.pyconstraint_type, and the discriminator still round-trips.tests/lists/test_partitioner.pytests/lists/test_partitioner_batch.pytests/items/adapters/test_huggingface.pydtypetofrom_pretrainedand defaults to"auto".tests/items/test_scoring.pyLanguageModelScorerpasses itsdtypethrough to the adapter.