Skip to main content

banana-bench

PyPI version Python Downloads License: MIT Build Status Docs Ruff

A comprehensive collection of 70+ standard mathematical benchmark functions for testing and evaluating optimization algorithms.

Why "banana-bench"? Rosenbrock's function — one of the most famous test functions in optimization, and part of this suite (rosenbrock) — is nicknamed the "banana function" for its curved, banana-shaped valley. This is the bench you run your optimizer through.

📚 Documentation

Full documentation is published at banana-bench.readthedocs.io, built from the sources in the docs/ directory:

🎯 Features

  • 70+ Benchmark Functions: Multimodal, Unimodal, and Special functions.
  • Rich Metadata: Access bounds, dimensions, known minima programmatically.
  • Visualization: 2D/3D plots, convergence tracking, and heatmaps.
  • Benchmarking Tools: Automated testing with BenchmarkRunner.
  • Zero Core Dependencies: Only NumPy is required.

📦 Installation

From PyPI

pip install banana-bench

From Source

git clone https://github.com/ak-rahul/banana-bench.git
cd banana-bench
pip install -e .

To install with visualization support:

pip install banana-bench[viz]

🚀 Quick Start

import numpy as np
from bananabench import ackley, BenchmarkRunner

# 1. Use a single function
x = np.zeros(5)
print(f"Ackley(0) = {ackley(x)}")

# 2. Run a benchmark suite
def my_optimizer(func, bounds):
    # Your optimization logic here...
    return np.zeros(len(bounds)), 0.0

runner = BenchmarkRunner(my_optimizer, "MyAlgo", n_runs=5)
results = runner.run_suite(functions=['sphere', 'ackley'])

For detailed usage, see the User Guide.

Metadata

Release files for banana-bench 0.2.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 banana-bench 0.2.0
File Size Uploaded
banana_bench-0.2.0.tar.gz 103.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for banana-bench 0.2.0
File Interpreter ABI Platform
banana_bench-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 158.0 kB

Release files / banana_bench-0.2.0.tar.gz

Download URL banana_bench-0.2.0.tar.gz
Size 103.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8c6dd66a9a8dca028a3083578d06ad67de0d6aa6b1865d8acb35987011b2a1e4
BLAKE2b-256 checksum
How to use checksums
5c94139730c1286350df70e5b44d1ee1c7c96c28a18f6f7ee843bb42f81e4869
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

Release files / banana_bench-0.2.0-py3-none-any.whl

Download URL banana_bench-0.2.0-py3-none-any.whl
Size 54.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
393461f9e2f8158eda17ef70753556d5c843694738e00a7f8c08e27ed1c85a1a
BLAKE2b-256 checksum
How to use checksums
4f96c89aab89de42183408e4835cdb7759df706149738de54652ab43206ed08f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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