designoptpy 0.1.0__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.
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: designoptpy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Engineering optimization algorithms and applications
|
|
5
|
+
Author: Eduardo Rodrigues Della Noce
|
|
6
|
+
License-Expression: MIT OR Apache-2.0
|
|
7
|
+
License-File: LICENSE-APACHE
|
|
8
|
+
License-File: LICENSE-MIT
|
|
9
|
+
License-File: NOTICE
|
|
10
|
+
Requires-Python: <3.15,>=3.12
|
|
11
|
+
Requires-Dist: designoptpy-core[all]<0.2,>=0.1.0
|
|
12
|
+
Requires-Dist: designoptpy-point[all]<0.2,>=0.1.0
|
|
13
|
+
Requires-Dist: designoptpy-sso<0.2,>=0.1.0
|
|
14
|
+
Requires-Dist: designoptpy-surrogate<0.2,>=0.1.0
|
|
15
|
+
Requires-Dist: designoptpy-truss<0.2,>=0.1.0
|
|
16
|
+
Requires-Dist: designoptpy-xray<0.2,>=0.1.0
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# DesignOptPy workspace
|
|
20
|
+
|
|
21
|
+
This directory contains DesignOptPy, a Python implementation of point optimization and
|
|
22
|
+
Solution Space Optimization (SSO).
|
|
23
|
+
DesignOptPy selects design variables that meet requirements.
|
|
24
|
+
**Point optimization** searches for one best design.
|
|
25
|
+
**Solution space optimization** searches for a region of acceptable designs.
|
|
26
|
+
Start with the [example navigation guide](examples/README.md) for guided tutorials,
|
|
27
|
+
mathematical examples, and physical applications.
|
|
28
|
+
|
|
29
|
+
The tests check each behavior against expectations that follow from the mathematics.
|
|
30
|
+
|
|
31
|
+
## Solve and check a design
|
|
32
|
+
|
|
33
|
+
An objective receives a sample-major array: one design per row and one variable per column.
|
|
34
|
+
It returns one scalar objective value per row.
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
import numpy as np
|
|
38
|
+
from designoptpy.point import Bounds, OptimizationProblem, solve
|
|
39
|
+
|
|
40
|
+
problem = OptimizationProblem(
|
|
41
|
+
objective=lambda x: np.sum((x - [1.0, -2.0]) ** 2, axis=1),
|
|
42
|
+
initial_design=np.array([[0.0, 0.0]]),
|
|
43
|
+
bounds=Bounds([-3.0, -3.0], [3.0, 3.0]),
|
|
44
|
+
)
|
|
45
|
+
result = solve(problem, "scipy-minimize")
|
|
46
|
+
if not result.success:
|
|
47
|
+
raise RuntimeError(f"{result.status}: {result.message}")
|
|
48
|
+
np.testing.assert_allclose(result.point, [1.0, -2.0], atol=1e-3)
|
|
49
|
+
assert result.objective_value < 1e-6
|
|
50
|
+
print(np.round(result.point, 3)) # [ 1. -2.]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The objective is a sum of squares, so its analytic minimum is zero at `[1, -2]`.
|
|
54
|
+
Comparing the result with this known answer is a stronger check than checking termination alone.
|
|
55
|
+
For constrained problems, also evaluate the final physical residuals.
|
|
56
|
+
A budget-limited or infeasible outcome needs inspection before the design is used.
|
|
57
|
+
|
|
58
|
+
A stochastic search depends on random sampling.
|
|
59
|
+
An integer seed passed as `rng` makes the search reproducible:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from designoptpy.point import DifferentialEvolutionOptions
|
|
63
|
+
|
|
64
|
+
result = solve(
|
|
65
|
+
problem,
|
|
66
|
+
"differential-evolution",
|
|
67
|
+
options=DifferentialEvolutionOptions(rng=7, population_size=30, max_iterations=100),
|
|
68
|
+
)
|
|
69
|
+
assert result.objective_value < 1e-4 # Exact floating-point output varies.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Choose a component guide for the task:
|
|
73
|
+
|
|
74
|
+
| Task | Read |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| One smooth design with bounds and `c(x) <= 0` constraints | [Point optimization](packages/designoptpy-point/README.md), then the `scipy-minimize` adapter. |
|
|
77
|
+
| One design with a nonsmooth or multimodal objective | [Point optimization](packages/designoptpy-point/README.md): pattern search or seeded differential evolution. |
|
|
78
|
+
| A region of designs meeting inclusive response limits | [Solution space optimization](packages/designoptpy-sso/README.md) and the [bounded starting recipes](examples/tutorials/README.md#choose-a-bounded-workflow). |
|
|
79
|
+
| An expensive evaluator | [Surrogate models and active learning](packages/designoptpy-surrogate/README.md). |
|
|
80
|
+
| Interactive inspection of a design box | [Box X-Ray application](apps/designoptpy-xray/README.md). |
|
|
81
|
+
| Truss responses for requirements | [Truss analysis](packages/designoptpy-truss/README.md). |
|
|
82
|
+
| Shared evaluation, geometry, and numerics | [Core](packages/designoptpy-core/README.md). |
|
|
83
|
+
|
|
84
|
+
## Distributions
|
|
85
|
+
|
|
86
|
+
The repository is a `uv` workspace with independently installable distributions.
|
|
87
|
+
A workspace manages related Python projects together.
|
|
88
|
+
`uv` installs and runs the selected dependency environment.
|
|
89
|
+
A distribution is an installable project.
|
|
90
|
+
Its import namespace is the prefix that loads its Python modules.
|
|
91
|
+
The umbrella `designoptpy` installs the whole family.
|
|
92
|
+
An extra is an optional dependency group that a user selects at install time.
|
|
93
|
+
|
|
94
|
+
| Distribution | Import namespace | Responsibility |
|
|
95
|
+
| --- | --- | --- |
|
|
96
|
+
| `designoptpy` | No code of its own | Umbrella installing the complete family and all extras |
|
|
97
|
+
| `designoptpy-core` | `designoptpy.core` | Shared input/result rules, numerics, geometry, plotting, and input and output (I/O) |
|
|
98
|
+
| `designoptpy-point` | `designoptpy.point` | Point optimization |
|
|
99
|
+
| `designoptpy-surrogate` | `designoptpy.surrogate` | Surrogate models and active learning |
|
|
100
|
+
| `designoptpy-sso` | `designoptpy.sso` | Solution spaces, product families, and reusable X-Ray engine |
|
|
101
|
+
| `designoptpy-truss` | `designoptpy.truss` | Truss analysis and models |
|
|
102
|
+
| `designoptpy-xray` | `designoptpy.xray` | Interactive X-Ray application and console command |
|
|
103
|
+
|
|
104
|
+
X-Ray is an interactive view of a box of designs.
|
|
105
|
+
Each panel projects sampled requirement results onto two design variables.
|
|
106
|
+
|
|
107
|
+
Each component owns its source, tests, metadata, README, changelog, wheel, and source archive.
|
|
108
|
+
A wheel is an installable Python distribution archive.
|
|
109
|
+
Components and the umbrella can have separate versions and releases.
|
|
110
|
+
The umbrella wheel contains metadata only.
|
|
111
|
+
|
|
112
|
+
`examples/` is a development member.
|
|
113
|
+
`tooling/` supports development and is not published as library modules.
|
|
114
|
+
|
|
115
|
+
## Installation and availability
|
|
116
|
+
|
|
117
|
+
Use a CPython version that the `requires-python` metadata of the selected distribution accepts.
|
|
118
|
+
CPython is the standard Python implementation.
|
|
119
|
+
Every distribution accepts Python 3.12 to 3.14.
|
|
120
|
+
This checkout defines the intended package names.
|
|
121
|
+
The release owner must verify publication and registry ownership.
|
|
122
|
+
A package index stores distributions for installation.
|
|
123
|
+
After the packages are published to your index, run:
|
|
124
|
+
|
|
125
|
+
```shell
|
|
126
|
+
python -m pip install designoptpy # all components, X-Ray, workbook, color, and symbolic extras
|
|
127
|
+
python -m pip install designoptpy-point # point optimization and its dependencies only
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
For source development, run from `designoptpy`:
|
|
131
|
+
|
|
132
|
+
```shell
|
|
133
|
+
uv sync --locked --all-packages --group dev
|
|
134
|
+
# Or select one component and its runtime dependencies:
|
|
135
|
+
uv sync --locked --package designoptpy-point --no-dev
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
To install the complete source family with pip before publication, pass all local projects together.
|
|
139
|
+
Pip does not resolve `uv` workspace sources.
|
|
140
|
+
|
|
141
|
+
```shell
|
|
142
|
+
python -m pip install . ./packages/designoptpy-core ./packages/designoptpy-point ./packages/designoptpy-surrogate ./packages/designoptpy-sso ./packages/designoptpy-truss ./apps/designoptpy-xray
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
For point optimization alone, pass `./packages/designoptpy-core` and `./packages/designoptpy-point` together.
|
|
146
|
+
|
|
147
|
+
Extras and requirements:
|
|
148
|
+
|
|
149
|
+
- Core offers the optional extras `io`, `colors`, and `all`.
|
|
150
|
+
- Point offers the optional extras `symbolic` and `all`.
|
|
151
|
+
`symbolic` adds SymPy for exact symbolic coefficient extraction.
|
|
152
|
+
- The umbrella installs core and point with all of their extras, so it declares no extras of its own.
|
|
153
|
+
- Only the surrogate component requires scikit-learn.
|
|
154
|
+
- Every component that uses SciPy requires `scipy>=1.12,<2`.
|
|
155
|
+
- Every component and the X-Ray application require `matplotlib>=3.11,<4`.
|
|
156
|
+
Older Matplotlib cannot draw a three-dimensional polygon collection, such as a surface, with `facecolor="none"`.
|
|
157
|
+
|
|
158
|
+
Read a version with `importlib.metadata.version("designoptpy-point")` or `version("designoptpy")`.
|
|
159
|
+
The namespace follows Python Enhancement Proposal (PEP) 420 and has no `designoptpy/__init__.py`.
|
|
160
|
+
Separate wheels can therefore contribute `designoptpy.*` packages without sharing source files.
|
|
161
|
+
|
|
162
|
+
## Python API conventions
|
|
163
|
+
|
|
164
|
+
- Design collections have shape `(n_samples, n_dimensions)`.
|
|
165
|
+
- Python indices are zero-based: the first index is 0.
|
|
166
|
+
- Stochastic entry points take one random-generator argument named `rng`.
|
|
167
|
+
Their results can vary with random sampling.
|
|
168
|
+
The argument is a `numpy.random.Generator`, a nonnegative integer seed, or `None`.
|
|
169
|
+
`numpy.random.default_rng` converts it.
|
|
170
|
+
A Generator is used directly.
|
|
171
|
+
An integer seed creates a new seeded generator.
|
|
172
|
+
`None` draws fresh operating-system entropy.
|
|
173
|
+
- Operators and strategy callbacks receive the generator of the running method.
|
|
174
|
+
Examples are genetic-algorithm operators and candidate samplers.
|
|
175
|
+
They also name it `rng`, but they require a Generator.
|
|
176
|
+
- Four defaults use a fixed seed instead of fresh entropy, so default fits and reported metrics are reproducible:
|
|
177
|
+
- `designoptpy.surrogate.validation.cross_validate` has `rng=None`, and its fold partition then uses `CROSS_VALIDATION_PARTITION_SEED`.
|
|
178
|
+
- `designoptpy.surrogate.classification.train_svm_classifier` has `rng=None`, and its hyperparameter search then uses
|
|
179
|
+
`SVM_HYPERPARAMETER_SEED`.
|
|
180
|
+
- `CascadeForwardSurrogate.rng` and `GaussianProcessSurrogate.rng` default to the seed 0.
|
|
181
|
+
- The Monte Carlo `estimate_measure` of planar and corner SSO regions takes an integer `seed` instead.
|
|
182
|
+
The sample count and the seed also identify its cached estimate.
|
|
183
|
+
- Shared array aliases (`FloatArray`, `BoolArray`, `IntArray`) and coercion
|
|
184
|
+
helpers live in `designoptpy.core.arrays`; integer arrays use `numpy.int64`.
|
|
185
|
+
An alias gives an array type a reusable name. Coercion converts accepted inputs to the required array type.
|
|
186
|
+
- Public APIs use typed dataclasses and protocols.
|
|
187
|
+
A dataclass stores named settings or result fields.
|
|
188
|
+
A protocol specifies required methods and attributes without requiring inheritance from one class.
|
|
189
|
+
This interface-based compatibility is structural typing.
|
|
190
|
+
- Missing or unprocessed data remains `None`; it is not converted to zero.
|
|
191
|
+
- Names follow Python conventions, including the solver names of `designoptpy.point.solve`.
|
|
192
|
+
- Choice names follow one rule, the choice-name rule of `designoptpy.core.choices`.
|
|
193
|
+
A choice option takes one name from a fixed set: a solver, a sampler, a metric, a plot style, a file format, and so on.
|
|
194
|
+
A user-supplied name matches a valid name when both are equal after this normalization:
|
|
195
|
+
the ASCII letters `A` to `Z` become `a` to `z`, and `_` reads as `-`.
|
|
196
|
+
No other character changes: spaces are not trimmed, no character is removed, and letters outside ASCII keep their case.
|
|
197
|
+
So `"Two_Point"` names `"two-point"`, but `" two-point"` and `"twopoint"` name nothing.
|
|
198
|
+
The parsed value is the canonical name, the spelling of the library.
|
|
199
|
+
Records, logs, result files, `repr` text, and error messages show the canonical name, and an error for an unknown name lists the canonical names.
|
|
200
|
+
Two valid names of one set never have the same normalized text; a check rejects such a set.
|
|
201
|
+
The rule makes every case and separator spelling of one name select the same choice, in DesignOptPy and in DesignOptRs.
|
|
202
|
+
SciPy distance names match the SciPy names, aliases, and `test_` forms under the rule and reach SciPy in its spelling.
|
|
203
|
+
Column and field names in data files and workbooks, option keys, file paths, and free-text labels are not choice names.
|
|
204
|
+
Their readers keep their own rules.
|
|
205
|
+
- Plotting functions return Matplotlib figures, axes, or artists and do not change global figure defaults.
|
|
206
|
+
|
|
207
|
+
Terms of the result contract:
|
|
208
|
+
|
|
209
|
+
- A mapping returns responses.
|
|
210
|
+
- An evaluator compares those responses with requirements.
|
|
211
|
+
- Result records keep contextual `metadata` fields.
|
|
212
|
+
Nested payloads use descriptive names such as `response_metadata` and `evaluation_metadata`.
|
|
213
|
+
- A good design meets all performance requirements.
|
|
214
|
+
- A physically feasible design meets all physical feasibility requirements.
|
|
215
|
+
- A valid design is good and physically feasible.
|
|
216
|
+
- A model rejection, represented by `+inf`, means that the model gave no usable response.
|
|
217
|
+
- A projection legend says "good design" when no physical feasibility requirement exists.
|
|
218
|
+
Otherwise, it says "valid design" for the accepted category.
|
|
219
|
+
|
|
220
|
+
SSO keeps the count of requested designs.
|
|
221
|
+
Optional evaluation metadata keeps composite evaluation costs.
|
|
222
|
+
These include compensation evaluation counts and multifidelity uncertainty flags.
|
|
223
|
+
Pass `save_evaluation_metadata=True` when later inspection needs these per-design records.
|
|
224
|
+
|
|
225
|
+
Each component README states its method, options, result signals, and supported numeric domain.
|
|
226
|
+
The [core README](packages/designoptpy-core/README.md#evaluator-and-mapping-results) states the shared evaluator and mapping result contract.
|
|
227
|
+
|
|
228
|
+
```python
|
|
229
|
+
from designoptpy.core.geometry import Box
|
|
230
|
+
from designoptpy.point import Bounds, OptimizationProblem, solve
|
|
231
|
+
from designoptpy.sso import BoxSsoOptions, optimize_box
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Stability labels
|
|
235
|
+
|
|
236
|
+
Each public item of the five library distributions has one of three labels: Stable, Not yet in DesignOptRs, or Python only.
|
|
237
|
+
The label tells whether DesignOptRs, the Rust implementation in the `designoptrs` folder of the repository, shares the behavior.
|
|
238
|
+
It also tells a caller what to expect when the item changes, and what replaces the item in DesignOptRs.
|
|
239
|
+
|
|
240
|
+
- **Stable**: DesignOptRs has a counterpart, and DesignOptRs tests check the agreement.
|
|
241
|
+
A counterpart is a public item of a DesignOptRs library component with the same behavior under the shared names:
|
|
242
|
+
the option names and values, the result field names, and the status values.
|
|
243
|
+
The library components are the native numerical crates. The interfaces to other languages and the native lesson programs do not count.
|
|
244
|
+
The tests compare with reference vectors, which are recorded DesignOptPy inputs and outputs, or check invariants for random behavior.
|
|
245
|
+
Stable does not promise that the interface never changes.
|
|
246
|
+
It promises that DesignOptPy and DesignOptRs change it together, with changelog entries in both.
|
|
247
|
+
A caller can use the counterpart in DesignOptRs with the same names and the same behavior.
|
|
248
|
+
- **Not yet in DesignOptRs**: DesignOptRs has no counterpart, or the counterpart is incomplete: an option, a field, or a value is missing.
|
|
249
|
+
The contract can change in DesignOptPy alone until a promotion gives the item a complete counterpart.
|
|
250
|
+
A caller finds no complete counterpart in DesignOptRs yet.
|
|
251
|
+
All quality rules still apply: correct mathematics, truthful result signals, documentation, and behavior tests.
|
|
252
|
+
The label does not mean that the item is unfinished. It does not say whether DesignOptRs will take over the item.
|
|
253
|
+
- **Python only**: the item is an adapter that wraps SciPy, scikit-learn, or SymPy, and a caller selects or passes it.
|
|
254
|
+
An adapter converts the inputs and results between a third-party library and the DesignOptPy interface.
|
|
255
|
+
DesignOptRs fills the role of the adapter with a native algorithm, so the adapter gets no counterpart.
|
|
256
|
+
The marker names that native algorithm. A caller uses it in DesignOptRs instead of the adapter.
|
|
257
|
+
The results of the two implementations can differ, because the algorithms differ.
|
|
258
|
+
The contract can change in DesignOptPy alone, for example when the wrapped library changes.
|
|
259
|
+
All quality rules still apply.
|
|
260
|
+
|
|
261
|
+
Theory: DesignOptPy is the reference implementation for learning, research, and experimentation.
|
|
262
|
+
DesignOptRs is the stable, fast implementation, and it takes over confirmed DesignOptPy behavior.
|
|
263
|
+
A shared behavior must change in both implementations at the same time, so a stable item changes only in a coordinated change.
|
|
264
|
+
An item that is not yet in DesignOptRs has no such tie, so its contract can follow new research results in DesignOptPy first.
|
|
265
|
+
The selected adapters get no counterpart by policy: they give DesignOptPy callers the methods of SciPy, scikit-learn, and SymPy,
|
|
266
|
+
and DesignOptRs does not call Python libraries.
|
|
267
|
+
DesignOptRs fills the same roles with native algorithms, with their own names and options.
|
|
268
|
+
|
|
269
|
+
Where the label appears:
|
|
270
|
+
|
|
271
|
+
- An unmarked public item is stable, except for the names that the scope below places outside the labels.
|
|
272
|
+
Only the items labeled Not yet in DesignOptRs or Python only carry a marker.
|
|
273
|
+
- The docstring of a marked item has a paragraph directly after its summary line, so `help()` shows it.
|
|
274
|
+
The paragraph starts with one of three texts:
|
|
275
|
+
- `Not yet in DesignOptRs: this contract can change in DesignOptPy alone.`
|
|
276
|
+
- `Not yet in DesignOptRs: the DesignOptRs counterpart is incomplete (<what is missing>). This contract can change in DesignOptPy alone.`
|
|
277
|
+
- `Python only: this adapter wraps <SciPy, scikit-learn, or SymPy>. DesignOptRs fills this role with its native <algorithm> and has no counterpart.`
|
|
278
|
+
A marker that covers several adapters uses the plural: "these adapters wrap" and "these roles".
|
|
279
|
+
- A module docstring marker covers every public name of the module. A class marker covers its members.
|
|
280
|
+
A marker at the start of a parameter, attribute, or result field description covers that entry.
|
|
281
|
+
A sentence in a parameter description can label individual option values.
|
|
282
|
+
- In a component README, the first paragraph of the section that documents a marked item starts with the same text.
|
|
283
|
+
When the section also documents stable items, the paragraph that introduces the marked item starts with it.
|
|
284
|
+
A table row ends its description with "Not yet in DesignOptRs." or "Python only.".
|
|
285
|
+
A heading never carries the label, so links stay valid after a promotion.
|
|
286
|
+
- Search the docstrings and READMEs for `Not yet in DesignOptRs:` and `Python only:` to find every marked item.
|
|
287
|
+
No README keeps a list of them.
|
|
288
|
+
|
|
289
|
+
Scope:
|
|
290
|
+
|
|
291
|
+
- Labels apply to the public API of `designoptpy-core`, `designoptpy-point`, `designoptpy-surrogate`, `designoptpy-sso`, and `designoptpy-truss`.
|
|
292
|
+
- The example, tutorial, and research programs in `examples/`, the X-Ray application, the workspace tooling,
|
|
293
|
+
and private names (names that start with an underscore) carry no label.
|
|
294
|
+
They hold no importable contract that DesignOptRs mirrors.
|
|
295
|
+
- Host-language infrastructure names are outside the labels, so they carry no marker.
|
|
296
|
+
This group holds the NumPy array aliases and coercion helpers, the validation predicates, the record base classes,
|
|
297
|
+
the typing Protocols, the exception classes, `ConsoleLogging`, the clock and format helpers,
|
|
298
|
+
and the Matplotlib figure, style, and color helpers.
|
|
299
|
+
These names adapt the algorithms to Python, and they carry no behavior that DesignOptRs mirrors.
|
|
300
|
+
Each implementation provides these services in the idiom of its own language.
|
|
301
|
+
- A third-party adapter that a caller selects or passes is Python only when DesignOptRs fills its role with a native algorithm.
|
|
302
|
+
Examples are the SciPy point solvers and `SklearnRegressorSurrogate`.
|
|
303
|
+
An adapter whose role DesignOptRs does not fill is Not yet in DesignOptRs.
|
|
304
|
+
A default inner optimizer or a scikit-learn learner factory is outside the labels
|
|
305
|
+
when DesignOptRs fills the same role with a native algorithm.
|
|
306
|
+
Its docstring names that native algorithm. The results of the two implementations can differ, because the algorithms differ.
|
|
307
|
+
- The DesignOptRs documentation carries no label.
|
|
308
|
+
|
|
309
|
+
## Module map
|
|
310
|
+
|
|
311
|
+
This table names the module that owns each responsibility.
|
|
312
|
+
|
|
313
|
+
| Responsibility | Module |
|
|
314
|
+
| --- | --- |
|
|
315
|
+
| Bottom-up mappings and design evaluation | `designoptpy.core.mapping`, `designoptpy.core.evaluation`, `designoptpy.sso.evaluation` |
|
|
316
|
+
| Sampling, region distances, and input validation | `designoptpy.core.sampling`, `designoptpy.core.regions`, `designoptpy.core.validation` |
|
|
317
|
+
| Convex hulls, boxes, and ellipsoids | `designoptpy.core.geometry` |
|
|
318
|
+
| Numerical differentiation, integration, and signal filtering | `designoptpy.core.numdiff`, `designoptpy.core.integrate`, `designoptpy.core.signal` |
|
|
319
|
+
| Classification metrics | `designoptpy.core.metrics` |
|
|
320
|
+
| Colors and figure handling | `designoptpy.core.plotting` |
|
|
321
|
+
| Run logging and spreadsheet parsing | `designoptpy.core.io` |
|
|
322
|
+
| Point optimization and linear-quadratic coefficient extraction | `designoptpy.point` |
|
|
323
|
+
| Surrogate models, active learning, and classifier plots | `designoptpy.surrogate` |
|
|
324
|
+
| Solution spaces and batch studies | `designoptpy.sso` |
|
|
325
|
+
| Product-family design | `designoptpy.sso.family` |
|
|
326
|
+
| X-Ray engine and workbook reader | `designoptpy.sso.xray` |
|
|
327
|
+
| X-Ray interactive window | `designoptpy.xray` |
|
|
328
|
+
| Truss analysis | `designoptpy.truss` |
|
|
329
|
+
|
|
330
|
+
Matplotlib supplies the plotting primitives, including arrows.
|
|
331
|
+
Results keep the normalized solver data in typed records.
|
|
332
|
+
|
|
333
|
+
## Internal boundaries
|
|
334
|
+
|
|
335
|
+
The distributions follow domain boundaries:
|
|
336
|
+
|
|
337
|
+
- `designoptpy.core` owns shared protocols and foundations.
|
|
338
|
+
- `designoptpy.point`, `designoptpy.surrogate`, `designoptpy.sso`, and
|
|
339
|
+
`designoptpy.truss` may depend on core but not on one another.
|
|
340
|
+
- No library module imports the X-Ray application.
|
|
341
|
+
- The application may use SSO and core, but not the unrelated point,
|
|
342
|
+
surrogate, or truss modules.
|
|
343
|
+
|
|
344
|
+
These rules are executable contracts in `pyproject.toml`.
|
|
345
|
+
The local static quality checks verify them with import-linter.
|
|
346
|
+
Users can install one component or use the umbrella for the complete family.
|
|
347
|
+
|
|
348
|
+
## Executable inputs and untrusted files
|
|
349
|
+
|
|
350
|
+
Optimization, sampling, mapping, and X-Ray evaluator callbacks run ordinary Python code.
|
|
351
|
+
They have the permissions of the current process.
|
|
352
|
+
A callback is a supplied function that an operation calls.
|
|
353
|
+
The X-Ray option `--evaluator MODULE:ATTRIBUTE` imports and runs that module.
|
|
354
|
+
Use callbacks, evaluator modules, and saved model files only from sources that you trust.
|
|
355
|
+
|
|
356
|
+
The safe input contract covers data that the readers parse without running supplied code.
|
|
357
|
+
This data is workbooks, comma-separated values (CSV) tables, and spreadsheet literals.
|
|
358
|
+
Pickle and joblib files can run code while they load.
|
|
359
|
+
Loading them, arbitrary Python modules, or untrusted model files is outside this contract.
|
|
360
|
+
The [core README](packages/designoptpy-core/README.md#records-files-and-plots) states the limits that the readers apply to untrusted files.
|
|
361
|
+
These limits do not sandbox code.
|
|
362
|
+
A sandbox restricts the access of code to the computer.
|
|
363
|
+
|
|
364
|
+
## Development and releases
|
|
365
|
+
|
|
366
|
+
The workspace runs all quality assurance (QA) checks locally.
|
|
367
|
+
It uses no hosted continuous integration (CI) service.
|
|
368
|
+
Before review, run both commands from `designoptpy` against the same source:
|
|
369
|
+
|
|
370
|
+
```shell
|
|
371
|
+
uv run python run_local_quality_checks.py
|
|
372
|
+
uv run python run_all_tests.py --fail-on-skips
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Each run keeps its reports in a new `.artifacts/YYYY-MM-DD-HH-MM-SS_<lane>/` folder.
|
|
376
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) explains component ownership, test rules, stability labels, local checks, security checks, and the release process.
|
|
377
|
+
|
|
378
|
+
DesignOptPy is licensed under the MIT OR Apache-2.0 license.
|
|
379
|
+
Each library and the application identify MIT OR Apache-2.0 in their own `LICENSE-MIT`, `LICENSE-APACHE`, and project metadata.
|
|
380
|
+
`examples/` identifies MIT OR Apache-2.0 in its `LICENSE-MIT`, `LICENSE-APACHE`, and project metadata.
|
|
381
|
+
The examples include the quadrotor catalogue data in `examples/application_examples/data/quadrotor_catalogues/`.
|
|
382
|
+
Consult the license files shipped with the component or artifact that you use.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
designoptpy-0.1.0.dist-info/METADATA,sha256=GnYcFxl32cDBbFv9r4M1h8l06LBnf3DMIgz9o8zanC4,22726
|
|
2
|
+
designoptpy-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
3
|
+
designoptpy-0.1.0.dist-info/licenses/LICENSE-APACHE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
4
|
+
designoptpy-0.1.0.dist-info/licenses/LICENSE-MIT,sha256=H7WVa777ifFihCGDYgffmbhIk8ZIJVRqhGZuG7QVV5Y,1085
|
|
5
|
+
designoptpy-0.1.0.dist-info/licenses/NOTICE,sha256=zhzXtKycEAZTHrt85uomVKOvmRrT7fK6ViN8xNaYZhM,149
|
|
6
|
+
designoptpy-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eduardo Rodrigues Della Noce
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|