PyOpenMagnetics 1.6.1__tar.gz → 1.6.2__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.6.1 → pyopenmagnetics-1.6.2}/CMakeLists.txt +35 -3
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/PKG-INFO +1 -1
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/pyproject.toml +2 -2
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/common.h +0 -1
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/simulation.cpp +24 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/.github/workflows/ci.yml +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/.github/workflows/publish.yml +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/.gitignore +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/AGENTS.md +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/LICENSE +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/PyOpenMagnetics.pyi +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/README.md +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/__init__.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/api/MAS.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/api/mas_db_reader.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/api/validation.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/clear_cibuildwheel_cache.sh +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/docs/compatibility.md +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/docs/errors.md +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/docs/performance.md +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/README.md +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/buck_inductor.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/complete_simulation_example.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/converter_design_example.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/debug_bobbin.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/debug_coil.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/debug_core.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/debug_plotting.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/flyback_220v_12v_1a.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/flyback_220v_12v_2a_complete.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/flyback_bh_curve.png +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/flyback_core.png +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/flyback_design.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/flyback_summary.png +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/flyback_waveforms.png +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/list_plot_funcs.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/plot_flyback_design.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/plot_flyback_pyom.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/test_field_calc.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/examples/test_field_plot.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/force_fresh_build.sh +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/llms.txt +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/notebooks/01_getting_started.ipynb +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/notebooks/02_buck_inductor.ipynb +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/notebooks/03_core_losses.ipynb +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/notebooks/README.md +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/requirements.txt +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/advisers.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/advisers.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/bobbin.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/bobbin.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/cmc.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/cmc.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/converter.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/converter.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/core.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/core.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/database.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/database.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/logging.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/logging.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/losses.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/losses.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/module.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/plotting.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/plotting.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/settings.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/settings.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/simulation.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/utils.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/utils.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/winding.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/winding.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/wire.cpp +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/src/wire.h +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/test.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/__init__.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/conftest.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/test_converter_endpoints.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/test_core.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/test_core_adviser.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/test_examples_integration.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/test_inputs.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/test_logging.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/test_magnetic_adviser.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/test_plotting.py +0 -0
- {pyopenmagnetics-1.6.1 → pyopenmagnetics-1.6.2}/tests/test_winding.py +0 -0
|
@@ -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-
|
|
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
|
-
|
|
469
|
-
|
|
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}")
|
|
@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "PyOpenMagnetics"
|
|
7
|
-
version = "1.6.
|
|
7
|
+
version = "1.6.2"
|
|
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
|
-
|
|
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 = ["."]
|
|
@@ -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
|
|
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
|