Opytimark provides ready-to-use benchmark functions for evaluating optimization algorithms.
Opytimark supports Python 3.11 or newer. Read the full API reference at opytimark.readthedocs.io.
Opytimark is published on PyPI. Add it to a project managed by uv with:
uv add opytimarkFor a consumer installation in an existing Python environment, pip is also supported:
pip install opytimarkimport numpy as np
from opytimark.markers.n_dimensional import Sphere
value = Sphere()(np.array([1.0, 2.0, 3.0]))
print(value)More examples are available in examples/.
Imports do not reset NumPy's random state. For reproducible noisy or randomized
benchmarks, call np.random.seed(your_seed) explicitly before the experiment.
The 3.0.1 CEC conditioning, group-rotation, and composition corrections change some fitness values relative to 3.0.0. See numerical behavior before comparing old and new optimization results.
Library diagnostics use Python logging rather than writing to standard output. Applications control log handlers, output streams, and levels.
Follow the project conventions when changing Python code, scientific documentation, or tests.
Install uv, clone the repository, then run:
uv sync --locked
uv run pytest
uv run pre-commit run --all-files
uv run --locked --group docs sphinx-build -W --keep-going -b html docs docs/_build/html
uv buildIf you use Opytimark, please cite:
@misc{rosa2019opytimizer,
title={Opytimizer: A Nature-Inspired Python Optimizer},
author={Gustavo H. de Rosa and João P. Papa},
year={2019},
eprint={1912.13002},
archivePrefix={arXiv},
primaryClass={cs.NE}
}