Skip to main content

A common interface for blackbox optimization algorithms along with useful helpers like parallel optimization loops, analysis and visualization scripts.

Project description

Blackbox Optimization

License CI/CD PyPI - Wheel PyPI - Python Version Code style: black

Various blackbox optimization algorithms with a common interface along with useful helpers like parallel optimization loops, analysis and visualization scripts.

Random search is provided as an example optimizer along with tests for the interface.

New optimizers can require blackboxopt as a dependency, which is just the light-weight interface definition. If you want all optimizer implementations that come with this package, install blackboxopt[all] Alternatively, you can get individual optimizers with e.g. blackboxopt[bohb]

This software is a research prototype. The software is not ready for production use. It has neither been developed nor tested for a specific use case. However, the license conditions of the applicable Open Source licenses allow you to adapt the software to your needs. Before using it in a safety relevant setting, make sure that the software fulfills your requirements and adjust it according to any applicable safety standards (e.g. ISO 26262).

Documentation

Visit boschresearch.github.io/blackboxopt

Development

Install uv

Install the blackboxopt package from source by running the following from the root directory of this repository

uv sync

(Optional) Install pre-commit hooks to check code standards before committing changes:

uv run pre-commit install

Test

Make sure to install all extras before running tests

uv sync --extra all
uv run pytest tests/

For HTML test coverage reports run

uv run pytest tests/ --cov --cov-report html:htmlcov

Building Documentation

Make sure to install all necessary dependencies:

uv sync --extra all

The documentation can be built from the repository root as follows:

uv run mkdocs build --clean --no-directory-urls

For serving it locally while working on the documentation run:

uv run mkdocs serve

Architectural Decision Records

Create evaluation result from specification

In the context of initializing an evaluation result from a specification, facing the concern that having a constructor with a specification argument while the specification attributes end up as toplevel attributes and not summarized under a specification attribute we decided for unpacking the evaluation specification like a dictionary into the result constructor to prevent the said cognitive dissonance, accepting that the unpacking operator can feel unintuitive and that users might tend to matching the attributes explictly to the init arguments.

Report multiple evaluations

In the context of many optimizers just sequentally reporting the individual evaluations when multiple evaluations are reported at once and thus not leveraging any batch reporting benefits, facing the concern that representing that common behaviour in the optimizer base class requires the definition of an abstract report single and an abstract report multi method for which the report single does not need to be implemented if the report multi is, we decided to refactor the arising redundancy into a function call_functions_with_evaluations_and_collect_errors, accepting that this increases the cognitive load when reading the code.

License

blackboxopt is open-sourced under the Apache-2.0 license. See the LICENSE file for details.

For a list of other open source components included in blackboxopt, see the file 3rd-party-licenses.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blackboxopt-5.3.5.tar.gz (312.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blackboxopt-5.3.5-py3-none-any.whl (69.6 kB view details)

Uploaded Python 3

File details

Details for the file blackboxopt-5.3.5.tar.gz.

File metadata

  • Download URL: blackboxopt-5.3.5.tar.gz
  • Upload date:
  • Size: 312.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for blackboxopt-5.3.5.tar.gz
Algorithm Hash digest
SHA256 f5a2d33e59052cd9bc92f624f8d4921efc98c722bd646d78224aa28b40e6de9e
MD5 651ac182db14e22669c189470055c5bc
BLAKE2b-256 54b57c312410e671159e502aab6ee2be664c48f6018614db8bc1aaefafee4f04

See more details on using hashes here.

File details

Details for the file blackboxopt-5.3.5-py3-none-any.whl.

File metadata

  • Download URL: blackboxopt-5.3.5-py3-none-any.whl
  • Upload date:
  • Size: 69.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for blackboxopt-5.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cd17e9401aa2aec91237e25644469aa3a961f732a6b885b2a0431216ec6f2487
MD5 b9bcf3770db566075eea49f97e0c5d92
BLAKE2b-256 6668c59e643a4dc8100ab4f7879a17967c8e34619c9137794caaec365861266c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page