Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Campaign.allow_* flags to use an AutoBool mechanism so callers always observe plain bool values at query time, while still supporting an “auto” mode.
Changes:
- Replaced
bool | UnspecifiedTypeallow-flag storage with privateAutoBoolattrs fields plus public bool-returning properties. - Updated validation to raise
IncompatibilityErrorfor incompatible allow-flag settings when continuous subspaces are involved. - Refreshed tests and changelog to cover/describe the new behavior (including
"auto").
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/test_campaign.py | Updates parametrization and assertions to validate lazy resolution of allow flags and new error type. |
| baybe/campaign.py | Introduces AutoBool-backed private fields, new validator, and public bool properties for allow flags. |
| CHANGELOG.md | Documents the behavioral change and a cache-related fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
@AdrianSosic: The |
AVHopp
approved these changes
Feb 10, 2026
Collaborator
AVHopp
left a comment
There was a problem hiding this comment.
Except for the failing tests this looks good to me.
Scienfitz
reviewed
Feb 16, 2026
Scienfitz
approved these changes
Mar 6, 2026
e02883f to
d721d8b
Compare
Scienfitz
approved these changes
Mar 30, 2026
551cf1e to
cde2954
Compare
Co-authored-by: Martin Fitzner <martin.fitzner@merckgroup.com>
cde2954 to
c31e6ec
Compare
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.
Fixes #733.
The drawback of the previous approach was that the flag attributes had a union
bool | UnspecifiedTypetype, which meant that they could not be safely accessed without additional conversion logic, resulting in the bug reported in #733.To fix this, the user-facing value of the flags should always be a simple
boolat query time, while still offering a clever "auto-determine" mechanism that does not require the user to explicitly set them depending on the search space type.There are two options to achieve this:
AutoBoolapproach, where the user-specified value is stored as a private attribute and the public value is resolved lazily at query time.