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.
Files changed (91) hide show
  1. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/.github/workflows/ci.yml +5 -1
  2. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/.github/workflows/publish.yml +19 -8
  3. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/CMakeLists.txt +1 -1
  4. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/PKG-INFO +1 -1
  5. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/pyproject.toml +1 -1
  6. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/plotting.cpp +29 -3
  7. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/.gitignore +0 -0
  8. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/AGENTS.md +0 -0
  9. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/LICENSE +0 -0
  10. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/PyOpenMagnetics.pyi +0 -0
  11. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/README.md +0 -0
  12. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/_packaging/__init__.py +0 -0
  13. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/_packaging/_build_info.py.in +0 -0
  14. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/api/MAS.py +0 -0
  15. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/api/mas_db_reader.py +0 -0
  16. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/api/validation.py +0 -0
  17. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/clear_cibuildwheel_cache.sh +0 -0
  18. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/docs/compatibility.md +0 -0
  19. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/docs/errors.md +0 -0
  20. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/docs/performance.md +0 -0
  21. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/README.md +0 -0
  22. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/buck_inductor.py +0 -0
  23. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/complete_simulation_example.py +0 -0
  24. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/converter_design_example.py +0 -0
  25. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/debug_bobbin.py +0 -0
  26. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/debug_coil.py +0 -0
  27. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/debug_core.py +0 -0
  28. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/debug_plotting.py +0 -0
  29. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_220v_12v_1a.py +0 -0
  30. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_220v_12v_2a_complete.py +0 -0
  31. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_bh_curve.png +0 -0
  32. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_core.png +0 -0
  33. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_design.py +0 -0
  34. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_summary.png +0 -0
  35. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/flyback_waveforms.png +0 -0
  36. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/list_plot_funcs.py +0 -0
  37. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/plot_flyback_design.py +0 -0
  38. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/plot_flyback_pyom.py +0 -0
  39. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/test_field_calc.py +0 -0
  40. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/examples/test_field_plot.py +0 -0
  41. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/force_fresh_build.sh +0 -0
  42. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/llms.txt +0 -0
  43. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/notebooks/01_getting_started.ipynb +0 -0
  44. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/notebooks/02_buck_inductor.ipynb +0 -0
  45. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/notebooks/03_core_losses.ipynb +0 -0
  46. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/notebooks/README.md +0 -0
  47. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/requirements.txt +0 -0
  48. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/advisers.cpp +0 -0
  49. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/advisers.h +0 -0
  50. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/bobbin.cpp +0 -0
  51. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/bobbin.h +0 -0
  52. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/cmc.cpp +0 -0
  53. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/cmc.h +0 -0
  54. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/common.h +0 -0
  55. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/converter.cpp +0 -0
  56. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/converter.h +0 -0
  57. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/core.cpp +0 -0
  58. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/core.h +0 -0
  59. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/crossref.cpp +0 -0
  60. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/crossref.h +0 -0
  61. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/database.cpp +0 -0
  62. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/database.h +0 -0
  63. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/logging.cpp +0 -0
  64. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/logging.h +0 -0
  65. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/losses.cpp +0 -0
  66. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/losses.h +0 -0
  67. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/module.cpp +0 -0
  68. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/plotting.h +0 -0
  69. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/settings.cpp +0 -0
  70. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/settings.h +0 -0
  71. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/simulation.cpp +0 -0
  72. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/simulation.h +0 -0
  73. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/utils.cpp +0 -0
  74. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/utils.h +0 -0
  75. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/winding.cpp +0 -0
  76. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/winding.h +0 -0
  77. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/wire.cpp +0 -0
  78. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/src/wire.h +0 -0
  79. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/test.py +0 -0
  80. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/__init__.py +0 -0
  81. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/conftest.py +0 -0
  82. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_converter_endpoints.py +0 -0
  83. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_core.py +0 -0
  84. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_core_adviser.py +0 -0
  85. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_examples_integration.py +0 -0
  86. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_inputs.py +0 -0
  87. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_logging.py +0 -0
  88. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_magnetic_adviser.py +0 -0
  89. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_magnetics_catalogue_load.py +0 -0
  90. {pyopenmagnetics-1.7.5 → pyopenmagnetics-1.7.6}/tests/test_plotting.py +0 -0
  91. {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
- python-version: ["3.10", "3.11", "3.12"]
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 four
30
- # (cp310-cp313) sequentially in one job exceeded the runner's window and
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.21.3
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.21.3
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.21.3
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-24-v1.7.5-mkf-25069e00")
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PyOpenMagnetics
3
- Version: 1.7.5
3
+ Version: 1.7.6
4
4
  Summary: Python wrapper for OpenMagnetics
5
5
  Author-Email: Alfonso Martinez <Alfonso_VII@hotmail.com>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
4
4
 
5
5
  [project]
6
6
  name = "PyOpenMagnetics"
7
- version = "1.7.5"
7
+ version = "1.7.6"
8
8
  requires-python = ">=3.8"
9
9
  authors = [
10
10
  { name="Alfonso Martinez", email="Alfonso_VII@hotmail.com" },
@@ -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
- OpenMagnetics::Temperature temperatureModel(magnetic);
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