Minimal Dependencies#

Surfaces is designed to be lightweight. The core installation requires only numpy as a dependency. Everything else is optional.


Core Installation#

pip install surfaces

This installs:

  • numpy: The only required dependency

  • Algebraic functions: All mathematical test functions (1D, 2D, N-D)

  • Engineering functions: All constrained design problems

  • BBOB functions: Black-Box Optimization Benchmarking suite

  • CEC functions: Competition on Evolutionary Computation benchmarks

With just numpy, you get access to the majority of test functions in the library.


Why Minimal Matters#

CI/CD Pipelines#

Lightweight dependencies mean faster CI/CD pipelines:

# GitHub Actions example
- name: Install test dependencies
  run: pip install surfaces  # Fast, minimal install

- name: Run optimizer benchmarks
  run: python benchmark.py

No waiting for heavy dependencies like scikit-learn or TensorFlow to install when you only need algebraic functions.

Reproducibility#

Fewer dependencies mean fewer version conflicts:

# Only one dependency to pin
surfaces==0.6.0
numpy>=1.18.0

Clean Environments#

Keep your virtual environments small:

$ pip install surfaces
$ pip list
Package    Version
---------- -------
numpy      1.24.0
surfaces   0.6.0

Optional Features#

Add features only when you need them:

Extra

Command

What You Get

ml

pip install surfaces[ml]

Machine Learning test functions (requires scikit-learn)

surrogates

pip install surfaces[surrogates]

Pre-trained surrogate models (requires onnxruntime)

viz

pip install surfaces[viz]

Visualization tools (requires plotly, matplotlib)

full

pip install surfaces[full]

All optional features


Installation Guide#

For detailed installation instructions for each optional feature:

CEC Functions

Additional dependencies for CEC benchmark suites.

CEC Functions
Machine Learning

scikit-learn, XGBoost, and ML-based functions.

Machine Learning
Surrogates

ONNX runtime and pre-trained models.

Surrogates
Visualization

Plotly and matplotlib for surface plots.

Visualization

Quick Check#

Verify your installation:

import surfaces
print(f"Surfaces version: {surfaces.__version__}")

# Core functions work with minimal install
from surfaces.test_functions.algebraic import SphereFunction
func = SphereFunction(n_dim=3)
print(f"Sphere(1,1,1) = {func({'x0': 1, 'x1': 1, 'x2': 1})}")

Next Steps#