Repository navigation
Conversation
Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>
This branch has not been deployed
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.
Motivation
Study.enqueue_trial(..., skip_if_exists=True)currently skipsTrueafter1(andFalseafter0) because Python considersboolanintsubclass. The reverse ordering is not skipped, so deduplication depends on insertion order. Boolean and integer fixed parameters should remain distinct.Description of the changes
RED:
.venv/bin/python -m pytest tests/study_tests/test_study.py -q -k distinguishes_bool_from_int --tb=short -x -o addopts=''failed on the first case: expected 2 queued trials, got 1 ({'x': True}skipped).GREEN:
.venv/bin/python -m pytest tests/study_tests/test_study.py -q -k enqueue_trial_skip_existing --tb=short -o addopts=''— 147 passed..venv/bin/python -m pytest tests/study_tests/test_study.py -q --tb=short -o addopts=''— 673 passed, 7 skipped (four multiprocessing fork deprecation warnings)..venv/bin/ruff check optuna/study/study.py tests/study_tests/test_study.py— passed..venv/bin/ruff format --check optuna/study/study.py tests/study_tests/test_study.py— two files formatted.git diff --check— passed.Fixes #6895. I used an LLM to assist with this PR; I reproduced the failure, selected the bool/int boundary guard, and ran the stated local checks.
Checklist