iwopy 0.1.8__py3-none-any.whl → 0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of iwopy might be problematic. Click here for more details.
- iwopy/VERSION +1 -1
- iwopy/__init__.py +12 -2
- iwopy/benchmarks/branin/__init__.py +1 -0
- iwopy/benchmarks/{branin.py → branin/branin.py} +29 -19
- iwopy/benchmarks/rosenbrock/__init__.py +1 -0
- iwopy/benchmarks/{rosenbrock.py → rosenbrock/rosenbrock.py} +35 -27
- iwopy/core/base.py +14 -8
- iwopy/core/constraint.py +20 -14
- iwopy/core/function.py +66 -60
- iwopy/core/function_list.py +51 -45
- iwopy/core/function_subset.py +33 -28
- iwopy/core/memory.py +43 -35
- iwopy/core/objective.py +4 -1
- iwopy/core/opt_results.py +79 -68
- iwopy/core/optimizer.py +15 -9
- iwopy/core/problem.py +116 -104
- iwopy/interfaces/pygmo/__init__.py +3 -0
- iwopy/interfaces/pygmo/algos.py +5 -2
- iwopy/interfaces/pygmo/imports.py +11 -0
- iwopy/interfaces/pygmo/optimizer.py +24 -18
- iwopy/interfaces/pygmo/problem.py +24 -19
- iwopy/interfaces/pymoo/__init__.py +4 -1
- iwopy/interfaces/pymoo/factory.py +6 -0
- iwopy/interfaces/pymoo/imports.py +11 -0
- iwopy/interfaces/pymoo/optimizer.py +75 -48
- iwopy/interfaces/pymoo/problem.py +330 -314
- iwopy/interfaces/scipy/optimizer.py +26 -20
- iwopy/optimizers/gg.py +41 -35
- iwopy/utils/discretization.py +107 -101
- iwopy/utils/stdout.py +2 -0
- iwopy/wrappers/discretize_reg_grid.py +65 -59
- iwopy/wrappers/local_fd.py +40 -34
- iwopy/wrappers/problem_wrapper.py +43 -37
- iwopy/wrappers/simple_constraint.py +47 -41
- iwopy/wrappers/simple_objective.py +42 -36
- iwopy/wrappers/simple_problem.py +40 -34
- {iwopy-0.1.8.dist-info → iwopy-0.2.dist-info}/METADATA +27 -4
- iwopy-0.2.dist-info/RECORD +50 -0
- iwopy-0.1.8.dist-info/RECORD +0 -48
- {iwopy-0.1.8.dist-info → iwopy-0.2.dist-info}/LICENSE +0 -0
- {iwopy-0.1.8.dist-info → iwopy-0.2.dist-info}/WHEEL +0 -0
- {iwopy-0.1.8.dist-info → iwopy-0.2.dist-info}/top_level.txt +0 -0
- {iwopy-0.1.8.dist-info → iwopy-0.2.dist-info}/zip-safe +0 -0
|
@@ -9,24 +9,7 @@ class SimpleConstraint(Constraint):
|
|
|
9
9
|
A simple constraint that assumes the
|
|
10
10
|
same variables as defined by the problem.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
----------
|
|
14
|
-
problem: iwopy.Problem
|
|
15
|
-
The underlying optimization problem
|
|
16
|
-
name: str
|
|
17
|
-
The function name
|
|
18
|
-
n_components : int
|
|
19
|
-
The number of components
|
|
20
|
-
mins : float or array
|
|
21
|
-
The minimal values of components,
|
|
22
|
-
shape: (n_components,)
|
|
23
|
-
maxs : float or array
|
|
24
|
-
The maximal values of components,
|
|
25
|
-
shape: (n_components,)
|
|
26
|
-
cnames : list of str, optional
|
|
27
|
-
The names of the components
|
|
28
|
-
has_ana_derivs = bool
|
|
29
|
-
Flag for analytical derivatives
|
|
12
|
+
:group: wrappers
|
|
30
13
|
|
|
31
14
|
"""
|
|
32
15
|
|
|
@@ -40,6 +23,29 @@ class SimpleConstraint(Constraint):
|
|
|
40
23
|
cnames=None,
|
|
41
24
|
has_ana_derivs=True,
|
|
42
25
|
):
|
|
26
|
+
"""
|
|
27
|
+
Constructor
|
|
28
|
+
|
|
29
|
+
Parameters
|
|
30
|
+
----------
|
|
31
|
+
problem: iwopy.Problem
|
|
32
|
+
The underlying optimization problem
|
|
33
|
+
name: str
|
|
34
|
+
The function name
|
|
35
|
+
n_components: int
|
|
36
|
+
The number of components
|
|
37
|
+
mins: float or array
|
|
38
|
+
The minimal values of components,
|
|
39
|
+
shape: (n_components,)
|
|
40
|
+
maxs: float or array
|
|
41
|
+
The maximal values of components,
|
|
42
|
+
shape: (n_components,)
|
|
43
|
+
cnames: list of str, optional
|
|
44
|
+
The names of the components
|
|
45
|
+
has_ana_derivs = bool
|
|
46
|
+
Flag for analytical derivatives
|
|
47
|
+
|
|
48
|
+
"""
|
|
43
49
|
if cnames is not None and len(cnames) != n_components:
|
|
44
50
|
raise ValueError(
|
|
45
51
|
f"Wrong number of component names, found {len(cnames)}, expected {n_components}: {cnames}"
|
|
@@ -67,13 +73,13 @@ class SimpleConstraint(Constraint):
|
|
|
67
73
|
|
|
68
74
|
Parameters
|
|
69
75
|
----------
|
|
70
|
-
x
|
|
76
|
+
x: tuple
|
|
71
77
|
The int and float variables in that order. Variables are
|
|
72
78
|
either scalars or numpy arrays in case of populations.
|
|
73
79
|
|
|
74
80
|
Returns
|
|
75
81
|
-------
|
|
76
|
-
result
|
|
82
|
+
result: float (or numpy.ndarray) or list of float (or numpy.ndarray)
|
|
77
83
|
For one component, a float, else a list of floats. For
|
|
78
84
|
population results, a array with shape (n_pop,) in case
|
|
79
85
|
of one component or a list of such arrays otherwise.
|
|
@@ -88,17 +94,17 @@ class SimpleConstraint(Constraint):
|
|
|
88
94
|
|
|
89
95
|
Parameters
|
|
90
96
|
----------
|
|
91
|
-
var
|
|
97
|
+
var: int
|
|
92
98
|
The index of the derivation varibable within the function
|
|
93
99
|
float variables
|
|
94
|
-
x
|
|
100
|
+
x: tuple
|
|
95
101
|
The int and float variables in that order.
|
|
96
|
-
components
|
|
102
|
+
components: list of int, optional
|
|
97
103
|
The selected components, or None for all
|
|
98
104
|
|
|
99
105
|
Returns
|
|
100
106
|
-------
|
|
101
|
-
result
|
|
107
|
+
result: float or list of float
|
|
102
108
|
For one component, a float, else a list of floats.
|
|
103
109
|
The length of list is 0 or 1 in case of single component,
|
|
104
110
|
or n_sel_components otherwise.
|
|
@@ -114,9 +120,9 @@ class SimpleConstraint(Constraint):
|
|
|
114
120
|
|
|
115
121
|
Returns
|
|
116
122
|
-------
|
|
117
|
-
min
|
|
123
|
+
min: np.array
|
|
118
124
|
The lower bounds, shape: (n_components,)
|
|
119
|
-
max
|
|
125
|
+
max: np.array
|
|
120
126
|
The upper bounds, shape: (n_components,)
|
|
121
127
|
|
|
122
128
|
"""
|
|
@@ -142,19 +148,19 @@ class SimpleConstraint(Constraint):
|
|
|
142
148
|
|
|
143
149
|
Parameters
|
|
144
150
|
----------
|
|
145
|
-
vars_int
|
|
151
|
+
vars_int: np.array
|
|
146
152
|
The integer variable values, shape: (n_vars_int,)
|
|
147
|
-
vars_float
|
|
153
|
+
vars_float: np.array
|
|
148
154
|
The float variable values, shape: (n_vars_float,)
|
|
149
|
-
problem_results
|
|
155
|
+
problem_results: Any
|
|
150
156
|
The results of the variable application
|
|
151
157
|
to the problem
|
|
152
|
-
components
|
|
158
|
+
components: list of int, optional
|
|
153
159
|
The selected components or None for all
|
|
154
160
|
|
|
155
161
|
Returns
|
|
156
162
|
-------
|
|
157
|
-
values
|
|
163
|
+
values: np.array
|
|
158
164
|
The component values, shape: (n_sel_components,)
|
|
159
165
|
|
|
160
166
|
"""
|
|
@@ -167,19 +173,19 @@ class SimpleConstraint(Constraint):
|
|
|
167
173
|
|
|
168
174
|
Parameters
|
|
169
175
|
----------
|
|
170
|
-
vars_int
|
|
176
|
+
vars_int: np.array
|
|
171
177
|
The integer variable values, shape: (n_pop, n_vars_int)
|
|
172
|
-
vars_float
|
|
178
|
+
vars_float: np.array
|
|
173
179
|
The float variable values, shape: (n_pop, n_vars_float)
|
|
174
|
-
problem_results
|
|
180
|
+
problem_results: Any
|
|
175
181
|
The results of the variable application
|
|
176
182
|
to the problem
|
|
177
|
-
components
|
|
183
|
+
components: list of int, optional
|
|
178
184
|
The selected components or None for all
|
|
179
185
|
|
|
180
186
|
Returns
|
|
181
187
|
-------
|
|
182
|
-
values
|
|
188
|
+
values: np.array
|
|
183
189
|
The component values, shape: (n_pop, n_sel_components,)
|
|
184
190
|
|
|
185
191
|
"""
|
|
@@ -200,18 +206,18 @@ class SimpleConstraint(Constraint):
|
|
|
200
206
|
|
|
201
207
|
Parameters
|
|
202
208
|
----------
|
|
203
|
-
vars_int
|
|
209
|
+
vars_int: np.array
|
|
204
210
|
The integer variable values, shape: (n_vars_int,)
|
|
205
|
-
vars_float
|
|
211
|
+
vars_float: np.array
|
|
206
212
|
The float variable values, shape: (n_vars_float,)
|
|
207
|
-
var
|
|
213
|
+
var: int
|
|
208
214
|
The index of the differentiation float variable
|
|
209
|
-
components
|
|
215
|
+
components: list of int
|
|
210
216
|
The selected components, or None for all
|
|
211
217
|
|
|
212
218
|
Returns
|
|
213
219
|
-------
|
|
214
|
-
deriv
|
|
220
|
+
deriv: numpy.ndarray
|
|
215
221
|
The derivative values, shape: (n_sel_components,)
|
|
216
222
|
|
|
217
223
|
"""
|
|
@@ -9,20 +9,7 @@ class SimpleObjective(Objective):
|
|
|
9
9
|
A simple objective that assumes the
|
|
10
10
|
same variables as defined by the problem.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
----------
|
|
14
|
-
problem: iwopy.Problem
|
|
15
|
-
The underlying optimization problem
|
|
16
|
-
name: str
|
|
17
|
-
The function name
|
|
18
|
-
n_components : int
|
|
19
|
-
The number of components
|
|
20
|
-
maximize : bool or list of bool
|
|
21
|
-
For each component, the maximization goal
|
|
22
|
-
cnames : list of str, optional
|
|
23
|
-
The names of the components
|
|
24
|
-
has_ana_derivs = bool
|
|
25
|
-
Flag for analytical derivatives
|
|
12
|
+
:group: wrappers
|
|
26
13
|
|
|
27
14
|
"""
|
|
28
15
|
|
|
@@ -35,6 +22,25 @@ class SimpleObjective(Objective):
|
|
|
35
22
|
cnames=None,
|
|
36
23
|
has_ana_derivs=True,
|
|
37
24
|
):
|
|
25
|
+
"""
|
|
26
|
+
Constructor
|
|
27
|
+
|
|
28
|
+
Parameters
|
|
29
|
+
----------
|
|
30
|
+
problem: iwopy.Problem
|
|
31
|
+
The underlying optimization problem
|
|
32
|
+
name: str
|
|
33
|
+
The function name
|
|
34
|
+
n_components: int
|
|
35
|
+
The number of components
|
|
36
|
+
maximize: bool or list of bool
|
|
37
|
+
For each component, the maximization goal
|
|
38
|
+
cnames: list of str, optional
|
|
39
|
+
The names of the components
|
|
40
|
+
has_ana_derivs = bool
|
|
41
|
+
Flag for analytical derivatives
|
|
42
|
+
|
|
43
|
+
"""
|
|
38
44
|
if cnames is not None and len(cnames) != n_components:
|
|
39
45
|
raise ValueError(
|
|
40
46
|
f"Wrong number of component names, found {len(cnames)}, expected {n_components}: {cnames}"
|
|
@@ -60,13 +66,13 @@ class SimpleObjective(Objective):
|
|
|
60
66
|
|
|
61
67
|
Parameters
|
|
62
68
|
----------
|
|
63
|
-
x
|
|
69
|
+
x: tuple
|
|
64
70
|
The int and float variables in that order. Variables are
|
|
65
71
|
either scalars or numpy arrays in case of populations.
|
|
66
72
|
|
|
67
73
|
Returns
|
|
68
74
|
-------
|
|
69
|
-
result
|
|
75
|
+
result: float (or numpy.ndarray) or list of float (or numpy.ndarray)
|
|
70
76
|
For one component, a float, else a list of floats. For
|
|
71
77
|
population results, a array with shape (n_pop,) in case
|
|
72
78
|
of one component or a list of such arrays otherwise.
|
|
@@ -81,17 +87,17 @@ class SimpleObjective(Objective):
|
|
|
81
87
|
|
|
82
88
|
Parameters
|
|
83
89
|
----------
|
|
84
|
-
var
|
|
90
|
+
var: int
|
|
85
91
|
The index of the derivation varibable within the function
|
|
86
92
|
float variables
|
|
87
|
-
x
|
|
93
|
+
x: tuple
|
|
88
94
|
The int and float variables in that order.
|
|
89
|
-
components
|
|
95
|
+
components: list of int
|
|
90
96
|
The selected components
|
|
91
97
|
|
|
92
98
|
Returns
|
|
93
99
|
-------
|
|
94
|
-
result
|
|
100
|
+
result: float or list of float
|
|
95
101
|
For one component, a float, else a list of floats.
|
|
96
102
|
The length of list is 0 or 1 in case of single component,
|
|
97
103
|
or n_sel_components otherwise.
|
|
@@ -118,7 +124,7 @@ class SimpleObjective(Objective):
|
|
|
118
124
|
|
|
119
125
|
Returns
|
|
120
126
|
-------
|
|
121
|
-
flags
|
|
127
|
+
flags: np.array
|
|
122
128
|
Bool array for component maximization,
|
|
123
129
|
shape: (n_components,)
|
|
124
130
|
|
|
@@ -145,19 +151,19 @@ class SimpleObjective(Objective):
|
|
|
145
151
|
|
|
146
152
|
Parameters
|
|
147
153
|
----------
|
|
148
|
-
vars_int
|
|
154
|
+
vars_int: np.array
|
|
149
155
|
The integer variable values, shape: (n_vars_int,)
|
|
150
|
-
vars_float
|
|
156
|
+
vars_float: np.array
|
|
151
157
|
The float variable values, shape: (n_vars_float,)
|
|
152
|
-
problem_results
|
|
158
|
+
problem_results: Any
|
|
153
159
|
The results of the variable application
|
|
154
160
|
to the problem
|
|
155
|
-
components
|
|
161
|
+
components: list of int, optional
|
|
156
162
|
The selected components or None for all
|
|
157
163
|
|
|
158
164
|
Returns
|
|
159
165
|
-------
|
|
160
|
-
values
|
|
166
|
+
values: np.array
|
|
161
167
|
The component values, shape: (n_sel_components,)
|
|
162
168
|
|
|
163
169
|
"""
|
|
@@ -170,19 +176,19 @@ class SimpleObjective(Objective):
|
|
|
170
176
|
|
|
171
177
|
Parameters
|
|
172
178
|
----------
|
|
173
|
-
vars_int
|
|
179
|
+
vars_int: np.array
|
|
174
180
|
The integer variable values, shape: (n_pop, n_vars_int)
|
|
175
|
-
vars_float
|
|
181
|
+
vars_float: np.array
|
|
176
182
|
The float variable values, shape: (n_pop, n_vars_float)
|
|
177
|
-
problem_results
|
|
183
|
+
problem_results: Any
|
|
178
184
|
The results of the variable application
|
|
179
185
|
to the problem
|
|
180
|
-
components
|
|
186
|
+
components: list of int, optional
|
|
181
187
|
The selected components or None for all
|
|
182
188
|
|
|
183
189
|
Returns
|
|
184
190
|
-------
|
|
185
|
-
values
|
|
191
|
+
values: np.array
|
|
186
192
|
The component values, shape: (n_pop, n_sel_components,)
|
|
187
193
|
|
|
188
194
|
"""
|
|
@@ -203,18 +209,18 @@ class SimpleObjective(Objective):
|
|
|
203
209
|
|
|
204
210
|
Parameters
|
|
205
211
|
----------
|
|
206
|
-
vars_int
|
|
212
|
+
vars_int: np.array
|
|
207
213
|
The integer variable values, shape: (n_vars_int,)
|
|
208
|
-
vars_float
|
|
214
|
+
vars_float: np.array
|
|
209
215
|
The float variable values, shape: (n_vars_float,)
|
|
210
|
-
var
|
|
216
|
+
var: int
|
|
211
217
|
The index of the differentiation float variable
|
|
212
|
-
components
|
|
218
|
+
components: list of int
|
|
213
219
|
The selected components, or None for all
|
|
214
220
|
|
|
215
221
|
Returns
|
|
216
222
|
-------
|
|
217
|
-
deriv
|
|
223
|
+
deriv: numpy.ndarray
|
|
218
224
|
The derivative values, shape: (n_sel_components,)
|
|
219
225
|
|
|
220
226
|
"""
|
iwopy/wrappers/simple_problem.py
CHANGED
|
@@ -8,32 +8,7 @@ class SimpleProblem(Problem):
|
|
|
8
8
|
A problem which simply pipes variables to its
|
|
9
9
|
objectives and constraints.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
----------
|
|
13
|
-
int_vars : dict or array-like
|
|
14
|
-
The integer variables, either dict with name str
|
|
15
|
-
to initial value mapping, or list of variable names
|
|
16
|
-
float_vars : dict or array-like
|
|
17
|
-
The float variables, either dict with name str
|
|
18
|
-
to initial value mapping, or list of variable names
|
|
19
|
-
init_values_int : list of float, optional
|
|
20
|
-
The initial values, in case of list type int_vars
|
|
21
|
-
init_values_float : list of float, optional
|
|
22
|
-
The initial values, in case of list type float_vars
|
|
23
|
-
min_values_int : dict or list, optional
|
|
24
|
-
The minimal values of the variables. Use `-self.INT_INF`
|
|
25
|
-
for left-unbounded cases. None sets all values as such.
|
|
26
|
-
max_values_int : dict or list, optional
|
|
27
|
-
The maximal values of the variables. Use `self.INT_INF`
|
|
28
|
-
for right-unbounded cases. None sets all values as such.
|
|
29
|
-
min_values_float : dict or list, optional
|
|
30
|
-
The minimal values of the variables. Use `-np.inf`
|
|
31
|
-
for left-unbounded cases. None sets all values as such.
|
|
32
|
-
max_values_float : dict or list, optional
|
|
33
|
-
The maximal values of the variables. Use `np.inf`
|
|
34
|
-
for right-unbounded cases. None sets all values as such.
|
|
35
|
-
kwargs : dict, optional
|
|
36
|
-
Additional parameters for the Problem class
|
|
11
|
+
:group: wrappers
|
|
37
12
|
|
|
38
13
|
"""
|
|
39
14
|
|
|
@@ -50,6 +25,37 @@ class SimpleProblem(Problem):
|
|
|
50
25
|
max_values_float=None,
|
|
51
26
|
**kwargs,
|
|
52
27
|
):
|
|
28
|
+
"""
|
|
29
|
+
Constructor
|
|
30
|
+
|
|
31
|
+
Parameters
|
|
32
|
+
----------
|
|
33
|
+
int_vars: dict or array-like
|
|
34
|
+
The integer variables, either dict with name str
|
|
35
|
+
to initial value mapping, or list of variable names
|
|
36
|
+
float_vars: dict or array-like
|
|
37
|
+
The float variables, either dict with name str
|
|
38
|
+
to initial value mapping, or list of variable names
|
|
39
|
+
init_values_int: list of float, optional
|
|
40
|
+
The initial values, in case of list type int_vars
|
|
41
|
+
init_values_float: list of float, optional
|
|
42
|
+
The initial values, in case of list type float_vars
|
|
43
|
+
min_values_int: dict or list, optional
|
|
44
|
+
The minimal values of the variables. Use `-self.INT_INF`
|
|
45
|
+
for left-unbounded cases. None sets all values as such.
|
|
46
|
+
max_values_int: dict or list, optional
|
|
47
|
+
The maximal values of the variables. Use `self.INT_INF`
|
|
48
|
+
for right-unbounded cases. None sets all values as such.
|
|
49
|
+
min_values_float: dict or list, optional
|
|
50
|
+
The minimal values of the variables. Use `-np.inf`
|
|
51
|
+
for left-unbounded cases. None sets all values as such.
|
|
52
|
+
max_values_float: dict or list, optional
|
|
53
|
+
The maximal values of the variables. Use `np.inf`
|
|
54
|
+
for right-unbounded cases. None sets all values as such.
|
|
55
|
+
kwargs: dict, optional
|
|
56
|
+
Additional parameters for the Problem class
|
|
57
|
+
|
|
58
|
+
"""
|
|
53
59
|
super().__init__(name, **kwargs)
|
|
54
60
|
|
|
55
61
|
if int_vars is None and float_vars is None:
|
|
@@ -129,7 +135,7 @@ class SimpleProblem(Problem):
|
|
|
129
135
|
|
|
130
136
|
Returns
|
|
131
137
|
-------
|
|
132
|
-
names
|
|
138
|
+
names: list of str
|
|
133
139
|
The names of the integer variables
|
|
134
140
|
|
|
135
141
|
"""
|
|
@@ -141,7 +147,7 @@ class SimpleProblem(Problem):
|
|
|
141
147
|
|
|
142
148
|
Returns
|
|
143
149
|
-------
|
|
144
|
-
values
|
|
150
|
+
values: numpy.ndarray
|
|
145
151
|
Initial int values, shape: (n_vars_int,)
|
|
146
152
|
|
|
147
153
|
"""
|
|
@@ -155,7 +161,7 @@ class SimpleProblem(Problem):
|
|
|
155
161
|
|
|
156
162
|
Returns
|
|
157
163
|
-------
|
|
158
|
-
values
|
|
164
|
+
values: numpy.ndarray
|
|
159
165
|
Minimal int values, shape: (n_vars_int,)
|
|
160
166
|
|
|
161
167
|
"""
|
|
@@ -171,7 +177,7 @@ class SimpleProblem(Problem):
|
|
|
171
177
|
|
|
172
178
|
Returns
|
|
173
179
|
-------
|
|
174
|
-
values
|
|
180
|
+
values: numpy.ndarray
|
|
175
181
|
Maximal int values, shape: (n_vars_int,)
|
|
176
182
|
|
|
177
183
|
"""
|
|
@@ -185,7 +191,7 @@ class SimpleProblem(Problem):
|
|
|
185
191
|
|
|
186
192
|
Returns
|
|
187
193
|
-------
|
|
188
|
-
names
|
|
194
|
+
names: list of str
|
|
189
195
|
The names of the float variables
|
|
190
196
|
|
|
191
197
|
"""
|
|
@@ -197,7 +203,7 @@ class SimpleProblem(Problem):
|
|
|
197
203
|
|
|
198
204
|
Returns
|
|
199
205
|
-------
|
|
200
|
-
values
|
|
206
|
+
values: numpy.ndarray
|
|
201
207
|
Initial float values, shape: (n_vars_float,)
|
|
202
208
|
|
|
203
209
|
"""
|
|
@@ -211,7 +217,7 @@ class SimpleProblem(Problem):
|
|
|
211
217
|
|
|
212
218
|
Returns
|
|
213
219
|
-------
|
|
214
|
-
values
|
|
220
|
+
values: numpy.ndarray
|
|
215
221
|
Minimal float values, shape: (n_vars_float,)
|
|
216
222
|
|
|
217
223
|
"""
|
|
@@ -227,7 +233,7 @@ class SimpleProblem(Problem):
|
|
|
227
233
|
|
|
228
234
|
Returns
|
|
229
235
|
-------
|
|
230
|
-
values
|
|
236
|
+
values: numpy.ndarray
|
|
231
237
|
Maximal float values, shape: (n_vars_float,)
|
|
232
238
|
|
|
233
239
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: iwopy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2
|
|
4
4
|
Summary: Fraunhofer IWES optimization tools in Python
|
|
5
5
|
Home-page: https://github.com/FraunhoferIWES/iwopy
|
|
6
6
|
Author: Fraunhofer IWES
|
|
@@ -21,21 +21,29 @@ Requires-Dist: numpy
|
|
|
21
21
|
Requires-Dist: scipy
|
|
22
22
|
Requires-Dist: matplotlib
|
|
23
23
|
Provides-Extra: all
|
|
24
|
+
Requires-Dist: flake8 ; extra == 'all'
|
|
25
|
+
Requires-Dist: pytest ; extra == 'all'
|
|
24
26
|
Requires-Dist: pygmo ; extra == 'all'
|
|
25
27
|
Requires-Dist: pymoo >=0.6 ; extra == 'all'
|
|
28
|
+
Requires-Dist: sphinx ; extra == 'all'
|
|
29
|
+
Requires-Dist: sphinx-immaterial ; extra == 'all'
|
|
30
|
+
Requires-Dist: nbsphinx ; extra == 'all'
|
|
31
|
+
Requires-Dist: ipykernel ; extra == 'all'
|
|
32
|
+
Requires-Dist: ipywidgets ; extra == 'all'
|
|
33
|
+
Requires-Dist: m2r2 ; extra == 'all'
|
|
26
34
|
Provides-Extra: doc
|
|
27
35
|
Requires-Dist: sphinx ; extra == 'doc'
|
|
28
|
-
Requires-Dist: sphinx-
|
|
29
|
-
Requires-Dist: sphinxcontrib-email ; extra == 'doc'
|
|
36
|
+
Requires-Dist: sphinx-immaterial ; extra == 'doc'
|
|
30
37
|
Requires-Dist: nbsphinx ; extra == 'doc'
|
|
31
38
|
Requires-Dist: ipykernel ; extra == 'doc'
|
|
39
|
+
Requires-Dist: ipywidgets ; extra == 'doc'
|
|
32
40
|
Requires-Dist: m2r2 ; extra == 'doc'
|
|
33
41
|
Provides-Extra: scripts
|
|
34
42
|
Provides-Extra: test
|
|
35
43
|
Requires-Dist: flake8 ; extra == 'test'
|
|
36
44
|
Requires-Dist: pytest ; extra == 'test'
|
|
37
|
-
Requires-Dist: pymoo >=0.6 ; extra == 'test'
|
|
38
45
|
Requires-Dist: pygmo ; extra == 'test'
|
|
46
|
+
Requires-Dist: pymoo >=0.6 ; extra == 'test'
|
|
39
47
|
|
|
40
48
|
# iwopy
|
|
41
49
|
|
|
@@ -49,6 +57,7 @@ The `iwopy` package is in fact a meta package that provides interfaces to other
|
|
|
49
57
|
|
|
50
58
|
- [pymoo](https://pymoo.org/index.html)
|
|
51
59
|
- [pygmo](https://esa.github.io/pygmo2/index.html)
|
|
60
|
+
- [scipy](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html)
|
|
52
61
|
- (more to come with future versions)
|
|
53
62
|
|
|
54
63
|
`iwopy` can thus be understood as an attempt to provide *the best of all worlds* when it comes to solving optimization problems with Python. This has not yet been achieved, since above list of accessable optimization packages is obviously incomplete, but it's a start. All the credit for implementing the invoked optimizers goes to the original package providers.
|
|
@@ -141,6 +150,20 @@ Then you can either install from this directory via
|
|
|
141
150
|
pip install -e .
|
|
142
151
|
```
|
|
143
152
|
|
|
153
|
+
## Testing
|
|
154
|
+
|
|
155
|
+
For testing, please clone the repository and install the required dependencies:
|
|
156
|
+
```console
|
|
157
|
+
git clone https://github.com/FraunhoferIWES/iwopy.git
|
|
158
|
+
cd iwopy
|
|
159
|
+
pip install -e .[test]
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The tests are then run by
|
|
163
|
+
```console
|
|
164
|
+
pytest tests
|
|
165
|
+
```
|
|
166
|
+
|
|
144
167
|
## Contributing
|
|
145
168
|
|
|
146
169
|
1. Fork _iwopy_ on _github_.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
iwopy/VERSION,sha256=iJML0FHSFKlzWBuUkqXKEQrqP91dxlpovERLYXOHe70,4
|
|
2
|
+
iwopy/__init__.py,sha256=-A_J0FMdwFSOn9zqmwcwxX_mxG_1kGKFSFhd3lRHfuo,593
|
|
3
|
+
iwopy/benchmarks/__init__.py,sha256=WQii3TCGi4Q30p_X86mCOQ3RsYpPFegsMHedbQX4QC4,46
|
|
4
|
+
iwopy/benchmarks/branin/__init__.py,sha256=2EghFl_V3-fYuxuUeN6f6U6FGTD_e0jNMdde-Ggkg1M,51
|
|
5
|
+
iwopy/benchmarks/branin/branin.py,sha256=B5rJsYsBQtzruLPA3GSyoBqtPiG0A-j_Xrsy-n1Pz6o,2777
|
|
6
|
+
iwopy/benchmarks/rosenbrock/__init__.py,sha256=qlJnw2gcSqcFQXJEtk-bRRNb5Q3kJftm3bNyEu_2ieo,63
|
|
7
|
+
iwopy/benchmarks/rosenbrock/rosenbrock.py,sha256=Jm8TIiKmbQ0Jl-DNd1lPYvAcuCI40ghECGZa6vXSgho,2644
|
|
8
|
+
iwopy/core/__init__.py,sha256=IxD4Rzv_JukRMd8fo5e1SZ-QPHZNScOskzdLJCliMNA,389
|
|
9
|
+
iwopy/core/base.py,sha256=mS-eaQ19Ae-l10sAAEUq2bWQyyIAohXSBeQxZY_OMtw,1412
|
|
10
|
+
iwopy/core/constraint.py,sha256=QnamH_lzkW8-cvGKM7h04srQf74dfnDsUafhf7fMcWo,3077
|
|
11
|
+
iwopy/core/function.py,sha256=1SQUdTy3xXzyKUsovqGhEChtRp-3aSk3xCvCjYFVWCo,12385
|
|
12
|
+
iwopy/core/function_list.py,sha256=uojc_DN_erfkjcX6JxH_d9SRJ92gnXDsS3hROytBRT4,13338
|
|
13
|
+
iwopy/core/function_subset.py,sha256=mad1cfuMbl5OlfZ-LbHpZm1FjqfJ33xbsQrAPvDmeWo,5318
|
|
14
|
+
iwopy/core/memory.py,sha256=pOCbsMvSVYhKTqvq_esxRrNi93Il6mx0o9_eNE6uh_8,6531
|
|
15
|
+
iwopy/core/objective.py,sha256=OsxzGJMF5UdHdoTpaLjuqVOEZgbLZnCryDUX7IjfX_Y,465
|
|
16
|
+
iwopy/core/opt_results.py,sha256=ArlCj9w0N6a4VqyvVB3LVqaN8c4bTQdsAsZGI_p5mPQ,10088
|
|
17
|
+
iwopy/core/optimizer.py,sha256=IMmHqFClzHq92cn-mCTq6Jo8e9MfArPPyU1CjwttKw4,4154
|
|
18
|
+
iwopy/core/problem.py,sha256=7SuM9PUvYwFkkNEIEz29JXgZwE9bFlEknEW7-QEJ-Fw,30676
|
|
19
|
+
iwopy/interfaces/__init__.py,sha256=HdZPhQxuaPEpTSEwP4tFOxw55Km0NqqCvl8t1Otzu88,60
|
|
20
|
+
iwopy/interfaces/pygmo/__init__.py,sha256=Or3HOQEuCubPBpGAgWJSBFVYm4gR1oPkYbfnvmiY6Ts,121
|
|
21
|
+
iwopy/interfaces/pygmo/algos.py,sha256=30GQobLQjjUxgcxjFWzUhFqk4ygG66JgjmmvzJcKn1I,10746
|
|
22
|
+
iwopy/interfaces/pygmo/imports.py,sha256=7Q8hWnH43BykECWpvjmEpcndDYFnqdJVAz5nFftqERU,532
|
|
23
|
+
iwopy/interfaces/pygmo/optimizer.py,sha256=eJJkGRVHXEIlx62mr7-fREethUTK-ZRuhPBpeNL6jpQ,3719
|
|
24
|
+
iwopy/interfaces/pygmo/problem.py,sha256=RQ0EpruVb5XqzUCume7TsZ2N0yTm2CbmQpCiQXQ2t4s,6909
|
|
25
|
+
iwopy/interfaces/pymoo/__init__.py,sha256=Lu2bAHPo6Bo_11PnpII9E_AAEJKR8XR8Vx0-4Olt6is,192
|
|
26
|
+
iwopy/interfaces/pymoo/factory.py,sha256=NYhXhxAvT90hvrcI_Apq_1JIdiX9acNRE6DnsFcz3ac,7212
|
|
27
|
+
iwopy/interfaces/pymoo/imports.py,sha256=nSvGdGZd0U92bRW7hFWexMLdp6L2E25hvHXgn0heGo0,2983
|
|
28
|
+
iwopy/interfaces/pymoo/optimizer.py,sha256=j_SZcJPunct_2wobHnSHIx3PcsTGYGSKzdGbyZS5w0k,7979
|
|
29
|
+
iwopy/interfaces/pymoo/problem.py,sha256=wf0dUuaYuZttEHFDocgxVyCOe8FmA9v2_zFI3iIa8VY,13043
|
|
30
|
+
iwopy/interfaces/scipy/__init__.py,sha256=3xnztLlcSgsjT4wwYAZsNGLyoc-T5sN5mlVjtuw7dQY,39
|
|
31
|
+
iwopy/interfaces/scipy/optimizer.py,sha256=q_TH-yZMB5TWKMNZ1A22NRc3xMbXfuFYOL2i9roLKiY,6276
|
|
32
|
+
iwopy/optimizers/__init__.py,sha256=qfKVpw4PtH61umx3GulWSN21jjiJuUf5oUTfUGxU1pk,19
|
|
33
|
+
iwopy/optimizers/gg.py,sha256=8w8jRDd2O8WWs1XLoVBScfAAF88DlRykWw-BwWxKN2o,14627
|
|
34
|
+
iwopy/utils/__init__.py,sha256=qPtdU7hcWPuwEeqd9G-SXqGrakvM9_zfwOiDJdPc8pk,122
|
|
35
|
+
iwopy/utils/discretization.py,sha256=cddQWYUYC-uvjlkqhvC44frhLvVyufzrUuJyaCi8MpI,36671
|
|
36
|
+
iwopy/utils/load.py,sha256=HBX55VV4H2azK1m3sGrD-led31KErBOS8EI0VGYuBG0,766
|
|
37
|
+
iwopy/utils/stdout.py,sha256=j9SO1MH1HRbL-Cy9nGj-E4vMh6MzgdkTvbdIsYs6yfo,708
|
|
38
|
+
iwopy/wrappers/__init__.py,sha256=dBQebvXOf0g-67Lof3rmscDzF20EO688Lm2ywIT_uEE,261
|
|
39
|
+
iwopy/wrappers/discretize_reg_grid.py,sha256=9WYuvH6IfWn-FebBUSqUVLZy6zwCgNyObpxqgf6Tk7Q,14291
|
|
40
|
+
iwopy/wrappers/local_fd.py,sha256=5shKOBdPPoq67x4r_o1cguMSoupX8oEkKjQap5nYCEc,11924
|
|
41
|
+
iwopy/wrappers/problem_wrapper.py,sha256=S5MZzJAWDRPgXQjxZynHeOxzalzHae5qdT8LNyFRP5M,6724
|
|
42
|
+
iwopy/wrappers/simple_constraint.py,sha256=SG9HGsiFx-UpFJGSbx8FsVcEsBjwARZmDIWvbjO8A3E,6744
|
|
43
|
+
iwopy/wrappers/simple_objective.py,sha256=d1N1Gb_sVtI1V2iDXiM3ixbkkHkZPtIrW8sCYhhSWsI,6618
|
|
44
|
+
iwopy/wrappers/simple_problem.py,sha256=rRgZn_vgCSG7owXZD8AAiHn5URFbTg501IayQ155TUA,7519
|
|
45
|
+
iwopy-0.2.dist-info/LICENSE,sha256=bBCH6mYTPzSepk2s2UUZ3II_ZYXrn1bnSqB85-aZHxU,1071
|
|
46
|
+
iwopy-0.2.dist-info/METADATA,sha256=dohSqTrrfU6eHM7B0-yGalDC0l3hinRHP__OrfeO5vQ,6123
|
|
47
|
+
iwopy-0.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
48
|
+
iwopy-0.2.dist-info/top_level.txt,sha256=51KNQr27ur_u9xKpuDl7GQiBINPKGOqMaMM63kFNzQE,6
|
|
49
|
+
iwopy-0.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
50
|
+
iwopy-0.2.dist-info/RECORD,,
|
iwopy-0.1.8.dist-info/RECORD
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
iwopy/VERSION,sha256=dvgfZOzijQvP453TX20U88h_4AC3eu4RVh4Y0ZGfYH4,6
|
|
2
|
-
iwopy/__init__.py,sha256=6bQcJJYYOA_DMXkGw3spJnQVutirE13L_HM5Q1RMrYY,389
|
|
3
|
-
iwopy/benchmarks/__init__.py,sha256=WQii3TCGi4Q30p_X86mCOQ3RsYpPFegsMHedbQX4QC4,46
|
|
4
|
-
iwopy/benchmarks/branin.py,sha256=5cDSbKf8zW-6zYtHz73JuGfeqiQ56CeI7jprcsvIyRg,2608
|
|
5
|
-
iwopy/benchmarks/rosenbrock.py,sha256=CYuiYKN1XcolHDW012Pa2-A8wgSX3Qy6H7GXsFH35Qw,2469
|
|
6
|
-
iwopy/core/__init__.py,sha256=IxD4Rzv_JukRMd8fo5e1SZ-QPHZNScOskzdLJCliMNA,389
|
|
7
|
-
iwopy/core/base.py,sha256=aeXjHWSTe84MDnCMdBewFYVQ8tZgw8C-gKot4VWcc-o,1337
|
|
8
|
-
iwopy/core/constraint.py,sha256=I_fBPcX4sLp7ZxMm4lriMgYtidTcOiVFi0sNHyWh1gk,3008
|
|
9
|
-
iwopy/core/function.py,sha256=p7aUocU58625cAtArMi3V-pAavYtqzWbSy4G_ryZKss,12266
|
|
10
|
-
iwopy/core/function_list.py,sha256=0494ZMlLj80fGDuLE6XMVUHOi2HFeIhLq-iExEroxTI,13289
|
|
11
|
-
iwopy/core/function_subset.py,sha256=aJNUZnC4QJE3B7RWtwoO2WKTPc_WNW6Vc367hh4CzSI,5244
|
|
12
|
-
iwopy/core/memory.py,sha256=YqY64a-y1wcwXJfD3NGcqH6cWUgH_MFKZMWYQInlbmo,6451
|
|
13
|
-
iwopy/core/objective.py,sha256=knqy7AVaaa7yso1qAL5tKzQh6NOw8lQRKWq-4kn0urM,447
|
|
14
|
-
iwopy/core/opt_results.py,sha256=2MYmtPRdbA4bsvS0ccX92NezHmdSpxpYL6Tn8AZ7vD0,9883
|
|
15
|
-
iwopy/core/optimizer.py,sha256=bpNVryWLG_Wp88orSEbj84UPXvz5mFQxqNPFhRh_abg,4069
|
|
16
|
-
iwopy/core/problem.py,sha256=ThYFshzwU6Ta3Pp4iBraGzBpw0eZ-Us74oDA9mZJuZA,30591
|
|
17
|
-
iwopy/interfaces/__init__.py,sha256=HdZPhQxuaPEpTSEwP4tFOxw55Km0NqqCvl8t1Otzu88,60
|
|
18
|
-
iwopy/interfaces/pygmo/__init__.py,sha256=qDtUhcYG6OVggiuk88uAEFtO5M0RFoMwwxoe1o3Sx9Q,39
|
|
19
|
-
iwopy/interfaces/pygmo/algos.py,sha256=BALObK2-88v4tXkxZoILwDoGbynKvL0pvuWsv6pucik,10717
|
|
20
|
-
iwopy/interfaces/pygmo/imports.py,sha256=iBjISncQckQSFyHak5iEdk_E5bNAfXzOH0d4_QfF2lQ,355
|
|
21
|
-
iwopy/interfaces/pygmo/optimizer.py,sha256=iEb65tBu_s7iBhtkwBGE-HktItuw0mPg5VcsZzDO4iU,3615
|
|
22
|
-
iwopy/interfaces/pygmo/problem.py,sha256=aWaarJhBoHSTsN8uIVrjoB48l_e1vUDoGROV5rBvaB0,6807
|
|
23
|
-
iwopy/interfaces/pymoo/__init__.py,sha256=6U0FRJ1Lgtfu3nf-iXMLeiShoLhLAa_bkS9cebOUmqQ,39
|
|
24
|
-
iwopy/interfaces/pymoo/factory.py,sha256=EtlwxZfYOscidqlJUF_UwfB_qw3bQVwAPhQSj7ImirA,7120
|
|
25
|
-
iwopy/interfaces/pymoo/imports.py,sha256=9-FyOaziO-O9gFKdHZvgCiAM43wPkvx1wC2nYkUzVNw,2806
|
|
26
|
-
iwopy/interfaces/pymoo/optimizer.py,sha256=mxqD0b_ZPEoBfocolT5vCrLUCuiw4eJXz52Bq-PzkAM,7437
|
|
27
|
-
iwopy/interfaces/pymoo/problem.py,sha256=Isi-PDhT3zHKPVllO92-R8WLnzqqVeJjXa4HFO24Ukk,13530
|
|
28
|
-
iwopy/interfaces/scipy/__init__.py,sha256=3xnztLlcSgsjT4wwYAZsNGLyoc-T5sN5mlVjtuw7dQY,39
|
|
29
|
-
iwopy/interfaces/scipy/optimizer.py,sha256=OHLTUwEhU5MqHADJBaSgLs4EsNun0mpy-raYUJH-7UI,6164
|
|
30
|
-
iwopy/optimizers/__init__.py,sha256=qfKVpw4PtH61umx3GulWSN21jjiJuUf5oUTfUGxU1pk,19
|
|
31
|
-
iwopy/optimizers/gg.py,sha256=hg-cUHP6oasvbnLJ4AJ5a3M-ugJdmNUz5JPJbeVQrGU,14479
|
|
32
|
-
iwopy/utils/__init__.py,sha256=qPtdU7hcWPuwEeqd9G-SXqGrakvM9_zfwOiDJdPc8pk,122
|
|
33
|
-
iwopy/utils/discretization.py,sha256=XBUm2zbIUAo7v8HFoeM0DaKiNJDVDbkdvpOPLO4Ffq8,36635
|
|
34
|
-
iwopy/utils/load.py,sha256=HBX55VV4H2azK1m3sGrD-led31KErBOS8EI0VGYuBG0,766
|
|
35
|
-
iwopy/utils/stdout.py,sha256=ZVyt8rT8GxQE6mpbFh8V5kf5i_UnP3AP8r9gCGhd1hg,689
|
|
36
|
-
iwopy/wrappers/__init__.py,sha256=dBQebvXOf0g-67Lof3rmscDzF20EO688Lm2ywIT_uEE,261
|
|
37
|
-
iwopy/wrappers/discretize_reg_grid.py,sha256=xVcDONdkmBlywNtxqiTATiTCQ0eFU5eMFUmUwaxl81k,14169
|
|
38
|
-
iwopy/wrappers/local_fd.py,sha256=hYbcbpnrCu5CajF9jcL-UDgYQLVZJsy5EJNQRyFByXA,11795
|
|
39
|
-
iwopy/wrappers/problem_wrapper.py,sha256=txebURNkFXpoAmxu14GZt5chmQTsrHNRCxOPp-3NPfc,6656
|
|
40
|
-
iwopy/wrappers/simple_constraint.py,sha256=Fq16EhV8Dr8zDEyHUvznIWsci-0DVEX4lNJYn2GeHt4,6632
|
|
41
|
-
iwopy/wrappers/simple_objective.py,sha256=M0QgPNy1aXeFZDXZpJ3FdJt4ifDSP3bCGaU9lbLsSew,6520
|
|
42
|
-
iwopy/wrappers/simple_problem.py,sha256=jlFikZw_wIcWezJoIeC0lYLRRh4WcTVDXUMEEqRyWmE,7365
|
|
43
|
-
iwopy-0.1.8.dist-info/LICENSE,sha256=bBCH6mYTPzSepk2s2UUZ3II_ZYXrn1bnSqB85-aZHxU,1071
|
|
44
|
-
iwopy-0.1.8.dist-info/METADATA,sha256=ePvr5iU2q1gF3Dk_VfNjgXlW8SfvMFBtKtuYQPK1tgw,5461
|
|
45
|
-
iwopy-0.1.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
46
|
-
iwopy-0.1.8.dist-info/top_level.txt,sha256=51KNQr27ur_u9xKpuDl7GQiBINPKGOqMaMM63kFNzQE,6
|
|
47
|
-
iwopy-0.1.8.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
48
|
-
iwopy-0.1.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|