PyOpenMagnetics 1.7.5__tar.gz → 1.7.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.7.5 → pyopenmagnetics-1.7.6}/.github/workflows/ci.yml +5 -1
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/.github/workflows/publish.yml +19 -8
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/CMakeLists.txt +1 -1
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/PKG-INFO +1 -1
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/pyproject.toml +1 -1
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/plotting.cpp +29 -3
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/.gitignore +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/AGENTS.md +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/LICENSE +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/PyOpenMagnetics.pyi +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/README.md +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/_packaging/__init__.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/_packaging/_build_info.py.in +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/api/MAS.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/api/mas_db_reader.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/api/validation.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/clear_cibuildwheel_cache.sh +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/docs/compatibility.md +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/docs/errors.md +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/docs/performance.md +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/README.md +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/buck_inductor.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/complete_simulation_example.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/converter_design_example.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/debug_bobbin.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/debug_coil.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/debug_core.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/debug_plotting.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_220v_12v_1a.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_220v_12v_2a_complete.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_bh_curve.png +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_core.png +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_design.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_summary.png +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_waveforms.png +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/list_plot_funcs.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/plot_flyback_design.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/plot_flyback_pyom.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/test_field_calc.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/test_field_plot.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/force_fresh_build.sh +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/llms.txt +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/notebooks/01_getting_started.ipynb +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/notebooks/02_buck_inductor.ipynb +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/notebooks/03_core_losses.ipynb +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/notebooks/README.md +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/requirements.txt +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/advisers.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/advisers.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/bobbin.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/bobbin.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/cmc.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/cmc.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/common.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/converter.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/converter.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/core.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/core.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/crossref.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/crossref.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/database.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/database.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/logging.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/logging.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/losses.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/losses.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/module.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/plotting.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/settings.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/settings.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/simulation.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/simulation.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/utils.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/utils.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/winding.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/winding.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/wire.cpp +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/wire.h +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/test.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/__init__.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/conftest.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_converter_endpoints.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_core.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_core_adviser.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_examples_integration.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_inputs.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_logging.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_magnetic_adviser.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_magnetics_catalogue_load.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_plotting.py +0 -0
- {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_winding.py +0 -0
|
@@ -17,7 +17,11 @@ jobs:
|
|
|
17
17
|
fail-fast: false
|
|
18
18
|
matrix:
|
|
19
19
|
os: [ubuntu-22.04, windows-2022, macos-14]
|
|
20
|
-
|
|
20
|
+
# Track every CPython that publish.yml ships a wheel for (cp310-cp314),
|
|
21
|
+
# so a version we distribute is never untested. 3.14 was added after a
|
|
22
|
+
# Windows user on 3.14 hit the sdist fallback: no cp314 wheel existed,
|
|
23
|
+
# pip tried to compile the engine with nmake and failed.
|
|
24
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
21
25
|
|
|
22
26
|
steps:
|
|
23
27
|
- uses: actions/checkout@v4
|
|
@@ -26,15 +26,15 @@ jobs:
|
|
|
26
26
|
build_and_publish_linux:
|
|
27
27
|
name: Build and Publish Linux wheels (${{ matrix.python }})
|
|
28
28
|
runs-on: ubuntu-22.04
|
|
29
|
-
# Each matrix job builds a single CPython version. Building all
|
|
30
|
-
# (cp310-
|
|
29
|
+
# Each matrix job builds a single CPython version. Building them all
|
|
30
|
+
# (cp310-cp314) sequentially in one job exceeded the runner's window and
|
|
31
31
|
# was killed mid-compile (exit 143). One version per parallel job keeps
|
|
32
32
|
# each job short and well under any timeout.
|
|
33
33
|
timeout-minutes: 120
|
|
34
34
|
strategy:
|
|
35
35
|
fail-fast: false
|
|
36
36
|
matrix:
|
|
37
|
-
python: [cp310, cp311, cp312, cp313]
|
|
37
|
+
python: [cp310, cp311, cp312, cp313, cp314]
|
|
38
38
|
environment:
|
|
39
39
|
name: pypi
|
|
40
40
|
url: https://pypi.org/p/pyopenmagnetics
|
|
@@ -85,7 +85,7 @@ jobs:
|
|
|
85
85
|
done
|
|
86
86
|
|
|
87
87
|
- name: Install cibuildwheel
|
|
88
|
-
run: python -m pip install cibuildwheel==2.
|
|
88
|
+
run: python -m pip install cibuildwheel==4.2.0
|
|
89
89
|
|
|
90
90
|
- name: Pre-download virtualenv
|
|
91
91
|
shell: bash
|
|
@@ -154,7 +154,7 @@ jobs:
|
|
|
154
154
|
strategy:
|
|
155
155
|
fail-fast: false
|
|
156
156
|
matrix:
|
|
157
|
-
python: [cp310, cp311, cp312, cp313]
|
|
157
|
+
python: [cp310, cp311, cp312, cp313, cp314]
|
|
158
158
|
environment:
|
|
159
159
|
name: pypi
|
|
160
160
|
url: https://pypi.org/p/pyopenmagnetics
|
|
@@ -197,7 +197,7 @@ jobs:
|
|
|
197
197
|
run: npm install -g quicktype@23.2.6
|
|
198
198
|
|
|
199
199
|
- name: Install cibuildwheel
|
|
200
|
-
run: python -m pip install cibuildwheel==2.
|
|
200
|
+
run: python -m pip install cibuildwheel==4.2.0
|
|
201
201
|
|
|
202
202
|
- name: Build wheels
|
|
203
203
|
run: python -m cibuildwheel --output-dir wheelhouse
|
|
@@ -206,6 +206,17 @@ jobs:
|
|
|
206
206
|
CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux* pp*"
|
|
207
207
|
CIBW_BEFORE_ALL_WINDOWS: git config --global url."https://github.com/".insteadOf "git@github.com:" && npm install -g quicktype@23.2.6
|
|
208
208
|
CIBW_BEFORE_BUILD: pip install --default-timeout=60 --retries 5 scikit-build-core "cmake<4" ninja pybind11
|
|
209
|
+
# cibuildwheel 3.0 started running `delvewheel repair` on Windows by
|
|
210
|
+
# default; 2.21.3 did no Windows repair at all. delvewheel resolves an
|
|
211
|
+
# extension's dependent DLLs via PATH, and kirchhoffapi.dll is built by
|
|
212
|
+
# the Kirchhoff ExternalProject and shipped INSIDE the package rather
|
|
213
|
+
# than installed system-wide -- so the repair aborts with "Unable to
|
|
214
|
+
# find library: kirchhoffapi.dll" and every Windows wheel fails,
|
|
215
|
+
# cp310 included. Empty = keep the behaviour that shipped every
|
|
216
|
+
# Windows wheel up to 1.7.5; scikit-build-core already places the DLL
|
|
217
|
+
# next to the extension. Bundling it via delvewheel --add-path is the
|
|
218
|
+
# follow-up, not a prerequisite for 3.14 support.
|
|
219
|
+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: ""
|
|
209
220
|
CIBW_TEST_COMMAND: python -c "import PyOpenMagnetics; print(f'PyOpenMagnetics loaded successfully with {len(dir(PyOpenMagnetics))} functions')"
|
|
210
221
|
|
|
211
222
|
- name: Install twine
|
|
@@ -234,7 +245,7 @@ jobs:
|
|
|
234
245
|
strategy:
|
|
235
246
|
fail-fast: false
|
|
236
247
|
matrix:
|
|
237
|
-
python: [cp310, cp311, cp312, cp313]
|
|
248
|
+
python: [cp310, cp311, cp312, cp313, cp314]
|
|
238
249
|
environment:
|
|
239
250
|
name: pypi
|
|
240
251
|
url: https://pypi.org/p/pyopenmagnetics
|
|
@@ -282,7 +293,7 @@ jobs:
|
|
|
282
293
|
done
|
|
283
294
|
|
|
284
295
|
- name: Install cibuildwheel
|
|
285
|
-
run: python -m pip install cibuildwheel==2.
|
|
296
|
+
run: python -m pip install cibuildwheel==4.2.0
|
|
286
297
|
|
|
287
298
|
- name: Build wheels
|
|
288
299
|
run: python -m cibuildwheel --output-dir wheelhouse
|
|
@@ -142,7 +142,7 @@ if(NOT LOCAL_MKF_MAS)
|
|
|
142
142
|
set(MKF_GIT_TAG "main"
|
|
143
143
|
CACHE STRING "MKF git ref for the vendored PyOM build")
|
|
144
144
|
# Force fresh clone by using a unique timestamp - update this when the pin changes
|
|
145
|
-
set(MKF_FORCE_REFRESH "2026-08-
|
|
145
|
+
set(MKF_FORCE_REFRESH "2026-08-26-mkf-10abe8d7")
|
|
146
146
|
# Tell MKF to disable matplotplusplus and use SVG-based Painter instead
|
|
147
147
|
set(INCLUDE_PYMKF ON CACHE BOOL "Build Python interface" FORCE)
|
|
148
148
|
# GIT_SUBMODULES_RECURSE pulls in CAS/PEAS (added 2026-04 alongside the
|
|
@@ -320,14 +320,40 @@ json plot_temperature_field(json magneticJson, json operatingPointJson, std::str
|
|
|
320
320
|
OpenMagnetics::Magnetic magnetic(magneticJson);
|
|
321
321
|
OperatingPoint operatingPoint(operatingPointJson);
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
// For toroidal cores, ensure the coil is wound (turn nodes need positions)
|
|
324
|
+
if (magnetic.get_core().get_shape_family() == CoreShapeFamily::T) {
|
|
325
|
+
auto coil = magnetic.get_mutable_coil();
|
|
326
|
+
if (!coil.get_turns_description() || coil.get_turns_description()->empty()) {
|
|
327
|
+
coil.wind();
|
|
328
|
+
magnetic.set_coil(coil);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
double ambientTemp = operatingPoint.get_conditions().get_ambient_temperature();
|
|
333
|
+
|
|
334
|
+
// Simulate the operating point to get the losses that power the thermal
|
|
335
|
+
// network — a default-constructed Temperature(magnetic) solves an UNPOWERED
|
|
336
|
+
// network at the default 25 C ambient and paints everything stone cold
|
|
337
|
+
// (ABT #906). This mirrors the WASM wrapper in WebLibMKF.
|
|
338
|
+
OpenMagnetics::MagneticSimulator magneticSimulator;
|
|
339
|
+
OpenMagnetics::Mas mas;
|
|
340
|
+
mas.set_magnetic(magnetic);
|
|
341
|
+
mas.get_mutable_inputs().set_operating_points({operatingPoint});
|
|
342
|
+
auto simulatedMas = magneticSimulator.simulate(mas);
|
|
343
|
+
if (simulatedMas.get_outputs().empty()) {
|
|
344
|
+
throw std::runtime_error("plot_temperature_field: simulation produced no outputs");
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// Shared config builder (ABT #906): the same configuration MagneticSimulator uses
|
|
348
|
+
// for outputs[].temperature, so this plot and the exported MAS can never disagree.
|
|
349
|
+
auto config = OpenMagnetics::TemperatureConfig::fromSimulatedOutput(operatingPoint, simulatedMas.get_outputs()[0]);
|
|
350
|
+
|
|
351
|
+
OpenMagnetics::Temperature temperatureModel(magnetic, config);
|
|
324
352
|
auto thermalResult = temperatureModel.calculateTemperatures();
|
|
325
353
|
|
|
326
354
|
std::filesystem::path filePath = outputPath.empty()
|
|
327
355
|
? std::filesystem::temp_directory_path() / "pyom_plot_temperature_field.svg"
|
|
328
356
|
: std::filesystem::path(outputPath);
|
|
329
|
-
|
|
330
|
-
double ambientTemp = operatingPoint.get_conditions().get_ambient_temperature();
|
|
331
357
|
OpenMagnetics::Painter painter(filePath);
|
|
332
358
|
painter.paint_temperature_field(magnetic, thermalResult.nodeTemperatures, true,
|
|
333
359
|
OpenMagnetics::ColorPalette::BLUE_TO_RED, ambientTemp, textColor, bgColor);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|