PyOpenMagnetics 1.3.4__tar.gz → 1.3.6__tar.gz
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.
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/.github/workflows/publish.yml +22 -18
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/PKG-INFO +1 -1
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/pyproject.toml +1 -1
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/advisers.cpp +63 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/advisers.h +1 -0
- pyopenmagnetics-1.3.6/src/settings.cpp +538 -0
- pyopenmagnetics-1.3.4/src/settings.cpp +0 -251
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/.github/workflows/ci.yml +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/.gitignore +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/AGENTS.md +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/CMakeLists.txt +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/LICENSE +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/PyOpenMagnetics.pyi +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/README.md +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/api/MAS.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/api/mas_db_reader.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/api/validation.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/clear_cibuildwheel_cache.sh +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/docs/compatibility.md +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/docs/errors.md +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/docs/performance.md +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/README.md +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/buck_inductor.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/complete_simulation_example.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/converter_design_example.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/debug_bobbin.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/debug_coil.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/debug_core.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/debug_plotting.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/flyback_220v_12v_1a.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/flyback_220v_12v_2a_complete.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/flyback_bh_curve.png +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/flyback_core.png +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/flyback_design.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/flyback_summary.png +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/flyback_waveforms.png +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/list_plot_funcs.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/plot_flyback_design.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/plot_flyback_pyom.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/test_field_calc.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/examples/test_field_plot.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/force_fresh_build.sh +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/llms.txt +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/notebooks/01_getting_started.ipynb +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/notebooks/02_buck_inductor.ipynb +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/notebooks/03_core_losses.ipynb +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/notebooks/README.md +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/requirements.txt +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/bobbin.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/bobbin.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/common.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/converter.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/converter.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/core.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/core.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/database.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/database.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/logging.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/logging.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/losses.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/losses.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/module.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/plotting.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/plotting.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/settings.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/simulation.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/simulation.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/utils.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/utils.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/winding.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/winding.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/wire.cpp +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/src/wire.h +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/test.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/tests/__init__.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/tests/conftest.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/tests/test_converter_endpoints.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/tests/test_core.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/tests/test_core_adviser.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/tests/test_examples_integration.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/tests/test_inputs.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/tests/test_logging.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/tests/test_magnetic_adviser.py +0 -0
- {pyopenmagnetics-1.3.4 → pyopenmagnetics-1.3.6}/tests/test_winding.py +0 -0
|
@@ -184,20 +184,22 @@ jobs:
|
|
|
184
184
|
CIBW_BEFORE_BUILD: pip install --default-timeout=60 --retries 5 scikit-build-core cmake ninja pybind11
|
|
185
185
|
CIBW_TEST_COMMAND: python -c "import PyOpenMagnetics; print(f'PyOpenMagnetics loaded successfully with {len(dir(PyOpenMagnetics))} functions')"
|
|
186
186
|
|
|
187
|
+
- name: Install twine
|
|
188
|
+
run: python -m pip install twine
|
|
189
|
+
|
|
187
190
|
- name: Publish Windows wheels to PyPI
|
|
188
191
|
if: github.event_name == 'release'
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
run: python -m twine upload wheelhouse/*.whl
|
|
193
|
+
env:
|
|
194
|
+
TWINE_USERNAME: __token__
|
|
195
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
193
196
|
|
|
194
197
|
- name: Publish Windows wheels to TestPyPI
|
|
195
198
|
if: github.event_name == 'workflow_dispatch'
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
packages-dir: wheelhouse/
|
|
199
|
+
run: python -m twine upload --repository-url https://test.pypi.org/legacy/ wheelhouse/*.whl
|
|
200
|
+
env:
|
|
201
|
+
TWINE_USERNAME: __token__
|
|
202
|
+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
201
203
|
|
|
202
204
|
# Build and publish macOS wheels independently
|
|
203
205
|
build_and_publish_macos:
|
|
@@ -267,20 +269,22 @@ jobs:
|
|
|
267
269
|
CIBW_BEFORE_BUILD: pip install --default-timeout=60 --retries 5 scikit-build-core cmake ninja pybind11
|
|
268
270
|
CIBW_TEST_COMMAND: python -c "import PyOpenMagnetics; print(f'PyOpenMagnetics loaded successfully with {len(dir(PyOpenMagnetics))} functions')"
|
|
269
271
|
|
|
272
|
+
- name: Install twine
|
|
273
|
+
run: python -m pip install twine
|
|
274
|
+
|
|
270
275
|
- name: Publish macOS wheels to PyPI
|
|
271
276
|
if: github.event_name == 'release'
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
277
|
+
run: python -m twine upload wheelhouse/*.whl
|
|
278
|
+
env:
|
|
279
|
+
TWINE_USERNAME: __token__
|
|
280
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
276
281
|
|
|
277
282
|
- name: Publish macOS wheels to TestPyPI
|
|
278
283
|
if: github.event_name == 'workflow_dispatch'
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
packages-dir: wheelhouse/
|
|
284
|
+
run: python -m twine upload --repository-url https://test.pypi.org/legacy/ wheelhouse/*.whl
|
|
285
|
+
env:
|
|
286
|
+
TWINE_USERNAME: __token__
|
|
287
|
+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
284
288
|
|
|
285
289
|
# Build and publish source distribution independently
|
|
286
290
|
build_and_publish_sdist:
|
|
@@ -104,6 +104,37 @@ json calculate_advised_magnetics(json inputsJson, int maximumNumberResults, json
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
json calculate_advised_magnetics_fast(json inputsJson, int maximumNumberResults, json coreModeJson) {
|
|
108
|
+
try {
|
|
109
|
+
OpenMagnetics::Inputs inputs(inputsJson);
|
|
110
|
+
OpenMagnetics::CoreAdviser::CoreAdviserModes coreMode;
|
|
111
|
+
from_json(coreModeJson, coreMode);
|
|
112
|
+
|
|
113
|
+
OpenMagnetics::MagneticAdviser magneticAdviser;
|
|
114
|
+
magneticAdviser.set_core_mode(coreMode);
|
|
115
|
+
auto masMagnetics = magneticAdviser.get_advised_magnetic_fast(inputs, maximumNumberResults);
|
|
116
|
+
|
|
117
|
+
json results = json();
|
|
118
|
+
results["data"] = json::array();
|
|
119
|
+
for (auto& [masMagnetic, scoring] : masMagnetics) {
|
|
120
|
+
std::string name = masMagnetic.get_magnetic().get_manufacturer_info().value().get_reference().value();
|
|
121
|
+
json result;
|
|
122
|
+
json masJson;
|
|
123
|
+
to_json(masJson, masMagnetic);
|
|
124
|
+
result["mas"] = masJson;
|
|
125
|
+
result["scoring"] = scoring;
|
|
126
|
+
results["data"].push_back(result);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return results;
|
|
130
|
+
}
|
|
131
|
+
catch (const std::exception &exc) {
|
|
132
|
+
json exception;
|
|
133
|
+
exception["data"] = "Exception: " + std::string{exc.what()};
|
|
134
|
+
return exception;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
107
138
|
json calculate_advised_magnetics_from_catalog(json inputsJson, json catalogJson, int maximumNumberResults) {
|
|
108
139
|
try {
|
|
109
140
|
OpenMagnetics::settings.set_coil_delimit_and_compact(true);
|
|
@@ -269,6 +300,38 @@ void register_adviser_bindings(py::module& m) {
|
|
|
269
300
|
)pbdoc",
|
|
270
301
|
py::arg("inputs_json"), py::arg("max_results"), py::arg("core_mode_json"));
|
|
271
302
|
|
|
303
|
+
m.def("calculate_advised_magnetics_fast", &calculate_advised_magnetics_fast,
|
|
304
|
+
R"pbdoc(
|
|
305
|
+
Get recommended complete magnetic designs using fast analytical mode.
|
|
306
|
+
|
|
307
|
+
Performs rapid magnetic design exploration using analytical turn/gap
|
|
308
|
+
calculation and simplified loss evaluation (DC ohmic + core losses only).
|
|
309
|
+
Bypasses CoilAdviser optimization and full MagneticSimulator for speed.
|
|
310
|
+
Results are sorted by ascending total losses (lower losses = better rank).
|
|
311
|
+
|
|
312
|
+
Suitable for design space exploration and Pareto front generation.
|
|
313
|
+
For production designs use calculate_advised_magnetics() instead.
|
|
314
|
+
|
|
315
|
+
Args:
|
|
316
|
+
inputs_json: JSON object containing design requirements and operating points.
|
|
317
|
+
Should be processed using process_inputs() first.
|
|
318
|
+
max_results: Maximum number of magnetic recommendations to return.
|
|
319
|
+
core_mode_json: Core selection mode - "AVAILABLE_CORES" or "STANDARD_CORES".
|
|
320
|
+
|
|
321
|
+
Returns:
|
|
322
|
+
JSON object with "data" array containing results sorted by total losses.
|
|
323
|
+
Each result has:
|
|
324
|
+
- "mas": Mas object with magnetic, inputs, and outputs (losses data)
|
|
325
|
+
- "scoring": Total losses value in watts (lower is better)
|
|
326
|
+
|
|
327
|
+
Example:
|
|
328
|
+
>>> inputs = PyMKF.process_inputs(raw_inputs)
|
|
329
|
+
>>> result = PyMKF.calculate_advised_magnetics_fast(inputs, 5, "STANDARD_CORES")
|
|
330
|
+
>>> for item in result["data"]:
|
|
331
|
+
... print(f"Total losses: {item['scoring']} W")
|
|
332
|
+
)pbdoc",
|
|
333
|
+
py::arg("inputs_json"), py::arg("max_results"), py::arg("core_mode_json"));
|
|
334
|
+
|
|
272
335
|
m.def("calculate_advised_magnetics_from_catalog", &calculate_advised_magnetics_from_catalog,
|
|
273
336
|
R"pbdoc(
|
|
274
337
|
Get recommended magnetics from a custom component catalog.
|
|
@@ -9,6 +9,7 @@ json calculate_advised_cores(json inputsJson, json weightsJson, int maximumNumbe
|
|
|
9
9
|
|
|
10
10
|
// Magnetic adviser
|
|
11
11
|
json calculate_advised_magnetics(json inputsJson, int maximumNumberResults, json coreModeJson);
|
|
12
|
+
json calculate_advised_magnetics_fast(json inputsJson, int maximumNumberResults, json coreModeJson);
|
|
12
13
|
json calculate_advised_magnetics_from_catalog(json inputsJson, json catalogJson, int maximumNumberResults);
|
|
13
14
|
json calculate_advised_magnetics_from_cache(json inputsJson, json filterFlowJson, int maximumNumberResults);
|
|
14
15
|
|