PyOpenMagnetics 1.4.2__tar.gz → 1.4.4__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.4.4/.gitignore +19 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/CMakeLists.txt +22 -5
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/PKG-INFO +1 -1
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/pyproject.toml +1 -1
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/converter.cpp +26 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/simulation.cpp +24 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/simulation.h +1 -0
- pyopenmagnetics-1.4.2/.gitignore +0 -6
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/.github/workflows/ci.yml +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/.github/workflows/publish.yml +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/AGENTS.md +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/LICENSE +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/PyOpenMagnetics.pyi +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/README.md +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/__init__.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/api/MAS.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/api/mas_db_reader.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/api/validation.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/clear_cibuildwheel_cache.sh +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/docs/compatibility.md +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/docs/errors.md +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/docs/performance.md +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/README.md +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/buck_inductor.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/complete_simulation_example.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/converter_design_example.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/debug_bobbin.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/debug_coil.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/debug_core.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/debug_plotting.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/flyback_220v_12v_1a.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/flyback_220v_12v_2a_complete.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/flyback_bh_curve.png +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/flyback_core.png +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/flyback_design.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/flyback_summary.png +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/flyback_waveforms.png +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/list_plot_funcs.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/plot_flyback_design.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/plot_flyback_pyom.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/test_field_calc.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/examples/test_field_plot.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/force_fresh_build.sh +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/llms.txt +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/notebooks/01_getting_started.ipynb +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/notebooks/02_buck_inductor.ipynb +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/notebooks/03_core_losses.ipynb +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/notebooks/README.md +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/requirements.txt +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/advisers.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/advisers.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/bobbin.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/bobbin.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/common.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/converter.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/core.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/core.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/database.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/database.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/logging.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/logging.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/losses.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/losses.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/module.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/plotting.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/plotting.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/settings.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/settings.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/utils.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/utils.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/winding.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/winding.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/wire.cpp +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/src/wire.h +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/test.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/__init__.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/conftest.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/test_converter_endpoints.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/test_core.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/test_core_adviser.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/test_examples_integration.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/test_inputs.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/test_logging.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/test_magnetic_adviser.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/test_plotting.py +0 -0
- {pyopenmagnetics-1.4.2 → pyopenmagnetics-1.4.4}/tests/test_winding.py +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
build/
|
|
2
|
+
dist/
|
|
3
|
+
venv/
|
|
4
|
+
.venv/
|
|
5
|
+
.venv311/
|
|
6
|
+
|
|
7
|
+
*.pyc
|
|
8
|
+
__pycache__/
|
|
9
|
+
# LOCAL_MKF_DIR build symlinks + stray tooling — never package into the wheel
|
|
10
|
+
_mkf_local
|
|
11
|
+
_mas_local
|
|
12
|
+
opencodetmp
|
|
13
|
+
output
|
|
14
|
+
.claude
|
|
15
|
+
BUG.md
|
|
16
|
+
PARITY_PORT_PHASES_B_C_D.md
|
|
17
|
+
PyOpenMagnetics.generated.pyi
|
|
18
|
+
test.svg
|
|
19
|
+
test.svg_temp.svg
|
|
@@ -182,11 +182,27 @@ if(NOT LOCAL_MKF_MAS)
|
|
|
182
182
|
message(STATUS "MAS git error: ${MAS_GIT_ERROR}")
|
|
183
183
|
endif()
|
|
184
184
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
185
|
+
# Always delete and repopulate MKF to ensure we get the latest main,
|
|
186
|
+
# mirroring the MAS refresh above. FetchContent will NOT re-fetch an
|
|
187
|
+
# already-cloned source dir even with GIT_TAG main, so a persisted build
|
|
188
|
+
# dir (incremental CI cache, local rebuilds) otherwise keeps a STALE MKF
|
|
189
|
+
# checkout — fixes merged to MKF main would silently never reach the wheel.
|
|
190
|
+
if(EXISTS ${CMAKE_BINARY_DIR}/_deps/mkf-src)
|
|
191
|
+
message(STATUS "Removing old MKF source to force fresh clone")
|
|
192
|
+
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/_deps/mkf-src)
|
|
193
|
+
endif()
|
|
194
|
+
message(STATUS "Populating MKF")
|
|
195
|
+
FetchContent_Populate(MKF)
|
|
196
|
+
# Show git log to verify we built against MKF main HEAD
|
|
197
|
+
execute_process(
|
|
198
|
+
COMMAND git -C ${mkf_SOURCE_DIR} log --oneline -1
|
|
199
|
+
OUTPUT_VARIABLE MKF_GIT_LOG
|
|
200
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
201
|
+
ERROR_VARIABLE MKF_GIT_ERROR
|
|
202
|
+
)
|
|
203
|
+
message(STATUS "MKF version: ${MKF_GIT_LOG}")
|
|
204
|
+
if(MKF_GIT_ERROR)
|
|
205
|
+
message(STATUS "MKF git error: ${MKF_GIT_ERROR}")
|
|
190
206
|
endif()
|
|
191
207
|
|
|
192
208
|
message(STATUS ${MAS_SOURCE_DIR})
|
|
@@ -210,6 +226,7 @@ add_custom_command(
|
|
|
210
226
|
-S ${MAS_DIR}/schemas/magnetic/core/gap.json
|
|
211
227
|
-S ${MAS_DIR}/schemas/magnetic/core/shape.json
|
|
212
228
|
-S ${MAS_DIR}/schemas/magnetic/core/material.json
|
|
229
|
+
-S ${MAS_DIR}/schemas/magnetic/core/coating.json
|
|
213
230
|
-S ${MAS_DIR}/schemas/magnetic/insulation/material.json
|
|
214
231
|
-S ${MAS_DIR}/schemas/magnetic/insulation/wireCoating.json
|
|
215
232
|
-S ${MAS_DIR}/schemas/magnetic/bobbin.json
|
|
@@ -941,6 +941,20 @@ json design_magnetics_from_converter(
|
|
|
941
941
|
? magneticAdviser.get_advised_magnetic_from_converter(converter, maxResults)
|
|
942
942
|
: magneticAdviser.get_advised_magnetic_from_converter(converter, weights, maxResults);
|
|
943
943
|
}
|
|
944
|
+
else if (topologyName == "phase_shifted_full_bridge" || topologyName == "psfb" ||
|
|
945
|
+
topologyName == "advanced_phase_shifted_full_bridge" || topologyName == "advanced_psfb") {
|
|
946
|
+
// Use the basic Psfb converter (mirrors the AHB / LLC branches):
|
|
947
|
+
// its process_design_requirements() derives turns ratios and
|
|
948
|
+
// magnetizing inductance from the converter spec. Falling through
|
|
949
|
+
// to the generic else branch would dispatch to AdvancedPsfb, whose
|
|
950
|
+
// from_json requires desiredTurnsRatios / desiredMagnetizingInductance
|
|
951
|
+
// (the design *outputs*), which a plain converter spec does not carry.
|
|
952
|
+
OpenMagnetics::Psfb converter(converterJson);
|
|
953
|
+
converter._assertErrors = true;
|
|
954
|
+
masMagnetics = weights.empty()
|
|
955
|
+
? magneticAdviser.get_advised_magnetic_from_converter(converter, maxResults)
|
|
956
|
+
: magneticAdviser.get_advised_magnetic_from_converter(converter, weights, maxResults);
|
|
957
|
+
}
|
|
944
958
|
else if (topologyName == "weinberg" || topologyName == "advanced_weinberg") {
|
|
945
959
|
OpenMagnetics::Weinberg converter(converterJson);
|
|
946
960
|
converter._assertErrors = true;
|
|
@@ -969,6 +983,18 @@ json design_magnetics_from_converter(
|
|
|
969
983
|
? magneticAdviser.get_advised_magnetic_from_converter(converter, maxResults)
|
|
970
984
|
: magneticAdviser.get_advised_magnetic_from_converter(converter, weights, maxResults);
|
|
971
985
|
}
|
|
986
|
+
else if (topologyName == "dab" || topologyName == "advanced_dab" ||
|
|
987
|
+
topologyName == "dual_active_bridge") {
|
|
988
|
+
// Use the base Dab model (mirrors llc / src / clllc above): it
|
|
989
|
+
// derives turns ratios + magnetizing inductance itself from the
|
|
990
|
+
// V1/V2 windows, so it does not require the AdvancedDab
|
|
991
|
+
// desiredTurnsRatios / desiredMagnetizingInductance inputs.
|
|
992
|
+
OpenMagnetics::Dab converter(converterJson);
|
|
993
|
+
converter._assertErrors = true;
|
|
994
|
+
masMagnetics = weights.empty()
|
|
995
|
+
? magneticAdviser.get_advised_magnetic_from_converter(converter, maxResults)
|
|
996
|
+
: magneticAdviser.get_advised_magnetic_from_converter(converter, weights, maxResults);
|
|
997
|
+
}
|
|
972
998
|
else {
|
|
973
999
|
// Fall back to old approach for other topologies
|
|
974
1000
|
json inputsJson = process_converter_internal(topologyName, converterJson, useNgspice);
|
|
@@ -325,6 +325,21 @@ json sweep_impedance_over_frequency(json magneticJson, double start, double stop
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
+
json sweep_differential_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_differential_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_q_factor_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);
|
|
@@ -812,6 +827,15 @@ void register_simulation_bindings(py::module& m) {
|
|
|
812
827
|
py::arg("title"),
|
|
813
828
|
"Sweep impedance over a frequency range.");
|
|
814
829
|
|
|
830
|
+
m.def("sweep_differential_mode_impedance_over_frequency", &sweep_differential_mode_impedance_over_frequency,
|
|
831
|
+
py::arg("magnetic_json"),
|
|
832
|
+
py::arg("start"),
|
|
833
|
+
py::arg("stop"),
|
|
834
|
+
py::arg("number_elements"),
|
|
835
|
+
py::arg("mode"),
|
|
836
|
+
py::arg("title"),
|
|
837
|
+
"Sweep differential-mode impedance (leakage + winding R + inter-winding C) over a frequency range.");
|
|
838
|
+
|
|
815
839
|
m.def("sweep_q_factor_over_frequency", &sweep_q_factor_over_frequency,
|
|
816
840
|
py::arg("magnetic_json"),
|
|
817
841
|
py::arg("start"),
|
|
@@ -36,6 +36,7 @@ json calculate_capacitance_models_between_windings(double energy, double voltage
|
|
|
36
36
|
|
|
37
37
|
// Sweep functions
|
|
38
38
|
json sweep_impedance_over_frequency(json magneticJson, double start, double stop, size_t numberElements, std::string mode, std::string title);
|
|
39
|
+
json sweep_differential_mode_impedance_over_frequency(json magneticJson, double start, double stop, size_t numberElements, std::string mode, std::string title);
|
|
39
40
|
json sweep_q_factor_over_frequency(json magneticJson, double start, double stop, size_t numberElements, std::string mode, std::string title);
|
|
40
41
|
json sweep_winding_resistance_over_frequency(json magneticJson, double start, double stop, size_t numberElements, size_t windingIndex, double temperature, std::string mode, std::string title);
|
|
41
42
|
json sweep_resistance_over_frequency(json magneticJson, double start, double stop, size_t numberElements, double temperature, std::string mode, std::string title);
|
pyopenmagnetics-1.4.2/.gitignore
DELETED
|
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
|