Skip to content

Remove stale ndarray sorting warnings#603

Open
ReinerBRO wants to merge 1 commit intobayesian-optimization:masterfrom
ReinerBRO:remove-array-sorting-warning
Open

Remove stale ndarray sorting warnings#603
ReinerBRO wants to merge 1 commit intobayesian-optimization:masterfrom
ReinerBRO:remove-array-sorting-warning

Conversation

@ReinerBRO
Copy link

@ReinerBRO ReinerBRO commented Mar 26, 2026

Remove the old ndarray sorting warning now that pbounds order is the canonical order. Add regression tests for register/probe with ndarray inputs.

Summary by CodeRabbit

  • Bug Fixes

    • Removed unnecessary warnings when registering or probing with NumPy arrays.
  • Tests

    • Added tests verifying NumPy array inputs work correctly and parameters properly map to bounds order.

@coderabbitai
Copy link

coderabbitai bot commented Mar 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: 7a311621-382a-4f49-9983-5ce713c70c8d

📥 Commits

Reviewing files that changed from the base of the PR and between 6868d3a and ce1788d.

📒 Files selected for processing (2)
  • bayes_opt/bayesian_optimization.py
  • tests/test_bayesian_optimization.py
💤 Files with no reviewable changes (1)
  • bayes_opt/bayesian_optimization.py

📝 Walkthrough

Walkthrough

The changes remove deprecation warning infrastructure related to numpy array parameter handling from the Bayesian optimization library. The register() and probe() methods no longer emit warnings when receiving numpy array inputs. Tests are added to verify the parameter handling continues to work correctly without warnings.

Changes

Cohort / File(s) Summary
Deprecation Warning Removal
bayes_opt/bayesian_optimization.py
Removed unused warn import, deleted _sorting_warning_already_shown state field, and removed ndarray detection and conversion logic from register() and probe() methods.
Test Coverage
tests/test_bayesian_optimization.py
Added warnings module import and two new test functions (test_register_array_uses_pbounds_order_without_warning, test_probe_array_uses_pbounds_order_without_warning) verifying that numpy array parameters are accepted and processed correctly without warnings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 No warnings to heed, just clean, flowing code,
Arrays now welcomed on the optimization road,
Deprecated concerns have vanished away,
Hop forward with joy—a cleaner new day! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Remove stale ndarray sorting warnings' accurately and clearly summarizes the main change: removing deprecated warnings about numpy array parameter ordering that are no longer relevant.

✏️ 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.

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.

1 participant