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

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).

Development

Install poetry

pip install poetry

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

poetry install

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

poetry run pre-commit install

Test

Make sure to install all extras before running tests

poetry install -E testing
poetry run pytest tests/

For HTML test coverage reports run

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

Custom Optimizers

When you develop an optimizer based on the interface defined as part of blackboxopt.base, you can use blackboxopt.testing to directly test whether your implementation follows the specification by adding a test like this to your test suite.

from blackboxopt.testing import ALL_REFERENCE_TESTS

@pytest.mark.parametrize("reference_test", ALL_REFERENCE_TESTS)
def test_all_reference_tests(reference_test):
    reference_test(CustomOptimizer, custom_optimizer_init_kwargs)

Building Documentation

Make sure to install all necessary dependencies:

poetry install --extras=all

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

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

For serving it locally while working on the documentation run:

poetry 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.

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-1.0.2.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

blackboxopt-1.0.2-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blackboxopt-1.0.2.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.11 Linux/5.8.0-1036-azure

File hashes

Hashes for blackboxopt-1.0.2.tar.gz
Algorithm Hash digest
SHA256 83464a89b8988940c3ceafb6ad0e3310af067fcc9bbea1026890dc9a82dd46ef
MD5 450799445bed07af1d7282657fa135b6
BLAKE2b-256 00e89dad3c7aa33b30d8672bb12b5885e8779d0665d7606e30533fd4bb521b5c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blackboxopt-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 41.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.11 Linux/5.8.0-1036-azure

File hashes

Hashes for blackboxopt-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 52141702e88ba8bed33dc07eb58efbeecfe13895d6a232522f97bdd30b809fd2
MD5 254c4c133359798d67bc16514874c5f9
BLAKE2b-256 2b1a6a9b32bbd76801d97ca30baa1d5674c44a8656e755d930196d0880e8c29d

See more details on using hashes here.

Supported by

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