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

Fix empty constraints after dropping parameters #448

Merged
merged 6 commits into from
Dec 11, 2024

Conversation

AVHopp
Copy link
Collaborator

@AVHopp AVHopp commented Dec 9, 2024

When dropping parameters due to the use of cardinality constraints, it can happen that an attempt is made to create a Constraint without any parameters, causing the code to crash.

This PR introduces an explicit test for this scenario as well as a fix by only including constraints that still have parameters after dropping them.

This was observed when working on #345 and is necessary for continuing working on that.

@AVHopp AVHopp added the bug Something isn't working label Dec 9, 2024
@AVHopp AVHopp self-assigned this Dec 9, 2024
baybe/searchspace/continuous.py Show resolved Hide resolved
@AVHopp AVHopp force-pushed the fix/empty_constraints_after_cardinality_constraints branch from 5c30995 to a761b9d Compare December 10, 2024 15:25
Copy link
Collaborator

@AdrianSosic AdrianSosic left a comment

Choose a reason for hiding this comment

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

Hi @AVHopp, thanks for the PR! I've made some minor modifications, mostly making the condition more readable. Feel free to merge 🚀

@AVHopp AVHopp force-pushed the fix/empty_constraints_after_cardinality_constraints branch from b1cf2ef to b28db43 Compare December 11, 2024 11:18
@AVHopp AVHopp merged commit eb29369 into main Dec 11, 2024
11 checks passed
@AVHopp AVHopp deleted the fix/empty_constraints_after_cardinality_constraints branch December 11, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants