PyOpenMagnetics 1.7.30__tar.gz → 1.7.31__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.30 → pyopenmagnetics-1.7.31}/PKG-INFO +1 -1
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/pyproject.toml +1 -1
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/core.cpp +33 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/core.h +1 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_core.py +20 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/.github/workflows/ci.yml +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/.github/workflows/publish.yml +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/.gitignore +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/AGENTS.md +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/CMakeLists.txt +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/LICENSE +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/PyOpenMagnetics.pyi +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/README.md +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/_packaging/__init__.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/_packaging/_build_info.py.in +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/api/MAS.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/api/mas_db_reader.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/api/validation.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/clear_cibuildwheel_cache.sh +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/docs/compatibility.md +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/docs/errors.md +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/docs/performance.md +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/README.md +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/buck_inductor.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/complete_simulation_example.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/converter_design_example.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/debug_bobbin.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/debug_coil.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/debug_core.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/debug_plotting.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/flyback_220v_12v_1a.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/flyback_220v_12v_2a_complete.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/flyback_bh_curve.png +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/flyback_core.png +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/flyback_design.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/flyback_summary.png +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/flyback_waveforms.png +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/list_plot_funcs.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/plot_flyback_design.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/plot_flyback_pyom.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/test_field_calc.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/examples/test_field_plot.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/force_fresh_build.sh +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/llms.txt +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/notebooks/01_getting_started.ipynb +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/notebooks/02_buck_inductor.ipynb +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/notebooks/03_core_losses.ipynb +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/notebooks/README.md +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/requirements.txt +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/advisers.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/advisers.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/bobbin.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/bobbin.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/cmc.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/cmc.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/common.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/converter.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/converter.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/crossref.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/crossref.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/database.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/database.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/logging.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/logging.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/losses.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/losses.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/module.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/plotting.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/plotting.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/settings.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/settings.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/simulation.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/simulation.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/utils.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/utils.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/winding.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/winding.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/wire.cpp +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/src/wire.h +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/test.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/__init__.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/conftest.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_converter_endpoints.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_core_adviser.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_datasheet_only_catalogue.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_examples_integration.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_inputs.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_logging.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_losses_not_evaluable_catalogue.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_magnetic_adviser.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_magnetics_catalogue_load.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_mas_schema_walk.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_material_validator.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_plotting.py +0 -0
- {pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_winding.py +0 -0
|
@@ -567,6 +567,21 @@ json calculate_complex_permeability(json materialJson, double frequency) {
|
|
|
567
567
|
return result;
|
|
568
568
|
}
|
|
569
569
|
|
|
570
|
+
json calculate_complex_permeability_frequency_range(json material) {
|
|
571
|
+
OpenMagnetics::ComplexPermeability complexPermeabilityObj;
|
|
572
|
+
std::pair<double, double> range;
|
|
573
|
+
if (material.is_string()) {
|
|
574
|
+
range = complexPermeabilityObj.get_frequency_range(material.get<std::string>());
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
range = complexPermeabilityObj.get_frequency_range(CoreMaterial(material));
|
|
578
|
+
}
|
|
579
|
+
json result;
|
|
580
|
+
result["minimum"] = range.first;
|
|
581
|
+
result["maximum"] = range.second;
|
|
582
|
+
return result;
|
|
583
|
+
}
|
|
584
|
+
|
|
570
585
|
void register_core_bindings(py::module& m) {
|
|
571
586
|
// Core materials
|
|
572
587
|
m.def("get_core_materials", &get_core_materials,
|
|
@@ -1344,6 +1359,24 @@ void register_core_bindings(py::module& m) {
|
|
|
1344
1359
|
)pbdoc",
|
|
1345
1360
|
py::arg("material_json"), py::arg("frequency"),
|
|
1346
1361
|
py::call_guard<py::gil_scoped_release>());
|
|
1362
|
+
|
|
1363
|
+
m.def("calculate_complex_permeability_frequency_range", &calculate_complex_permeability_frequency_range,
|
|
1364
|
+
R"pbdoc(
|
|
1365
|
+
Frequency span in which a core material's complex permeability is defined.
|
|
1366
|
+
|
|
1367
|
+
calculate_complex_permeability (and every impedance sweep that uses it)
|
|
1368
|
+
throws outside this span: it is the span covered by both the material's
|
|
1369
|
+
tabulated mu'(f) and mu''(f), or by the table MKF derives from its
|
|
1370
|
+
frequency-dependent initial permeability.
|
|
1371
|
+
|
|
1372
|
+
Args:
|
|
1373
|
+
material: JSON CoreMaterial object, or the material name.
|
|
1374
|
+
|
|
1375
|
+
Returns:
|
|
1376
|
+
JSON object {"minimum": Hz, "maximum": Hz}.
|
|
1377
|
+
)pbdoc",
|
|
1378
|
+
py::arg("material"),
|
|
1379
|
+
py::call_guard<py::gil_scoped_release>());
|
|
1347
1380
|
}
|
|
1348
1381
|
|
|
1349
1382
|
} // namespace PyMKF
|
|
@@ -59,6 +59,7 @@ std::vector<std::string> get_available_core_filters();
|
|
|
59
59
|
std::vector<double> get_maximum_dimensions(json magneticJson);
|
|
60
60
|
json calculate_core_data_from_shape(json shapeJson);
|
|
61
61
|
json calculate_complex_permeability(json materialJson, double frequency);
|
|
62
|
+
json calculate_complex_permeability_frequency_range(json material);
|
|
62
63
|
|
|
63
64
|
void register_core_bindings(py::module& m);
|
|
64
65
|
|
|
@@ -312,3 +312,23 @@ class TestCoreProcessedDescription:
|
|
|
312
312
|
if "windingWindows" in processed:
|
|
313
313
|
assert isinstance(processed["windingWindows"], list)
|
|
314
314
|
assert len(processed["windingWindows"]) > 0
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
class TestComplexPermeabilityFrequencyRange:
|
|
318
|
+
"""calculate_complex_permeability throws outside the material's tabulated span; the span is exposed so
|
|
319
|
+
callers (impedance sweeps) can stay inside it instead of catching the throw."""
|
|
320
|
+
|
|
321
|
+
def test_a07_span_ends_at_the_top_of_its_tabulated_mu_imaginary(self):
|
|
322
|
+
span = PyOpenMagnetics.calculate_complex_permeability_frequency_range("A07")
|
|
323
|
+
assert 0 < span["minimum"] < span["maximum"]
|
|
324
|
+
# A07's tabulated mu''(f) ends at ~17 MHz (mu' extended to it by Kramers-Kronig in MAS).
|
|
325
|
+
assert 1e7 < span["maximum"] < 1e8
|
|
326
|
+
|
|
327
|
+
def test_inside_the_span_answers_and_outside_it_throws(self):
|
|
328
|
+
material = PyOpenMagnetics.find_core_material_by_name("A07")
|
|
329
|
+
span = PyOpenMagnetics.calculate_complex_permeability_frequency_range(material)
|
|
330
|
+
assert span == PyOpenMagnetics.calculate_complex_permeability_frequency_range("A07")
|
|
331
|
+
inside = PyOpenMagnetics.calculate_complex_permeability(material, span["maximum"] * 0.99)
|
|
332
|
+
assert inside["imaginary"] > 0
|
|
333
|
+
with pytest.raises(Exception):
|
|
334
|
+
PyOpenMagnetics.calculate_complex_permeability(material, span["maximum"] * 1.01)
|
|
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
|
{pyopenmagnetics-1.7.30 → pyopenmagnetics-1.7.31}/tests/test_losses_not_evaluable_catalogue.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|