Skip to content

fix(issue-606): pbounds type mismatch#607

Open
quuger wants to merge 1 commit into
bayesian-optimization:masterfrom
quuger:issues-606/pbounds-type-mismatch
Open

fix(issue-606): pbounds type mismatch#607
quuger wants to merge 1 commit into
bayesian-optimization:masterfrom
quuger:issues-606/pbounds-type-mismatch

Conversation

@quuger
Copy link
Copy Markdown

@quuger quuger commented May 26, 2026

resolve issue #606

Summary by CodeRabbit

  • Refactor
    • Improved type annotations for internal parameter validation to enhance code clarity and maintainability.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a3006f7c-74e4-4612-960a-df99cea2d8e3

📥 Commits

Reviewing files that changed from the base of the PR and between b2258c2 and fdb00fd.

📒 Files selected for processing (1)
  • bayes_opt/bayesian_optimization.py

📝 Walkthrough

Walkthrough

Updated type hints in BayesianOptimization.__init__: removed the unused Mapping import from collections.abc and changed the pbounds parameter type annotation from Mapping[str, tuple[float, float]] to BoundsMapping. No runtime behavior changes.

Changes

Type Hint Refactoring

Layer / File(s) Summary
BoundsMapping type annotation migration
bayes_opt/bayesian_optimization.py
Removed Mapping from TYPE_CHECKING imports and updated pbounds parameter type annotation to use BoundsMapping instead of generic Mapping[str, tuple[float, float]].

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A hop, a skip, and types align,
From Mapping broad to BoundsMapping fine,
The imports trim, the hints refined,
A cleaner path for bounds designed!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing a type mismatch in the pbounds parameter by updating its type annotation from Mapping to BoundsMapping.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@t-muser
Copy link
Copy Markdown
Member

t-muser commented May 26, 2026

@phi-friday this looks good to me, any comment from your side? 🙏

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.34%. Comparing base (b2258c2) to head (fdb00fd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #607   +/-   ##
=======================================
  Coverage   98.34%   98.34%           
=======================================
  Files          10       10           
  Lines        1210     1210           
=======================================
  Hits         1190     1190           
  Misses         20       20           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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