PyOpenMagnetics 1.6.1__tar.gz → 1.6.3__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 (87) hide show
  1. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/.github/workflows/publish.yml +7 -7
  2. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/CMakeLists.txt +35 -3
  3. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/PKG-INFO +1 -1
  4. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/pyproject.toml +5 -5
  5. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/common.h +0 -1
  6. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/simulation.cpp +24 -0
  7. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/.github/workflows/ci.yml +0 -0
  8. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/.gitignore +0 -0
  9. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/AGENTS.md +0 -0
  10. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/LICENSE +0 -0
  11. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/PyOpenMagnetics.pyi +0 -0
  12. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/README.md +0 -0
  13. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/__init__.py +0 -0
  14. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/api/MAS.py +0 -0
  15. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/api/mas_db_reader.py +0 -0
  16. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/api/validation.py +0 -0
  17. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/clear_cibuildwheel_cache.sh +0 -0
  18. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/docs/compatibility.md +0 -0
  19. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/docs/errors.md +0 -0
  20. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/docs/performance.md +0 -0
  21. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/README.md +0 -0
  22. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/buck_inductor.py +0 -0
  23. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/complete_simulation_example.py +0 -0
  24. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/converter_design_example.py +0 -0
  25. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/debug_bobbin.py +0 -0
  26. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/debug_coil.py +0 -0
  27. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/debug_core.py +0 -0
  28. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/debug_plotting.py +0 -0
  29. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/flyback_220v_12v_1a.py +0 -0
  30. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/flyback_220v_12v_2a_complete.py +0 -0
  31. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/flyback_bh_curve.png +0 -0
  32. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/flyback_core.png +0 -0
  33. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/flyback_design.py +0 -0
  34. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/flyback_summary.png +0 -0
  35. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/flyback_waveforms.png +0 -0
  36. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/list_plot_funcs.py +0 -0
  37. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/plot_flyback_design.py +0 -0
  38. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/plot_flyback_pyom.py +0 -0
  39. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/test_field_calc.py +0 -0
  40. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/examples/test_field_plot.py +0 -0
  41. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/force_fresh_build.sh +0 -0
  42. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/llms.txt +0 -0
  43. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/notebooks/01_getting_started.ipynb +0 -0
  44. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/notebooks/02_buck_inductor.ipynb +0 -0
  45. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/notebooks/03_core_losses.ipynb +0 -0
  46. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/notebooks/README.md +0 -0
  47. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/requirements.txt +0 -0
  48. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/advisers.cpp +0 -0
  49. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/advisers.h +0 -0
  50. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/bobbin.cpp +0 -0
  51. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/bobbin.h +0 -0
  52. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/cmc.cpp +0 -0
  53. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/cmc.h +0 -0
  54. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/converter.cpp +0 -0
  55. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/converter.h +0 -0
  56. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/core.cpp +0 -0
  57. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/core.h +0 -0
  58. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/database.cpp +0 -0
  59. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/database.h +0 -0
  60. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/logging.cpp +0 -0
  61. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/logging.h +0 -0
  62. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/losses.cpp +0 -0
  63. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/losses.h +0 -0
  64. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/module.cpp +0 -0
  65. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/plotting.cpp +0 -0
  66. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/plotting.h +0 -0
  67. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/settings.cpp +0 -0
  68. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/settings.h +0 -0
  69. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/simulation.h +0 -0
  70. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/utils.cpp +0 -0
  71. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/utils.h +0 -0
  72. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/winding.cpp +0 -0
  73. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/winding.h +0 -0
  74. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/wire.cpp +0 -0
  75. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/src/wire.h +0 -0
  76. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/test.py +0 -0
  77. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/__init__.py +0 -0
  78. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/conftest.py +0 -0
  79. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/test_converter_endpoints.py +0 -0
  80. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/test_core.py +0 -0
  81. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/test_core_adviser.py +0 -0
  82. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/test_examples_integration.py +0 -0
  83. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/test_inputs.py +0 -0
  84. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/test_logging.py +0 -0
  85. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/test_magnetic_adviser.py +0 -0
  86. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/test_plotting.py +0 -0
  87. {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.3}/tests/test_winding.py +0 -0
@@ -75,7 +75,7 @@ jobs:
75
75
  shell: bash
76
76
  run: |
77
77
  for i in {1..5}; do
78
- npm install -g quicktype && break
78
+ npm install -g quicktype@23.2.6 && break
79
79
  if [ $i -lt 5 ]; then
80
80
  echo "Retry $i failed, waiting 60s..."
81
81
  sleep 60
@@ -120,7 +120,7 @@ jobs:
120
120
  source /opt/rh/gcc-toolset-13/enable && \
121
121
  curl -fsSL --max-time 10 https://rpm.nodesource.com/setup_18.x | bash - && \
122
122
  dnf install -y nodejs && \
123
- npm install -g quicktype) && break
123
+ npm install -g quicktype@23.2.6) && break
124
124
  if [ $i -lt 3 ]; then sleep 60; fi
125
125
  done
126
126
  CIBW_ENVIRONMENT_LINUX: PATH=/opt/rh/gcc-toolset-13/root/usr/bin:$PATH LD_LIBRARY_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64:$LD_LIBRARY_PATH
@@ -192,7 +192,7 @@ jobs:
192
192
  node-version: "18"
193
193
 
194
194
  - name: Install quicktype
195
- run: npm install -g quicktype
195
+ run: npm install -g quicktype@23.2.6
196
196
 
197
197
  - name: Install cibuildwheel
198
198
  run: python -m pip install cibuildwheel==2.21.3
@@ -202,7 +202,7 @@ jobs:
202
202
  env:
203
203
  CIBW_BUILD: ${{ matrix.python }}-*
204
204
  CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux* pp*"
205
- CIBW_BEFORE_ALL_WINDOWS: git config --global url."https://github.com/".insteadOf "git@github.com:" && npm install -g quicktype
205
+ CIBW_BEFORE_ALL_WINDOWS: git config --global url."https://github.com/".insteadOf "git@github.com:" && npm install -g quicktype@23.2.6
206
206
  CIBW_BEFORE_BUILD: pip install --default-timeout=60 --retries 5 scikit-build-core "cmake<4" ninja pybind11
207
207
  CIBW_TEST_COMMAND: python -c "import PyOpenMagnetics; print(f'PyOpenMagnetics loaded successfully with {len(dir(PyOpenMagnetics))} functions')"
208
208
 
@@ -275,7 +275,7 @@ jobs:
275
275
  shell: bash
276
276
  run: |
277
277
  for i in {1..5}; do
278
- npm install -g quicktype && break
278
+ npm install -g quicktype@23.2.6 && break
279
279
  if [ $i -lt 5 ]; then sleep 60; fi
280
280
  done
281
281
 
@@ -290,7 +290,7 @@ jobs:
290
290
  CIBW_BEFORE_ALL_MACOS: |
291
291
  git config --global url."https://github.com/".insteadOf "git@github.com:"
292
292
  for i in {1..5}; do
293
- npm install -g quicktype && break
293
+ npm install -g quicktype@23.2.6 && break
294
294
  if [ $i -lt 5 ]; then sleep 60; fi
295
295
  done
296
296
  CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=15.0
@@ -352,7 +352,7 @@ jobs:
352
352
  shell: bash
353
353
  run: |
354
354
  for i in {1..5}; do
355
- npm install -g quicktype && break
355
+ npm install -g quicktype@23.2.6 && break
356
356
  if [ $i -lt 5 ]; then
357
357
  echo "Retry $i failed, waiting 60s..."
358
358
  sleep 60
@@ -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-07-03-track-main-kirchhoff")
145
+ set(MKF_FORCE_REFRESH "2026-07-09-cm-sweep-permeability-poco")
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
@@ -465,8 +465,13 @@ set(KIRCHHOFF_BUILD_DIR "${CMAKE_BINARY_DIR}/kirchhoff-build")
465
465
  # import library (.lib, IMPORTED_IMPLIB) with the .dll as the runtime (IMPORTED_LOCATION);
466
466
  # Linux/macOS link the .so/.dylib directly.
467
467
  if(WIN32)
468
- set(KIRCHHOFF_API_LIB "${KIRCHHOFF_BUILD_DIR}/KirchhoffApi.dll")
469
- set(KIRCHHOFF_API_IMPLIB "${KIRCHHOFF_BUILD_DIR}/KirchhoffApi.lib")
468
+ # The Visual Studio generator is multi-config: it emits build artifacts into a per-config
469
+ # subdirectory (Release/), so the KirchhoffApi DLL + import lib land in kirchhoff-build/Release/,
470
+ # NOT kirchhoff-build/ directly. The wheel build is always Release (CMAKE_BUILD_TYPE=Release and
471
+ # the ExternalProject BUILD_COMMAND uses --config Release), so point at that subdir; otherwise the
472
+ # extension link fails with LNK1181: cannot open input file 'KirchhoffApi.lib'.
473
+ set(KIRCHHOFF_API_LIB "${KIRCHHOFF_BUILD_DIR}/Release/KirchhoffApi.dll")
474
+ set(KIRCHHOFF_API_IMPLIB "${KIRCHHOFF_BUILD_DIR}/Release/KirchhoffApi.lib")
470
475
  elseif(APPLE)
471
476
  set(KIRCHHOFF_API_LIB "${KIRCHHOFF_BUILD_DIR}/libKirchhoffApi.dylib")
472
477
  else()
@@ -484,6 +489,27 @@ else()
484
489
  GIT_TAG "${KIRCHHOFF_GIT_TAG}")
485
490
  set(_kirchhoff_hdr_dir "${CMAKE_BINARY_DIR}/kirchhoff-ext-prefix/src/kirchhoff_ext/src")
486
491
  endif()
492
+ # Kelvin — KH's shared TAS component selector. Since ~mid-2026 KH requires it
493
+ # (add_subdirectory(KELVIN_DIR)) but it is NOT a KH submodule, so the source must be
494
+ # supplied or KH fails to configure ("../Kelvin is not an existing directory"). KH
495
+ # builds it in-tree reusing its own PEAS, so only the checkout is needed. Mirrors
496
+ # MKF/CMakeLists.txt's KIRCHHOFF_KELVIN_DIR wiring. HTTPS for the same manylinux
497
+ # reason as the Kirchhoff clone above.
498
+ set(KIRCHHOFF_KELVIN_DIR "" CACHE PATH "Local Kelvin checkout for the Kirchhoff build (empty = fetch)")
499
+ if(NOT KIRCHHOFF_KELVIN_DIR)
500
+ set(KIRCHHOFF_KELVIN_GIT_TAG "main" CACHE STRING "Kelvin git tag/branch (when fetched for Kirchhoff)")
501
+ FetchContent_Declare(kirchhoff_kelvin
502
+ GIT_REPOSITORY "https://github.com/OpenConverters/Kelvin.git"
503
+ GIT_TAG "${KIRCHHOFF_KELVIN_GIT_TAG}"
504
+ GIT_SUBMODULES "" # KH overrides KELVIN_PEAS_DIR to its own PEAS; Kelvin's own submodules are unused
505
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/kirchhoff-kelvin-src")
506
+ # Download only — KH does the add_subdirectory(KELVIN_DIR) in its own context.
507
+ FetchContent_GetProperties(kirchhoff_kelvin)
508
+ if(NOT kirchhoff_kelvin_POPULATED)
509
+ FetchContent_Populate(kirchhoff_kelvin)
510
+ endif()
511
+ set(KIRCHHOFF_KELVIN_DIR "${kirchhoff_kelvin_SOURCE_DIR}")
512
+ endif()
487
513
  ExternalProject_Add(kirchhoff_ext
488
514
  ${_kirchhoff_src}
489
515
  PREFIX "${CMAKE_BINARY_DIR}/kirchhoff-ext-prefix"
@@ -493,6 +519,12 @@ ExternalProject_Add(kirchhoff_ext
493
519
  -DKIRCHHOFF_BUILD_SHARED_API=ON # emit libKirchhoffApi.so (string facade, hidden internals)
494
520
  -DKIRCHHOFF_BUILD_PYBIND=OFF
495
521
  -DENABLE_NGSPICE=ON # KH carries the simulator MKF stopped building
522
+ -DKELVIN_DIR=${KIRCHHOFF_KELVIN_DIR} # Kelvin source (fetched above or a local checkout)
523
+ # Build ONLY the KirchhoffApi shared lib (+ its dependency chain), not Kirchhoff's standalone
524
+ # test/example executables. The wheel needs only the facade lib, and those demos/tests use POSIX
525
+ # popen/pclose (MSVC-only _popen/_pclose) that break the Windows build — and compiling 25+ binaries
526
+ # per Python version is pure waste. src/ (the library) is clean of popen.
527
+ BUILD_COMMAND "${CMAKE_COMMAND}" --build <BINARY_DIR> --config Release --target KirchhoffApi
496
528
  BUILD_ALWAYS OFF
497
529
  INSTALL_COMMAND ""
498
530
  BUILD_BYPRODUCTS "${KIRCHHOFF_API_LIB}" "${KIRCHHOFF_API_IMPLIB}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PyOpenMagnetics
3
- Version: 1.6.1
3
+ Version: 1.6.3
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.6.1"
7
+ version = "1.6.3"
8
8
  requires-python = ">=3.8"
9
9
  authors = [
10
10
  { name="Alfonso Martinez", email="Alfonso_VII@hotmail.com" },
@@ -27,7 +27,7 @@ Contact = "https://www.linkedin.com/in/alfonso-martinez-de-la-torre/"
27
27
 
28
28
  [tool.scikit-build]
29
29
  build-dir = "build/{wheel_tag}"
30
- cmake.verbose = true
30
+ build.verbose = true
31
31
  sdist.exclude = [".venv*", ".venv*/**", "build", "build/**", "dist", "dist/**", "*.egg-info", "__pycache__", "*.pyc"]
32
32
  # Include additional files in the wheel
33
33
  wheel.packages = ["."]
@@ -60,7 +60,7 @@ before-all = [
60
60
  "dnf -y module enable nodejs:20",
61
61
  "dnf -y install nodejs npm",
62
62
  "npm --version",
63
- "npm install -g quicktype@23.0.170"
63
+ "npm install -g quicktype@23.2.6"
64
64
  ]
65
65
  # Parallel level 2 (not 3): two large pybind11 TUs compiling at once stays
66
66
  # within the runner's RAM. Combined with dropping -g (see CMakeLists.txt),
@@ -68,11 +68,11 @@ before-all = [
68
68
  environment = { GIT_LFS_SKIP_SMUDGE=1, CMAKE_BUILD_PARALLEL_LEVEL="2" }
69
69
 
70
70
  [tool.cibuildwheel.macos]
71
- before-all = "npm --version && npm install -g quicktype@23.0.170"
71
+ before-all = "npm --version && npm install -g quicktype@23.2.6"
72
72
  environment = { MACOSX_DEPLOYMENT_TARGET="14.0", GIT_LFS_SKIP_SMUDGE=1, CMAKE_BUILD_PARALLEL_LEVEL="3" }
73
73
 
74
74
  [tool.cibuildwheel.windows]
75
- before-all = "rmdir /S /Q build && npm --version && npm install -g quicktype@23.0.170"
75
+ before-all = "rmdir /S /Q build && npm --version && npm install -g quicktype@23.2.6"
76
76
  archs = ["AMD64"]
77
77
 
78
78
  environment = { GIT_LFS_SKIP_SMUDGE=1, CMAKE_BUILD_PARALLEL_LEVEL="2" }
@@ -34,7 +34,6 @@
34
34
  #include "processors/Inputs.h"
35
35
  #include "processors/MagneticSimulator.h"
36
36
  #include "processors/CircuitSimulatorInterface.h"
37
- #include "processors/NgspiceRunner.h"
38
37
  #include "processors/Sweeper.h"
39
38
  #include "support/Painter.h"
40
39
  #include "support/Utils.h"
@@ -325,6 +325,21 @@ json sweep_impedance_over_frequency(json magneticJson, double start, double stop
325
325
  }
326
326
  }
327
327
 
328
+ json sweep_common_mode_impedance_over_frequency(json magneticJson, double start, double stop, size_t numberElements, std::string mode, std::string title) {
329
+ try {
330
+ OpenMagnetics::Magnetic magnetic(magneticJson);
331
+ auto result = OpenMagnetics::Sweeper::sweep_common_mode_impedance_over_frequency(magnetic, start, stop, numberElements, mode, title);
332
+ json resultJson;
333
+ to_json(resultJson, result);
334
+ return resultJson;
335
+ }
336
+ catch (const std::exception &exc) {
337
+ json exception;
338
+ exception["data"] = "Exception: " + std::string{exc.what()};
339
+ return exception;
340
+ }
341
+ }
342
+
328
343
  json sweep_differential_mode_impedance_over_frequency(json magneticJson, double start, double stop, size_t numberElements, std::string mode, std::string title) {
329
344
  try {
330
345
  OpenMagnetics::Magnetic magnetic(magneticJson);
@@ -809,6 +824,15 @@ void register_simulation_bindings(py::module& m) {
809
824
  py::arg("title"),
810
825
  "Sweep impedance over a frequency range.");
811
826
 
827
+ m.def("sweep_common_mode_impedance_over_frequency", &sweep_common_mode_impedance_over_frequency,
828
+ py::arg("magnetic_json"),
829
+ py::arg("start"),
830
+ py::arg("stop"),
831
+ py::arg("number_elements"),
832
+ py::arg("mode"),
833
+ py::arg("title"),
834
+ "Sweep common-mode impedance (all windings driven in parallel — the CMC datasheet CM measurement; magnetizing tank only, no leakage resonance) over a frequency range.");
835
+
812
836
  m.def("sweep_differential_mode_impedance_over_frequency", &sweep_differential_mode_impedance_over_frequency,
813
837
  py::arg("magnetic_json"),
814
838
  py::arg("start"),
File without changes
File without changes