Skip to content

Commit d8a3732

Browse files
committed
Merge branch 'main' into deploy
2 parents 93608da + 5517f86 commit d8a3732

File tree

198 files changed

+5651
-3898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+5651
-3898
lines changed

.github/workflows/deploy.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,51 +10,56 @@ jobs:
1010
build:
1111
runs-on: "${{ matrix.os }}"
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- name: "Set up Python"
15-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
1616
with:
1717
python-version: "${{ matrix.python-version }}"
1818
- name: "Install dependencies"
1919
run: |
2020
python -m pip install --upgrade pip
2121
pip install setuptools wheel numpy cython
22-
- uses: knicknic/[email protected].3
22+
- uses: knicknic/[email protected].4
2323
with:
2424
linux: "python setup.py sdist"
2525
macos: "python setup.py bdist_wheel"
2626
windows: "python setup.py bdist_wheel"
27-
- uses: actions/upload-artifact@v3
27+
- uses: actions/upload-artifact@v4
2828
with:
2929
name: dist
3030
path: dist
31+
overwrite: true
3132
strategy:
3233
matrix:
3334
os:
3435
- windows-latest
3536
- macos-latest
3637
python-version:
37-
- "3.7"
38-
- "3.8"
3938
- "3.9"
4039
- "3.10"
4140
- "3.11"
41+
- "3.12"
4242
include:
4343
- os: ubuntu-latest
4444
python-version: "3.11"
4545

4646
build-manylinux:
47-
runs-on: ubuntu-22.04
47+
runs-on: ubuntu-latest
4848
steps:
49-
- uses: actions/checkout@v3
50-
- uses: RalfG/[email protected]_x86_64
49+
- uses: actions/checkout@v4
50+
- name: Set up Python
51+
uses: actions/setup-python@v5
52+
with:
53+
python-version: 3.9
54+
- uses: RalfG/[email protected]_x86_64
5155
with:
5256
build-requirements: "cython numpy"
5357
pip-wheel-args: "-w ./dist --no-deps"
54-
python-versions: "cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310"
58+
python-versions: "cp39-cp39 cp310-cp310 cp311-cp311"
5559
- name: "Remove non-compatible packages"
5660
run: "sudo rm dist/*linux_x86_64.whl\n"
57-
- uses: actions/upload-artifact@v3
61+
- uses: actions/upload-artifact@v4
5862
with:
5963
name: dist
6064
path: dist
65+
overwrite: true

.github/workflows/testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
testing:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Install Python 3
19-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: '3.10'
2222
- name: Install Dependencies

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
repos:
2+
- repo: https://github.com/srstevenson/nb-clean
3+
rev: 3.1.0
4+
hooks:
5+
- id: nb-clean
6+
args:
7+
- --remove-empty-cells
8+
- --preserve-cell-metadata
9+
- tags
10+
- format
11+
- raw_mimetype
12+
- --

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
prune .
2-
recursive-include pymoo *.py *.pyx
2+
recursive-include pymoo *.py *.pyx *.pxd
33
recursive-include pymoo/cython/vendor *.cpp *.h
44
include LICENSE Makefile

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ pygments
1616
bs4
1717
pandoc
1818
ipykernel
19-
jinja2==3
19+
jinja2==3.1.3

docs/source/algorithms/algorithms.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
:ref:`AGE-MOEA <nb_agemoea>`, AGEMOEA, many,, Similar to NSGA-II but estimates the shape of the Pareto-front to compute a score replacing the crowding distance.
1717
:ref:`C-TAEA <nb_ctaea>`, CTAEA, many, x, An algorithm with a more sophisticated constraint-handling for many-objective optimization algoritms.
1818
:ref:`SMS-EMOA <nb_sms>`, CTAEA, many, x, An algorithm that uses hypervolume during the environmental survival.
19-
:ref:`RVEA <nb_rvea>`, RVEA, many, x, A reference direction based algorithm used an angle-penalized metric.
19+
:ref:`RVEA <nb_rvea>`, RVEA, many, , A reference direction based algorithm used an angle-penalized metric.

docs/source/algorithms/hyperparameters.ipynb

Lines changed: 25 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
{
44
"cell_type": "raw",
55
"metadata": {
6-
"pycharm": {
7-
"name": "#%% raw\n"
8-
},
96
"raw_mimetype": "text/restructuredtext"
107
},
118
"source": [
@@ -14,21 +11,14 @@
1411
},
1512
{
1613
"cell_type": "markdown",
17-
"metadata": {
18-
"pycharm": {
19-
"name": "#%% md\n"
20-
}
21-
},
14+
"metadata": {},
2215
"source": [
2316
"# Hyperparameters"
2417
]
2518
},
2619
{
2720
"cell_type": "raw",
2821
"metadata": {
29-
"pycharm": {
30-
"name": "#%% raw\n"
31-
},
3222
"raw_mimetype": "text/restructuredtext"
3323
},
3424
"source": [
@@ -40,29 +30,15 @@
4030
},
4131
{
4232
"cell_type": "markdown",
43-
"metadata": {
44-
"pycharm": {
45-
"name": "#%% md\n"
46-
}
47-
},
33+
"metadata": {},
4834
"source": [
4935
"Most algoriths have **hyperparameters**. For some optimization methods the parameters are already defined and can directly be optimized. For instance, for Differential Evolution (DE) the parameters can be found by:"
5036
]
5137
},
5238
{
5339
"cell_type": "code",
5440
"execution_count": null,
55-
"metadata": {
56-
"execution": {
57-
"iopub.execute_input": "2022-08-01T02:36:48.308627Z",
58-
"iopub.status.busy": "2022-08-01T02:36:48.308160Z",
59-
"iopub.status.idle": "2022-08-01T02:36:48.364512Z",
60-
"shell.execute_reply": "2022-08-01T02:36:48.363614Z"
61-
},
62-
"pycharm": {
63-
"name": "#%%\n"
64-
}
65-
},
41+
"metadata": {},
6642
"outputs": [],
6743
"source": [
6844
"import json\n",
@@ -75,40 +51,22 @@
7551
},
7652
{
7753
"cell_type": "markdown",
78-
"metadata": {
79-
"pycharm": {
80-
"name": "#%% md\n"
81-
}
82-
},
54+
"metadata": {},
8355
"source": [
8456
"If not provided directly, when initializing a `HyperparameterProblem` these variables are directly used for optimization."
8557
]
8658
},
8759
{
8860
"cell_type": "markdown",
89-
"metadata": {
90-
"pycharm": {
91-
"name": "#%% md\n"
92-
}
93-
},
61+
"metadata": {},
9462
"source": [
9563
"Secondly, one needs to define what exactly should be optimized. For instance, for a single run on a problem (with a fixed random seed) using the well-known parameter optimization toolkit [Optuna](https://optuna.org), the implementation may look as follows:"
9664
]
9765
},
9866
{
9967
"cell_type": "code",
10068
"execution_count": null,
101-
"metadata": {
102-
"execution": {
103-
"iopub.execute_input": "2022-08-01T02:36:48.369753Z",
104-
"iopub.status.busy": "2022-08-01T02:36:48.369415Z",
105-
"iopub.status.idle": "2022-08-01T02:36:59.415863Z",
106-
"shell.execute_reply": "2022-08-01T02:36:59.414988Z"
107-
},
108-
"pycharm": {
109-
"name": "#%%\n"
110-
}
111-
},
69+
"metadata": {},
11270
"outputs": [],
11371
"source": [
11472
"from pymoo.algorithms.hyperparameters import SingleObjectiveSingleRun, HyperparameterProblem\n",
@@ -141,29 +99,15 @@
14199
},
142100
{
143101
"cell_type": "markdown",
144-
"metadata": {
145-
"pycharm": {
146-
"name": "#%% md\n"
147-
}
148-
},
102+
"metadata": {},
149103
"source": [
150104
"Of course, you can also directly use the `MixedVariableGA` available in our framework:"
151105
]
152106
},
153107
{
154108
"cell_type": "code",
155109
"execution_count": null,
156-
"metadata": {
157-
"execution": {
158-
"iopub.execute_input": "2022-08-01T02:36:59.419480Z",
159-
"iopub.status.busy": "2022-08-01T02:36:59.419084Z",
160-
"iopub.status.idle": "2022-08-01T02:37:05.995629Z",
161-
"shell.execute_reply": "2022-08-01T02:37:05.994612Z"
162-
},
163-
"pycharm": {
164-
"name": "#%%\n"
165-
}
166-
},
110+
"metadata": {},
167111
"outputs": [],
168112
"source": [
169113
"from pymoo.algorithms.hyperparameters import SingleObjectiveSingleRun, HyperparameterProblem\n",
@@ -198,29 +142,15 @@
198142
},
199143
{
200144
"cell_type": "markdown",
201-
"metadata": {
202-
"pycharm": {
203-
"name": "#%% md\n"
204-
}
205-
},
145+
"metadata": {},
206146
"source": [
207147
"Now, optimizing the parameters for a **single random seed** is often not desirable. And this is precisely what makes hyper-parameter optimization computationally expensive. So instead of using just a single random seed, we can use the `MultiRun` performance assessment to average over multiple runs as follows:"
208148
]
209149
},
210150
{
211151
"cell_type": "code",
212152
"execution_count": null,
213-
"metadata": {
214-
"execution": {
215-
"iopub.execute_input": "2022-08-01T02:37:06.000183Z",
216-
"iopub.status.busy": "2022-08-01T02:37:05.999864Z",
217-
"iopub.status.idle": "2022-08-01T02:37:21.459474Z",
218-
"shell.execute_reply": "2022-08-01T02:37:21.458554Z"
219-
},
220-
"pycharm": {
221-
"name": "#%%\n"
222-
}
223-
},
153+
"metadata": {},
224154
"outputs": [],
225155
"source": [
226156
"from pymoo.algorithms.hyperparameters import HyperparameterProblem, MultiRun, stats_single_objective_mean\n",
@@ -255,29 +185,15 @@
255185
},
256186
{
257187
"cell_type": "markdown",
258-
"metadata": {
259-
"pycharm": {
260-
"name": "#%% md\n"
261-
}
262-
},
188+
"metadata": {},
263189
"source": [
264190
"Another way of performance measure is the number of evaluations until a specific goal has been reached. For single-objective optimization, such a goal is most likely until a minimum function value has been found. Thus, for the termination, we use `MinimumFunctionValueTermination` with a value of `1e-5`. We run the method for each random seed until this value has been reached or at most `500` function evaluations have taken place. The performance is then measured by the average number of function evaluations (`func_stats=stats_avg_nevals`) to reach the goal."
265191
]
266192
},
267193
{
268194
"cell_type": "code",
269195
"execution_count": null,
270-
"metadata": {
271-
"execution": {
272-
"iopub.execute_input": "2022-08-01T02:37:21.462989Z",
273-
"iopub.status.busy": "2022-08-01T02:37:21.462728Z",
274-
"iopub.status.idle": "2022-08-01T02:37:38.013305Z",
275-
"shell.execute_reply": "2022-08-01T02:37:38.012403Z"
276-
},
277-
"pycharm": {
278-
"name": "#%%\n"
279-
}
280-
},
196+
"metadata": {},
281197
"outputs": [],
282198
"source": [
283199
"from pymoo.algorithms.hyperparameters import HyperparameterProblem, MultiRun, stats_avg_nevals\n",
@@ -313,7 +229,19 @@
313229
]
314230
}
315231
],
316-
"metadata": {},
232+
"metadata": {
233+
"language_info": {
234+
"codemirror_mode": {
235+
"name": "ipython",
236+
"version": 3
237+
},
238+
"file_extension": ".py",
239+
"mimetype": "text/x-python",
240+
"name": "python",
241+
"nbconvert_exporter": "python",
242+
"pygments_lexer": "ipython3"
243+
}
244+
},
317245
"nbformat": 4,
318246
"nbformat_minor": 4
319247
}

docs/source/algorithms/index.ipynb

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
" moo/age2\n",
5353
" moo/rvea\n",
5454
" moo/sms\n",
55-
" moo/dnsga2\n"
55+
" moo/dnsga2\n",
56+
" moo/kgb\n"
5657
]
5758
},
5859
{
@@ -77,7 +78,24 @@
7778
]
7879
}
7980
],
80-
"metadata": {},
81+
"metadata": {
82+
"kernelspec": {
83+
"display_name": "Python 3 (ipykernel)",
84+
"language": "python",
85+
"name": "python3"
86+
},
87+
"language_info": {
88+
"codemirror_mode": {
89+
"name": "ipython",
90+
"version": 3
91+
},
92+
"file_extension": ".py",
93+
"mimetype": "text/x-python",
94+
"name": "python",
95+
"nbconvert_exporter": "python",
96+
"pygments_lexer": "ipython3"
97+
}
98+
},
8199
"nbformat": 4,
82100
"nbformat_minor": 4
83101
}

0 commit comments

Comments
 (0)