Library / SDK
7ossam81/EvoloPy avatar
7ossam81/EvoloPy

EvoloPy for comparing bounded optimization runs

EvoloPy toolbox provides classical and recent nature-inspired metaheuristic for the global optimization.

515 stars240 forksPythonApache-2.0

At a glance

What is it?
EvoloPy puts several nature-inspired optimizers behind a shared Python interface. It is particularly useful when the deliverable is a comparison of runs on the same objective and search bounds.
Who is it for?
Use EvoloPy for a repeatable comparison of bounded objectives when you want configuration files and convergence output alongside the result. If your application already needs explicit constraints, evaluate SciPy's differential evolution interface.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Activity is slowing. The repository last received commits 7 months ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

Editorial analysis

One objective, several candidate search methods

Suppose a fixture has two adjustable offsets. A simulator returns a single error score for each pair of offsets, and there is no derivative to pass to a solver. EvoloPy gives that experiment a common entry point. Encode the offsets in the candidate vector, give each coordinate a lower and upper bound, and use the simulator score as the quantity to minimize. You can run particle swarm optimization under that contract and use the same experiment settings to try a different optimizer.

Start with a built-in function before bringing in the simulator. A known benchmark makes it easier to spot a faulty import, a mistaken bound, or an unwritable output directory. After the harness works, change one part of the experiment at a time. A different simulator and different population setting in the same run make the resulting curve harder to interpret.

Give the F1 run its own directory

Install the package into the Python environment that will run your experiment.

bash
pip install EvoloPy

Call the documented entry point with the F1 benchmark name and a small, bounded search. The example uses a separate directory so you can distinguish these outputs from a subsequent comparison.

python
from EvoloPy.api import run_optimizer

result = run_optimizer(
    optimizer="PSO",
    objective_func="F1",
    dim=10,
    lb=-100,
    ub=100,
    population_size=30,
    iterations=50,
    num_runs=3,
    display_plots=False,
    results_directory="f1-pso-trial",
)
print(result["best_fitness"])
print(result["best_solution"])

Read the score together with the returned vector. The score tells you how the objective evaluated the selected candidate. The vector tells you which inputs produced it. This distinction matters when moving to a simulator. A surprisingly low score can come from feeding the simulator coordinates in an order different from the order expected by the objective function. Check the returned vector against the coordinate order and units used to define the bounds.

Where the benchmark name and the callable go

The shared interface selects an optimizer by name. An unknown name raises an error before the run. The objective is handled differently depending on its type. A string goes through the built-in benchmark path. A Python callable goes to the selected optimizer with the bounds, dimension, population size and iteration count. For a custom objective, the function name also helps determine where EvoloPy puts its files.

Separate output roots make sense when a notebook reuses one function name for different problems. The callable path organizes configuration and result files under the name of the objective, with plot directories that include the optimizer. Disabling plot display leaves that file organization in place. If the working directory is read-only, pass a writable results directory. If you omit the directory, the API generates a timestamped root.

Read repeated trials alongside their best score

The best score from three independent trials answers a narrower question than the score distribution. A single strong trial can make an optimizer look attractive even when the other two finish far away. If the goal is to select a method for a recurring simulation, inspect the repeated-run output and the convergence curves. A curve shows how the selected trial approached its final score under the requested iteration budget. Repeated trials help you see how much that result varies.

Keep the objective, bounds and trial count fixed when comparing optimizers. Also keep separate records of the package version and Python environment. Population size and iteration count set the experiment inputs, while the number of objective evaluations and the observed time can differ between methods. If each simulation call is expensive, count those calls in your objective wrapper and compare measured effort with the improvement in score.

When SciPy fits the objective better

SciPy's differential evolution routine is a useful alternative for an application that already passes a callable to SciPy. Its documented interface accepts bounds, constraints and integrality settings. The EvoloPy entry point used here exposes coordinate bounds and a choice of optimizer. If your fixture imposes a joint constraint on the two offsets, such as a limit on their combined magnitude, individual lower and upper bounds alone cannot enforce it.

EvoloPy's case is the shared experiment interface and the result files it creates while you compare methods. A script that needs only one bounded solver and already stores results in another system may benefit more from calling SciPy directly. Its differential evolution documentation specifies how the constraint and integrality arguments enter the search.

Check the two published license labels

The repository's LICENSE.txt at the reviewed commit contains Apache-2.0, while the README badge and PyPI metadata say MIT. Treat them as conflicting evidence. Before redistributing the repository or a Python distribution, inspect the license information shipped with the exact artifact and resolve the discrepancy with the maintainer if it affects your use. Record the version you install separately from the commit you read. That distinction also helps diagnose an API example that changes between source and package versions.

Editorial conclusion

Use EvoloPy for a repeatable comparison of bounded objectives when you want configuration files and convergence output alongside the result. If your application already needs explicit constraints, evaluate SciPy's differential evolution interface. For an EvoloPy trial, start by inspecting the F1 results directory and verify the license of the exact artifact you intend to distribute.

Frequently asked questions

Can EvoloPy take a Python function as its objective?

Yes. The run_optimizer API accepts either a built-in benchmark name or a callable. The callable receives the candidate vector and supplies the score.

Where does EvoloPy write its optimization results?

Use results_directory to specify the root. If omitted, the API creates a timestamped root.

Can EvoloPy repeat a run with the same settings?

Set num_runs to the number of independent trials for the objective and optimizer. Use the repeated results to check how much final scores vary.

Official sources

  1. EvoloPy/api.py
  2. LICENSE.txt
  3. Official README
  4. Project repository
  5. setup.py

Was this useful?