Skip to main content
Build Status GNU GPL v3 License Latest PyPI version DOI:10.5281/zenodo.2630437 https://static.pepy.tech/personalized-badge/py-bobyqa?period=total&units=international_system&left_color=black&right_color=green&left_text=Downloads

Py-BOBYQA is a flexible package for solving bound-constrained general objective minimization, without requiring derivatives of the objective. At its core, it is a Python implementation of the BOBYQA algorithm by Powell, but Py-BOBYQA has extra features improving its performance on some problems (see the papers below for details). Py-BOBYQA is particularly useful when evaluations of the objective function are expensive and/or noisy.

More details about Py-BOBYQA and its enhancements over BOBYQA can be found in our papers:

  1. Coralia Cartis, Jan Fiala, Benjamin Marteau and Lindon Roberts, Improving the Flexibility and Robustness of Model-Based Derivative-Free Optimization Solvers, ACM Transactions on Mathematical Software, 45:3 (2019), pp. 32:1-32:41 [arXiv preprint: 1804.00154]

  2. Coralia Cartis, Lindon Roberts and Oliver Sheridan-Methven, Escaping local minima with derivative-free methods: a numerical investigation, Optimization, 71:8 (2022), pp. 2343-2373. [arXiv preprint: 1812.11343]

  3. Lindon Roberts, Model Construction for Convex-Constrained Derivative-Free Optimization, arXiv preprint arXiv:2403.14960 (2024).

Please cite [1] when using Py-BOBYQA for local optimization, [1,2] when using Py-BOBYQA’s global optimization heuristic functionality, and [1,3] if using the general convex constraints functionality.

The original paper by Powell is: M. J. D. Powell, The BOBYQA algorithm for bound constrained optimization without derivatives, technical report DAMTP 2009/NA06, University of Cambridge (2009), and the original Fortran implementation is available here.

If you are interested in solving least-squares minimization problems, you may wish to try DFO-LS, which has the same features as Py-BOBYQA (plus some more), and exploits the least-squares problem structure, so performs better on such problems.

Documentation

See manual.pdf or the online manual.

Citation

Full details of the Py-BOBYQA algorithm are given in our papers:

  1. Coralia Cartis, Jan Fiala, Benjamin Marteau and Lindon Roberts, Improving the Flexibility and Robustness of Model-Based Derivative-Free Optimization Solvers, ACM Transactions on Mathematical Software, 45:3 (2019), pp. 32:1-32:41 [preprint]

  2. Coralia Cartis, Lindon Roberts and Oliver Sheridan-Methven, Escaping local minima with derivative-free methods: a numerical investigation, Optimization, 71:8 (2022), pp. 2343-2373. [arXiv preprint: 1812.11343]

  3. Lindon Roberts, Model Construction for Convex-Constrained Derivative-Free Optimization, arXiv preprint arXiv:2403.14960 (2024).

Please cite [1] when using Py-BOBYQA for local optimization, [1,2] when using Py-BOBYQA’s global optimization heuristic functionality, and [1,3] if using the general convex constraints functionality.

Requirements

Py-BOBYQA requires the following software to be installed:

Additionally, the following python packages should be installed (these will be installed automatically if using pip, see Installation using pip):

Optional package: Py-BOBYQA versions 1.2 and higher also support the trustregion package for fast trust-region subproblem solutions. To install this, make sure you have a Fortran compiler (e.g. gfortran) and NumPy installed, then run pip install trustregion. You do not have to have trustregion installed for Py-BOBYQA to work, and it is not installed by default.

Installation using pip

For easy installation, use pip:

$ pip install Py-BOBYQA

Note that if an older install of Py-BOBYQA is present on your system you can use:

$ pip install --upgrade Py-BOBYQA

to upgrade Py-BOBYQA to the latest version.

Manual installation

Alternatively, you can download the source code from Github and unpack as follows:

$ git clone https://github.com/numericalalgorithmsgroup/pybobyqa
$ cd pybobyqa

Py-BOBYQA is written in pure Python and requires no compilation. It can be installed using:

$ pip install .

instead.

To upgrade Py-BOBYQA to the latest version, navigate to the top-level directory (i.e. the one containing setup.py) and rerun the installation using pip, as above:

$ git pull
$ pip install .

Testing

If you installed Py-BOBYQA manually, you can test your installation using the pytest package:

$ pip install pytest
$ python -m pytest --pyargs pybobyqa

Alternatively, the HTML documentation provides some simple examples of how to run Py-BOBYQA.

Examples

Examples of how to run Py-BOBYQA are given in the online documentation, and the examples directory in Github.

Uninstallation

If Py-BOBYQA was installed using pip you can uninstall as follows:

$ pip uninstall Py-BOBYQA

If Py-BOBYQA was installed manually you have to remove the installed files by hand (located in your python site-packages directory).

Bugs

Please report any bugs using GitHub’s issue tracker.

License

This algorithm is released under the GNU GPL license. Please contact NAG for alternative licensing.

Release files for Py-BOBYQA 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Py-BOBYQA 1.5.0
File Size Uploaded
py_bobyqa-1.5.0.tar.gz 51.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Py-BOBYQA 1.5.0
File Interpreter ABI Platform
Py_BOBYQA-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 109.5 kB

Release files / py_bobyqa-1.5.0.tar.gz

Download URL py_bobyqa-1.5.0.tar.gz
Size 51.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3c7719b68b28834ea6d538f54603f6a891263f7c21f1a673de79e3a5e0e7e413
BLAKE2b-256 checksum
How to use checksums
6b41c4c74daf208ed27e14071e92efb7ea238ffdf77ee93a3a7777ff02d2b0e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / Py_BOBYQA-1.5.0-py3-none-any.whl

Download URL Py_BOBYQA-1.5.0-py3-none-any.whl
Size 58.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
457afc04d6f2c9f1814934854dc4e542c5e5982a0f80add4b211fcdb0b5811e3
BLAKE2b-256 checksum
How to use checksums
f41e0d44a4e3a291c009a357fbd1d61511d9306c2c4db9a7ceb6e8104d8d385f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

1.4.1

2 release files

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1.1

1 release file

1.1

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page