PyOpenMagnetics 1.7.14__tar.gz → 1.7.16__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.14 → pyopenmagnetics-1.7.16}/CMakeLists.txt +5 -0
  2. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/PKG-INFO +1 -1
  3. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/pyproject.toml +1 -1
  4. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/advisers.cpp +41 -0
  5. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/advisers.h +3 -0
  6. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/common.h +1 -0
  7. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/simulation.h +1 -1
  8. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/.github/workflows/ci.yml +0 -0
  9. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/.github/workflows/publish.yml +0 -0
  10. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/.gitignore +0 -0
  11. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/AGENTS.md +0 -0
  12. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/LICENSE +0 -0
  13. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/PyOpenMagnetics.pyi +0 -0
  14. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/README.md +0 -0
  15. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/_packaging/__init__.py +0 -0
  16. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/_packaging/_build_info.py.in +0 -0
  17. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/api/MAS.py +0 -0
  18. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/api/mas_db_reader.py +0 -0
  19. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/api/validation.py +0 -0
  20. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/clear_cibuildwheel_cache.sh +0 -0
  21. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/docs/compatibility.md +0 -0
  22. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/docs/errors.md +0 -0
  23. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/docs/performance.md +0 -0
  24. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/README.md +0 -0
  25. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/buck_inductor.py +0 -0
  26. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/complete_simulation_example.py +0 -0
  27. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/converter_design_example.py +0 -0
  28. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/debug_bobbin.py +0 -0
  29. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/debug_coil.py +0 -0
  30. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/debug_core.py +0 -0
  31. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/debug_plotting.py +0 -0
  32. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/flyback_220v_12v_1a.py +0 -0
  33. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/flyback_220v_12v_2a_complete.py +0 -0
  34. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/flyback_bh_curve.png +0 -0
  35. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/flyback_core.png +0 -0
  36. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/flyback_design.py +0 -0
  37. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/flyback_summary.png +0 -0
  38. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/flyback_waveforms.png +0 -0
  39. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/list_plot_funcs.py +0 -0
  40. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/plot_flyback_design.py +0 -0
  41. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/plot_flyback_pyom.py +0 -0
  42. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/test_field_calc.py +0 -0
  43. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/examples/test_field_plot.py +0 -0
  44. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/force_fresh_build.sh +0 -0
  45. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/llms.txt +0 -0
  46. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/notebooks/01_getting_started.ipynb +0 -0
  47. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/notebooks/02_buck_inductor.ipynb +0 -0
  48. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/notebooks/03_core_losses.ipynb +0 -0
  49. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/notebooks/README.md +0 -0
  50. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/requirements.txt +0 -0
  51. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/bobbin.cpp +0 -0
  52. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/bobbin.h +0 -0
  53. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/cmc.cpp +0 -0
  54. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/cmc.h +0 -0
  55. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/converter.cpp +0 -0
  56. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/converter.h +0 -0
  57. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/core.cpp +0 -0
  58. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/core.h +0 -0
  59. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/crossref.cpp +0 -0
  60. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/crossref.h +0 -0
  61. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/database.cpp +0 -0
  62. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/database.h +0 -0
  63. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/logging.cpp +0 -0
  64. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/logging.h +0 -0
  65. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/losses.cpp +0 -0
  66. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/losses.h +0 -0
  67. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/module.cpp +0 -0
  68. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/plotting.cpp +0 -0
  69. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/plotting.h +0 -0
  70. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/settings.cpp +0 -0
  71. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/settings.h +0 -0
  72. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/simulation.cpp +0 -0
  73. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/utils.cpp +0 -0
  74. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/utils.h +0 -0
  75. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/winding.cpp +0 -0
  76. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/winding.h +0 -0
  77. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/wire.cpp +0 -0
  78. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/src/wire.h +0 -0
  79. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/test.py +0 -0
  80. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/__init__.py +0 -0
  81. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/conftest.py +0 -0
  82. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/test_converter_endpoints.py +0 -0
  83. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/test_core.py +0 -0
  84. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/test_core_adviser.py +0 -0
  85. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/test_examples_integration.py +0 -0
  86. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/test_inputs.py +0 -0
  87. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/test_logging.py +0 -0
  88. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/test_magnetic_adviser.py +0 -0
  89. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/test_magnetics_catalogue_load.py +0 -0
  90. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/test_plotting.py +0 -0
  91. {pyopenmagnetics-1.7.14 → pyopenmagnetics-1.7.16}/tests/test_winding.py +0 -0
@@ -479,6 +479,11 @@ target_link_libraries(PyOpenMagnetics PUBLIC data::data)
479
479
  cmrc_add_resource_library(core_losses_data ALIAS data::core_losses_data NAMESPACE coreLossesData ${MKF_DIR}/src/data/core_losses/ciGSE_coefficients.json)
480
480
  target_link_libraries(PyOpenMagnetics PUBLIC data::core_losses_data)
481
481
 
482
+ # ABT #1177 (MKF WP8): the design-for-manufacturing rule numbers and their sources. MKF opens it
483
+ # as "src/data/dfm_rules.json", hence WHENCE the MKF root (as for the insulation standards).
484
+ cmrc_add_resource_library(dfm_rules ALIAS data::dfm_rules NAMESPACE dfmData WHENCE ${MKF_DIR}/ ${MKF_DIR}/src/data/dfm_rules.json)
485
+ target_link_libraries(PyOpenMagnetics PUBLIC data::dfm_rules)
486
+
482
487
  include_directories("${CMAKE_BINARY_DIR}/_deps/json-src/include/nlohmann/")
483
488
  include_directories("${CMAKE_BINARY_DIR}/_deps/pybind11-src/include/")
484
489
  include_directories("${CMAKE_BINARY_DIR}/_deps/pybind11_json-src/include/pybind11_json/")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PyOpenMagnetics
3
- Version: 1.7.14
3
+ Version: 1.7.16
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.14"
7
+ version = "1.7.16"
8
8
  requires-python = ">=3.8"
9
9
  authors = [
10
10
  { name="Alfonso Martinez", email="Alfonso_VII@hotmail.com" },
@@ -267,6 +267,15 @@ json calculate_advised_magnetics_from_cache(json inputsJson, json filterFlowJson
267
267
  return results;
268
268
  }
269
269
 
270
+ json calculate_manufacturability_report(json masJson) {
271
+ OpenMagnetics::Mas mas(masJson);
272
+ OpenMagnetics::Manufacturability manufacturability;
273
+ auto report = manufacturability.calculate_report(mas);
274
+ json result;
275
+ OpenMagnetics::to_json(result, report);
276
+ return result;
277
+ }
278
+
270
279
  json calculate_advised_sections(json masJson, json patternJson, int repetitions) {
271
280
  OpenMagnetics::Mas mas(masJson);
272
281
  std::vector<size_t> pattern;
@@ -514,6 +523,38 @@ void register_adviser_bindings(py::module& m) {
514
523
  py::arg("inputs_json"), py::arg("filter_flow_json"), py::arg("max_results"),
515
524
  py::call_guard<py::gil_scoped_release>());
516
525
 
526
+ m.def("calculate_manufacturability_report", &calculate_manufacturability_report,
527
+ R"pbdoc(
528
+ Run the design-for-manufacturing rule pack over a MAS design.
529
+
530
+ Encodes as checks the public Wuerth Elektronik DFM guidance (ABT #1177, WP8). The rule
531
+ numbers and the source that states each of them live in MKF's src/data/dfm_rules.json.
532
+ Nothing in the design is changed; this is a report.
533
+
534
+ Args:
535
+ mas: A full MAS object (inputs + magnetic).
536
+
537
+ Returns:
538
+ JSON object with:
539
+ - "findings": one entry per rule R1..R17, each with "ruleId", "title", "status",
540
+ "message", "source", and where they exist "measuredValue", "thresholdValue",
541
+ "unit", "scope", "reason".
542
+ - "numberPass" / "numberWarnings" / "numberFails" / "numberNotEvaluated" /
543
+ "numberNotApplicable" / "numberInformational".
544
+
545
+ "status" is one of PASS, WARNING, FAIL, INFORMATIONAL, NOT_APPLICABLE,
546
+ NOT_EVALUATED. NOT_EVALUATED always carries a "reason": a rule that cannot be
547
+ evaluated says so rather than defaulting to a pass. Rules R2, R3, R4, R10, R11,
548
+ R14 and R16 are owned by other work packages and report NOT_EVALUATED with the
549
+ owning work package as the reason.
550
+
551
+ Example:
552
+ >>> report = PyMKF.calculate_manufacturability_report(mas)
553
+ >>> [f["ruleId"] for f in report["findings"] if f["status"] == "WARNING"]
554
+ )pbdoc",
555
+ py::arg("mas"),
556
+ py::call_guard<py::gil_scoped_release>());
557
+
517
558
  m.def("calculate_advised_sections", &calculate_advised_sections,
518
559
  "Get advised coil sections.",
519
560
  py::arg("mas"), py::arg("pattern"), py::arg("repetitions"),
@@ -14,6 +14,9 @@ json calculate_advised_magnetics_fast(json inputsJson, int maximumNumberResults,
14
14
  json calculate_advised_magnetics_from_catalog(json inputsJson, json catalogJson, int maximumNumberResults);
15
15
  json calculate_advised_magnetics_from_cache(json inputsJson, json filterFlowJson, int maximumNumberResults);
16
16
 
17
+ // Design-for-manufacturing rule pack (ABT #1177, WP8)
18
+ json calculate_manufacturability_report(json masJson);
19
+
17
20
  void register_adviser_bindings(py::module& m);
18
21
 
19
22
  } // namespace PyMKF
@@ -10,6 +10,7 @@
10
10
 
11
11
  #include <MAS.hpp>
12
12
  #include "advisers/MagneticAdviser.h"
13
+ #include "advisers/Manufacturability.h"
13
14
  #include "constructive_models/Bobbin.h"
14
15
  #include "constructive_models/Coil.h"
15
16
  #include "constructive_models/Core.h"
@@ -35,7 +35,7 @@ json calculate_capacitance_matrix(json coilJson, json modelsData);
35
35
  json calculate_capacitance_models_between_windings(double energy, double voltageDrop, double relativeTurnsRatio);
36
36
 
37
37
  // Sweep functions
38
- json sweep_impedance_over_frequency(json magneticJson, double start, double stop, size_t numberElements, std::string mode, std::string title);
38
+ json sweep_impedance_over_frequency(json magneticJson, double start, double stop, size_t numberElements, std::string mode, std::string title, bool fast_capacitance);
39
39
  json sweep_differential_mode_impedance_over_frequency(json magneticJson, double start, double stop, size_t numberElements, std::string mode, std::string title);
40
40
  json sweep_q_factor_over_frequency(json magneticJson, double start, double stop, size_t numberElements, std::string mode, std::string title);
41
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);