A Python Global Optimization Benchmarking Library for Evaluation and Testing (pyGOBLET).
Project description
pyGOBLET: A Python Global Optimization Benchmarking Library for Evaluation and Testing
pyGOBLET is a Python package for benchmarking global optimization algorithms.
Features
- A large collection of standard benchmark functions
- Benchmark functions inspired by real-world energy applications
- Tools for running solvers on benchmark problems
- Postprocessing tools for analyzing benchmark results
- Example scripts and tutorials demonstrating library usage
Installation
Install from source:
pip install pygoblet
Available Problems
pyGOBLET includes standard benchmark problems and real-world inspired problems:
- Standard benchmark problems:
pygoblet.problems.standard - FLORIS wind farm optimization problems:
pygoblet.problems.floris
Function Classification
Each standard benchmark function is tagged with one or more classification tags, which are used to organize and filter the available functions. The tags include:
Unconstrained/Constrained: Whether the function has constraintsMultimodal/Unimodal: Number of local/global minimaContinuous/Discontinuous: Whether the function is continuous - functions with sharp ridges or drops are classified as discontinuousDifferentiable/Non_differentiable: Whether the function is differentiableSeparable/Non_separable: Whether the function can be separated into independent subproblems1D,2D,nD: Dimensionality of the function
You can access groups of functions by tag using the get_standard_problems function:
import pygoblet
# All 2D functions
problems = pygoblet.get_standard_problems(["2D"])
# All problems that are multimodal, unconstrained, and n-Dimensional
problems = pygoblet.get_standard_problems(["Multimodal", "Unconstrained", "nD"])
Usage
Accessing Benchmark Functions
The pygoblet.problems.standard module provides standard benchmark functions for testing solvers. For example:
import pygoblet
# Create an Ackley function instance in 2D
ackley = pygoblet.problems.standard.Ackley(2)
# Evaluate at a point
x = [0.5, -0.3]
result = ackley.evaluate(x)
print(f"f({x}) = {result}")
# Get problem information
print(f"Minimum value: {ackley.min()}")
print(f"Minimizer: {ackley.argmin()}")
print(f"Bounds: {ackley.bounds()}")
Benchmarking a Solver
import scipy.optimize as opt
import pygoblet
from pygoblet.optimizer import BaseOptimizer, OptimizationResult
# Select test problems
problems = pygoblet.get_standard_problems(["2D", "Unconstrained"])
# Define solver to benchmark
class DualAnnealing(BaseOptimizer):
deterministic = False
n_points = 0
def optimize(self, func, bounds, x0=None, constraints=None, **kwargs):
result = opt.dual_annealing(func, bounds, **kwargs)
return OptimizationResult(result.x, result.fun, algorithm="Dual Annealing")
solvers = [DualAnnealing()]
# Run benchmark and generate COCO data
pygoblet.run_solvers(solvers, problems, test_dimensions=[2, 4, 5, 8, 10, 12], n_iters=5)
# Run postprocessing
pygoblet.postprocessing.postprocess_data(["output_data/DualAnnealing"], energy_file="output_data/energy_data.csv")
Documentation
Complete documentation is available at https://pages.github.com/NREL/pyGOBLET/.
Contributing
Contributions are welcome! Please open issues or pull requests for bug fixes, new features, or improvements.
License
This project is licensed under the BSD-3-Clause License.
NREL Software Record number: SWR-25-118
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygoblet-0.1.0.tar.gz.
File metadata
- Download URL: pygoblet-0.1.0.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8669af8a6d892cc6f5d6c13f8000e1daad51943a063b1ec1a6c17a1471615261
|
|
| MD5 |
2c948a0ecd9df0936473440836611edb
|
|
| BLAKE2b-256 |
27dd7d68c1d366a58df8359456978a111b63c5c8c3a28b278b8a1b54df7eb13e
|
Provenance
The following attestation bundles were made for pygoblet-0.1.0.tar.gz:
Publisher:
python-publish.yml on NREL/pyGOBLET
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygoblet-0.1.0.tar.gz -
Subject digest:
8669af8a6d892cc6f5d6c13f8000e1daad51943a063b1ec1a6c17a1471615261 - Sigstore transparency entry: 569840381
- Sigstore integration time:
-
Permalink:
NREL/pyGOBLET@2c596e25055300a53315dc2e2e77055887ff5604 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/NREL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2c596e25055300a53315dc2e2e77055887ff5604 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pygoblet-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pygoblet-0.1.0-py3-none-any.whl
- Upload date:
- Size: 41.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
058477928db4b2afc4335c9bffb543bc22545fcfaa05a1bab88904401387f59b
|
|
| MD5 |
a4a24855bdf50236702364dbeee86ee6
|
|
| BLAKE2b-256 |
24dcdc324519601fa9b745e57bbdb1ae3d42125ba6a2950cfc082dacc5880744
|
Provenance
The following attestation bundles were made for pygoblet-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on NREL/pyGOBLET
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygoblet-0.1.0-py3-none-any.whl -
Subject digest:
058477928db4b2afc4335c9bffb543bc22545fcfaa05a1bab88904401387f59b - Sigstore transparency entry: 569840387
- Sigstore integration time:
-
Permalink:
NREL/pyGOBLET@2c596e25055300a53315dc2e2e77055887ff5604 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/NREL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2c596e25055300a53315dc2e2e77055887ff5604 -
Trigger Event:
release
-
Statement type: