• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SMTorg / smt-optim / 28954437142

08 Jul 2026 03:24PM UTC coverage: 87.552% (+0.3%) from 87.28%
28954437142

Pull #23

github

web-flow
Merge 15e9c59e8 into acbef679d
Pull Request #23: feat: add MO-SEGO acquisition strategy

665 of 773 new or added lines in 17 files covered. (86.03%)

3 existing lines in 1 file now uncovered.

4403 of 5029 relevant lines covered (87.55%)

1.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.61
/src/smt_optim/benchmarks/multiobj/constrained.py
1
import numpy as np
2✔
2

3
from smt_optim.benchmarks.base import BenchmarkProblem
2✔
4

5

6
class BNH(BenchmarkProblem):
2✔
7
    def __init__(self):
2✔
8
        super().__init__()
2✔
9

10
        self.name: str = "BNH"
2✔
11

12
        self.num_dim: int = 2
2✔
13
        self.num_obj: int = 2
2✔
14
        self.num_cstr: int = 2
2✔
15
        self.num_fidelity = 1
2✔
16

17
        self.tags = [
2✔
18
            "multi-obj",
19
        ]
20

21
        self.bounds = np.array(
2✔
22
            [
23
                [0, 5],
24
                [0, 3],
25
            ]
26
        )
27

28
        # original bounds
29
        # bounds = np.array([[-15, 30]] * 2)
30

31
        self.objective = [
2✔
32
            self.f1,
33
            self.f2,
34
        ]
35

36
        self.constraints = [
2✔
37
            self.g1,
38
            self.g2,
39
        ]
40

41
    def f1(self, x):
2✔
42
        return 4 * x[0] ** 2 + 4 * x[1] ** 2
2✔
43

44
    def f2(self, x):
2✔
45
        return (x[0] - 5) ** 2 + (x[1] - 5) ** 2
2✔
46

47
    def g1(self, x):
2✔
48
        return (x[0] - 5) ** 2 + x[1] ** 2 - 25
2✔
49

50
    def g2(self, x):
2✔
51
        return -((x[0] - 8) ** 2) - (x[1] + 3) ** 2 + 7.7
2✔
52

53

54
class TNK(BenchmarkProblem):
2✔
55
    def __init__(self):
2✔
56
        super().__init__()
2✔
57

58
        self.name: str = "TNK"
2✔
59

60
        self.num_dim: int = 2
2✔
61
        self.num_obj: int = 2
2✔
62
        self.num_cstr: int = 2
2✔
63
        self.num_fidelity = 1
2✔
64

65
        self.tags = [
2✔
66
            "multi-obj",
67
        ]
68

69
        self.bounds = np.array(
2✔
70
            [
71
                [0, np.pi],
72
                [0, np.pi],
73
            ]
74
        )
75

76
        self.objective = [
2✔
77
            self.f1,
78
            self.f2,
79
        ]
80

81
        self.constraints = [
2✔
82
            self.g1,
83
            self.g2,
84
        ]
85

86
    def f1(self, x):
2✔
87
        return x[0]
2✔
88

89
    def f2(self, x):
2✔
90
        return x[1]
2✔
91

92
    def g1(self, x):
2✔
93
        return -(x[0] ** 2) - x[1] ** 2 + 1 + 0.1 * np.cos(16 * np.arctan(x[0] / x[1]))
2✔
94

95
    def g2(self, x):
2✔
96
        return (x[0] - 0.5) ** 2 + (x[1] - 0.5) ** 2 - 0.5
2✔
97

98

99
class OSY(BenchmarkProblem):
2✔
100
    def __init__(self):
2✔
101
        super().__init__()
2✔
102

103
        self.name: str = "OSY"
2✔
104

105
        self.num_dim: int = 6
2✔
106
        self.num_obj: int = 2
2✔
107
        self.num_cstr: int = 6
2✔
108
        self.num_fidelity = 1
2✔
109

110
        self.tags = [
2✔
111
            "multi-obj",
112
        ]
113

114
        self.bounds = np.array(
2✔
115
            [
116
                [0.0, 10.0],
117
                [0.0, 10.0],
118
                [0.0, 5.0],
119
                [0.0, 6.0],
120
                [0.0, 5.0],
121
                [0.0, 10.0],
122
            ]
123
        )
124

125
        self.objective = [
2✔
126
            self.f1,
127
            self.f2,
128
        ]
129

130
        self.constraints = [
2✔
131
            self.g1,
132
            self.g2,
133
            self.g3,
134
            self.g4,
135
            self.g5,
136
            self.g6,
137
        ]
138

139
    def f1(self, x):
2✔
140
        return -(
2✔
141
            25 * (x[0] - 2) ** 2
142
            + (x[1] - 2) ** 2
143
            + (x[2] - 1) ** 2
144
            + (x[3] - 4) ** 2
145
            + (x[4] - 1) ** 2
146
        )
147

148
    def f2(self, x):
2✔
149
        return np.sum(x**2)
2✔
150

151
    def g1(self, x):
2✔
152
        return -x[0] - x[1] + 2
2✔
153

154
    def g2(self, x):
2✔
155
        return -6 + x[0] + x[1]
2✔
156

157
    def g3(self, x):
2✔
158
        return -2 + x[1] - x[0]
2✔
159

160
    def g4(self, x):
2✔
161
        return -2 + x[0] - 3 * x[1]
2✔
162

163
    def g5(self, x):
2✔
164
        return -4 + (x[2] - 3) ** 2 + x[3]
2✔
165

166
    def g6(self, x):
2✔
167
        return -((x[4] - 3) ** 2) - x[5] + 4
2✔
168

169

170
if __name__ == "__main__":
2✔
NEW
171
    pass
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc