Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5ae2b59
Initial integration
relf Jun 8, 2026
c131d43
Add some tests
relf Jun 8, 2026
5daa2cb
Adjust doc
relf Jun 9, 2026
2952cff
Test on ackley instead of rosenbrock
relf Jun 14, 2026
356e1ca
Improve documentation and exit status handling
relf Jun 14, 2026
11f3321
More tests
relf Jun 15, 2026
d55deb0
Test warm_start
relf Jun 15, 2026
8dd6b1b
Test Egor configuration
relf Jun 15, 2026
a0a1c20
Format
relf Jun 15, 2026
7c814e4
Add test with constraints
relf Jun 15, 2026
e1b19eb
Fix doc
relf Jun 15, 2026
d916f19
Improve doc
relf Jun 15, 2026
2c99a3f
Cleanup
relf Jun 15, 2026
e2607df
Do not import egobox for tests
relf Jun 15, 2026
75b74eb
Fix import order
relf Jun 15, 2026
aa50911
Add egobox dependency
relf Jun 16, 2026
95deaee
Remove print statements
relf Jun 16, 2026
090bbfd
Try TREGO to improve convergence on ackley test
relf Jun 16, 2026
109f7db
Add egobox in environment.yml
relf Jun 16, 2026
05abbbb
Try Egor conf to make tests pass on windows
relf Jun 16, 2026
27bf363
Add sphere test
relf Jun 16, 2026
2014daf
Use TREGO to improve test convergence
relf Jun 16, 2026
db61aa7
Relax test tolerance
relf Jun 16, 2026
7868382
Move egobox in testing deps and use a release range
relf Jun 21, 2026
c7f3163
Mention conda install
relf Jun 29, 2026
2b26b21
Remove trailing space
relf Jun 29, 2026
d671ede
Move egobox in testing section
relf Jul 6, 2026
45687fb
Use assert_solution_allclose
relf Jul 6, 2026
96e34dd
Initialize callCounter
relf Jul 6, 2026
01a078d
Suppress redondant default handling
relf Jul 6, 2026
45d12e1
Cleanup egobox < 0.37.6 handling
relf Jul 6, 2026
50dd5e9
Add docstrings
relf Jul 6, 2026
aea288e
Format
relf Jul 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ dependencies:
# testing
- parameterized
- testflo
- egobox >=0.37.6, <0.38.0
3 changes: 2 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The list of supported optimizers is shown on the sidebar to the left.
Of those, the following are not installed by default:

- SNOPT and NLPQLP are proprietary and must be obtained from their respective authors
- IPOPT and ParOpt must be installed separately
- IPOPT, ParOpt and Egor must be installed separately


pyOptSparse is a fork of `pyOpt <http://www.pyopt.org/>`_.
Expand Down Expand Up @@ -70,3 +70,4 @@ To get started, please see the :ref:`install` and the :ref:`quickstart`.
optimizers/CONMIN
optimizers/ALPSO
optimizers/UNO
optimizers/Egor
50 changes: 50 additions & 0 deletions doc/optimizers/Egor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.. _egor:

Egor
====

Egor is the surrogate-based Efficient Global Optimization (EGO) optimizer from the open-source
`EGObox <https://github.com/relf/EGObox>`_ library.

Egor uses `bayesian optimization <https://en.wikipedia.org/wiki/Bayesian_optimization>`_ techniques
well-suited to find the global optimum of an expansive-to-evaluate black-box function.
Basically, it uses a surrogate model to approximate the objective function and
an infill criterion (aka acquisition function) to guide the search for the optimum.

The pyOptSparse wrapper is derivative-free and targets single-objective, bounded,
continuous design spaces. Constraint values are passed to Egor with the pyOptSparse
constraint convention transformed to :math:`c(x) \le 0`.

Installation
------------

Egor is made available through the `egobox <https://pypi.org/project/egobox/>`_ Python package.

.. prompt::

$ pip install egobox

``egobox`` is also available via conda-forge::

$ conda install -c conda-forge egobox


Options
-------

Please refer to the Egor help for a complete listing of options and their default values.

.. prompt::

$ python
>>> import egobox as egx
>>> help(egx.Egor)
>>> help(egx.GpConfig)

pyoptSparse expects pickable objects while native Egor structures as GpConfig are not pickable.
To workaround this constraint, the pyOptSparse Egor wrapper uses dictionaries which are accepted by Egor
to update the default field values of Egor structures.
Names and default values of the fields are provided in the descriptions below.

.. optionstable:: pyoptsparse.pyEgor.pyEgor.Egor
:filename: Egor_options.yaml
98 changes: 98 additions & 0 deletions doc/optimizers/Egor_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
gp_config:
desc: |
GpConfig as a dict used by Egor for surrogate model configuration.
Main defaults are:

- ``regr_spec``: 1 (Constant)
- ``corr_spec``: 2 (Squared Exponential)
- ``kpls_dim``: no PLS dimensionality reduction (otherwise int)
- ``n_clusters``: no clustering (otherwise int)
cstr_tol:
desc: |
Constraint tolerances list passed to Egor (size n_cstr plus n_fcstr)
Default is ``1e-4`` for all constraints.
n_start:
desc: Number of infill optimization runs (best run selected)
n_doe:
desc: Number of initial DOE samples (0 lets Egor choose automatically)
doe:
desc: |
Initial DOE array, either x-only or concatenated x and y
to be passed as list of lists of floats. If not provided, Egor will generate a DOE automatically.
infill_strategy:
desc: |
Infill criterion:

- 1 = ``EI``,
- 2 = ``WB2``,
- 3 = ``WB2S``,
- 4 = ``LOG_EI`` (default)
cstr_infill:
desc: Enable constrained infill criterion (aka CEI)
cstr_strategy:
desc: |
Constraint strategy enum for surrogate constraint handling:

- 1 = ``MeanConstraint`` (default)
- 2 = ``UpperConfidenceBound``
qei_config:
desc: |
QEiConfig for batch (qEI) point selection passed as a dict with main keys being:

- ``batch``: size of batch (int)
- ``strategy``: qEI strategy enum
infill_optimizer:
desc: |
Internal infill optimizer:

- 1 = ``COBYLA`` (default)
- 2 = ``SLSQP``
trego:
desc: |
Enable TREGO (aka Trust Region EGO) algorithm configured with main parameters:

- ``n_gl_steps``: (nb of global search steps default 1, nb of local search steps default 4)
- ``beta``: trust region factor (default 0.9)

coego_n_coop:
desc: Number of cooperative groups for CoEGO algorithm
target:
desc: Known objective target used as stopping criterion
outdir:
desc: Output directory for Egor output files (configuration, does, history and warm start search)
warm_start:
desc: Load initial DOE from outdir when enabled
hot_start:
desc: |
Egor checkpoint restart parameter to be used in case of fallible environment
to continue with the same Egor parameterization till max iterations or timeout is reached.
failsafe_strategy:
desc: |
Failure handling enum

- 1 = ``REJECTION`` (default),
- 2 = ``IMPUTATION``,
- 3 = ``PROBA OF VIABILITY``
seed:
desc: Seed for random number generator (default -1 for random seed)
verbose:
desc: |
Verbosity level for Egor logging

- 0 = ``error`` (default)
- 1 = ``warning``
- 2 = ``info``
- 3 = ``debug``
max_iters:
desc: Egor iteration budget
run_info:
desc: Optional RunInfo used to pass additional information to Egor (e.g., for logging)
timeout:
desc: Optional timeout in seconds used as sttopping criterion for Egor minimize
fcstrs:
desc: |
Optional list of native Egobox function constraints passed directly as fcstrs
(instead of pyOptSparse constraints which are metamodelized)
fcstr_specs:
desc: |
Optional list of egobox.CstrSpec for function constraints passed as fcstrs
2 changes: 2 additions & 0 deletions pyoptsparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .pyNSGA2.pyNSGA2 import NSGA2
from .pyALPSO.pyALPSO import ALPSO
from .pyParOpt.ParOpt import ParOpt
from .pyEgor.pyEgor import Egor

__all__ = [
"History",
Expand All @@ -43,6 +44,7 @@
"NSGA2",
"ALPSO",
"ParOpt",
"Egor",
"testing",
"list_optimizers",
]
Empty file.
Loading
Loading