PyOpenMagnetics 1.7.32__tar.gz → 1.7.34__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 (95) hide show
  1. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/CMakeLists.txt +1 -1
  2. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/PKG-INFO +1 -1
  3. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/PyOpenMagnetics.pyi +7 -0
  4. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/pyproject.toml +1 -1
  5. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/advisers.cpp +65 -0
  6. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/.github/workflows/ci.yml +0 -0
  7. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/.github/workflows/publish.yml +0 -0
  8. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/.gitignore +0 -0
  9. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/AGENTS.md +0 -0
  10. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/LICENSE +0 -0
  11. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/README.md +0 -0
  12. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/_packaging/__init__.py +0 -0
  13. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/_packaging/_build_info.py.in +0 -0
  14. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/api/MAS.py +0 -0
  15. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/api/mas_db_reader.py +0 -0
  16. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/api/validation.py +0 -0
  17. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/clear_cibuildwheel_cache.sh +0 -0
  18. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/docs/compatibility.md +0 -0
  19. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/docs/errors.md +0 -0
  20. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/docs/performance.md +0 -0
  21. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/README.md +0 -0
  22. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/buck_inductor.py +0 -0
  23. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/complete_simulation_example.py +0 -0
  24. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/converter_design_example.py +0 -0
  25. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/debug_bobbin.py +0 -0
  26. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/debug_coil.py +0 -0
  27. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/debug_core.py +0 -0
  28. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/debug_plotting.py +0 -0
  29. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/flyback_220v_12v_1a.py +0 -0
  30. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/flyback_220v_12v_2a_complete.py +0 -0
  31. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/flyback_bh_curve.png +0 -0
  32. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/flyback_core.png +0 -0
  33. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/flyback_design.py +0 -0
  34. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/flyback_summary.png +0 -0
  35. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/flyback_waveforms.png +0 -0
  36. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/list_plot_funcs.py +0 -0
  37. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/plot_flyback_design.py +0 -0
  38. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/plot_flyback_pyom.py +0 -0
  39. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/test_field_calc.py +0 -0
  40. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/examples/test_field_plot.py +0 -0
  41. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/force_fresh_build.sh +0 -0
  42. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/llms.txt +0 -0
  43. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/notebooks/01_getting_started.ipynb +0 -0
  44. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/notebooks/02_buck_inductor.ipynb +0 -0
  45. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/notebooks/03_core_losses.ipynb +0 -0
  46. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/notebooks/README.md +0 -0
  47. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/requirements.txt +0 -0
  48. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/advisers.h +0 -0
  49. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/bobbin.cpp +0 -0
  50. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/bobbin.h +0 -0
  51. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/cmc.cpp +0 -0
  52. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/cmc.h +0 -0
  53. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/common.h +0 -0
  54. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/converter.cpp +0 -0
  55. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/converter.h +0 -0
  56. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/core.cpp +0 -0
  57. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/core.h +0 -0
  58. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/crossref.cpp +0 -0
  59. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/crossref.h +0 -0
  60. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/database.cpp +0 -0
  61. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/database.h +0 -0
  62. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/logging.cpp +0 -0
  63. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/logging.h +0 -0
  64. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/losses.cpp +0 -0
  65. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/losses.h +0 -0
  66. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/module.cpp +0 -0
  67. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/plotting.cpp +0 -0
  68. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/plotting.h +0 -0
  69. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/settings.cpp +0 -0
  70. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/settings.h +0 -0
  71. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/simulation.cpp +0 -0
  72. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/simulation.h +0 -0
  73. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/utils.cpp +0 -0
  74. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/utils.h +0 -0
  75. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/winding.cpp +0 -0
  76. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/winding.h +0 -0
  77. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/wire.cpp +0 -0
  78. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/src/wire.h +0 -0
  79. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/test.py +0 -0
  80. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/__init__.py +0 -0
  81. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/conftest.py +0 -0
  82. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_converter_endpoints.py +0 -0
  83. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_core.py +0 -0
  84. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_core_adviser.py +0 -0
  85. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_datasheet_only_catalogue.py +0 -0
  86. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_examples_integration.py +0 -0
  87. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_inputs.py +0 -0
  88. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_logging.py +0 -0
  89. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_losses_not_evaluable_catalogue.py +0 -0
  90. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_magnetic_adviser.py +0 -0
  91. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_magnetics_catalogue_load.py +0 -0
  92. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_mas_schema_walk.py +0 -0
  93. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_material_validator.py +0 -0
  94. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/tests/test_plotting.py +0 -0
  95. {pyopenmagnetics-1.7.32 → pyopenmagnetics-1.7.34}/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-10-03-mkf-5055470b")
145
+ set(MKF_FORCE_REFRESH "2026-10-04-mkf-e01c8504")
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PyOpenMagnetics
3
- Version: 1.7.32
3
+ Version: 1.7.34
4
4
  Summary: Python wrapper for OpenMagnetics
5
5
  Author-Email: Alfonso Martinez <Alfonso_VII@hotmail.com>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -679,6 +679,13 @@ def calculate_advised_magnetics_from_catalog(
679
679
  - "lossesNotEvaluable" (only on such parts): why the part's core losses could not be
680
680
  evaluated (its core material has no core-loss model); it is ranked without any
681
681
  loss-based filter and returned without simulated outputs.
682
+ - "judgedFrequencies" (only with a frequency-wise requirement): requirement frequencies
683
+ in Hz each such filter judged the part on, keyed by filter enum name, e.g.
684
+ {"IMPEDANCE": [150000.0, 1000000.0]}. IMPEDANCE judges a minimumImpedance point only
685
+ inside the core material's tabulated mu(f) range; unlisted points were not judged.
686
+ And a "failedCandidates" array next to "data": one {"reference", "error"} per candidate
687
+ the search excluded (a filter or the final simulation raised, or the
688
+ LOSS_MODEL_FREQUENCY_SPAN gate excluded it while losses are computed); it is not ranked.
682
689
  """
683
690
  ...
684
691
 
@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
4
4
 
5
5
  [project]
6
6
  name = "PyOpenMagnetics"
7
- version = "1.7.32"
7
+ version = "1.7.34"
8
8
  requires-python = ">=3.8"
9
9
  authors = [
10
10
  { name="Alfonso Martinez", email="Alfonso_VII@hotmail.com" },
@@ -179,6 +179,17 @@ json calculate_advised_magnetics_fast(json inputsJson, int maximumNumberResults,
179
179
  return results;
180
180
  }
181
181
 
182
+ // The candidates the adviser excluded because evaluating them raised (a filter or the final
183
+ // simulation threw), each with the error. They are not ranked; this says which and why, instead of
184
+ // the result silently holding fewer parts.
185
+ static json failed_candidates_to_json(const OpenMagnetics::MagneticAdviser& magneticAdviser) {
186
+ json failedCandidates = json::array();
187
+ for (const auto& [reference, error] : magneticAdviser.get_failed_candidates()) {
188
+ failedCandidates.push_back({{"reference", reference}, {"error", error}});
189
+ }
190
+ return failedCandidates;
191
+ }
192
+
182
193
  json calculate_advised_magnetics_from_catalog(json inputsJson, json catalogJson, int maximumNumberResults) {
183
194
  OpenMagnetics::settings.set_coil_delimit_and_compact(true);
184
195
  OpenMagnetics::Inputs inputs(inputsJson);
@@ -196,6 +207,7 @@ json calculate_advised_magnetics_from_catalog(json inputsJson, json catalogJson,
196
207
 
197
208
  auto scoringsPerFilter = magneticAdviser.get_scorings();
198
209
  const auto& lossesNotEvaluable = magneticAdviser.get_losses_not_evaluable();
210
+ const auto& judgedFrequencies = magneticAdviser.get_judged_frequencies();
199
211
 
200
212
  json results = json();
201
213
  results["data"] = json::array();
@@ -218,12 +230,23 @@ json calculate_advised_magnetics_from_catalog(json inputsJson, json catalogJson,
218
230
  if (name && lossesNotEvaluable.count(*name)) {
219
231
  result["lossesNotEvaluable"] = lossesNotEvaluable.at(*name);
220
232
  }
233
+ // The requirement frequencies each frequency-wise filter judged this part on. IMPEDANCE
234
+ // judges a minimumImpedance point only inside the core material's tabulated mu(f) range;
235
+ // a point not listed here was not judged (neither passed nor failed).
236
+ if (name && judgedFrequencies.count(*name)) {
237
+ json judged;
238
+ for (auto& [filter, frequencies] : judgedFrequencies.at(*name)) {
239
+ judged[std::string(magic_enum::enum_name(filter))] = frequencies;
240
+ }
241
+ result["judgedFrequencies"] = judged;
242
+ }
221
243
  results["data"].push_back(result);
222
244
  }
223
245
 
224
246
  sort(results["data"].begin(), results["data"].end(), [](json& b1, json& b2) {
225
247
  return b1["scoring"] > b2["scoring"];
226
248
  });
249
+ results["failedCandidates"] = failed_candidates_to_json(magneticAdviser);
227
250
 
228
251
  return results;
229
252
  }
@@ -254,6 +277,7 @@ json calculate_advised_magnetics_from_cache(json inputsJson, json filterFlowJson
254
277
 
255
278
  auto scoringsPerFilter = magneticAdviser.get_scorings();
256
279
  const auto& lossesNotEvaluable = magneticAdviser.get_losses_not_evaluable();
280
+ const auto& judgedFrequencies = magneticAdviser.get_judged_frequencies();
257
281
 
258
282
  json results = json();
259
283
  results["data"] = json::array();
@@ -276,12 +300,23 @@ json calculate_advised_magnetics_from_cache(json inputsJson, json filterFlowJson
276
300
  if (name && lossesNotEvaluable.count(*name)) {
277
301
  result["lossesNotEvaluable"] = lossesNotEvaluable.at(*name);
278
302
  }
303
+ // The requirement frequencies each frequency-wise filter judged this part on. IMPEDANCE
304
+ // judges a minimumImpedance point only inside the core material's tabulated mu(f) range;
305
+ // a point not listed here was not judged (neither passed nor failed).
306
+ if (name && judgedFrequencies.count(*name)) {
307
+ json judged;
308
+ for (auto& [filter, frequencies] : judgedFrequencies.at(*name)) {
309
+ judged[std::string(magic_enum::enum_name(filter))] = frequencies;
310
+ }
311
+ result["judgedFrequencies"] = judged;
312
+ }
279
313
  results["data"].push_back(result);
280
314
  }
281
315
 
282
316
  sort(results["data"].begin(), results["data"].end(), [](json& b1, json& b2) {
283
317
  return b1["scoring"] > b2["scoring"];
284
318
  });
319
+ results["failedCandidates"] = failed_candidates_to_json(magneticAdviser);
285
320
 
286
321
  return results;
287
322
  }
@@ -506,6 +541,19 @@ void register_adviser_bindings(py::module& m) {
506
541
  - "lossesNotEvaluable" (only on such parts): why this part's core losses could
507
542
  not be evaluated -- its core material carries no core-loss model. The part is
508
543
  ranked without any loss-based filter and returned without simulated outputs.
544
+ - "judgedFrequencies" (only with a frequency-wise requirement): the requirement
545
+ frequencies, in Hz, each such filter judged the part on, keyed by filter enum
546
+ name, e.g. {"IMPEDANCE": [150000.0, 1000000.0]}. IMPEDANCE judges a
547
+ minimumImpedance point only inside the core material's tabulated mu(f) range;
548
+ a point not listed was not judged (neither passed nor failed), and the
549
+ IMPEDANCE score is the mean over the listed points.
550
+ And a "failedCandidates" array next to "data": one {"reference", "error"} per
551
+ candidate the search excluded: a filter or the final simulation raised (e.g.
552
+ IMPEDANCE when no minimumImpedance point lies inside the material's mu(f) range),
553
+ or the LOSS_MODEL_FREQUENCY_SPAN gate excluded it because an operating frequency
554
+ lies outside its material's fitted core-loss span while the flow or the final
555
+ simulation computes core losses. Such a candidate is not ranked; this names it
556
+ and the reason instead of dropping it silently.
509
557
 
510
558
  Example:
511
559
  >>> inputs = PyMKF.process_inputs(raw_inputs)
@@ -538,6 +586,10 @@ void register_adviser_bindings(py::module& m) {
538
586
  outputs (losses, temperature). False returns the ranking and the
539
587
  per-filter scores only -- much faster over many results -- and a part
540
588
  whose simulation would fail is then returned rather than dropped.
589
+ The simulation computes core losses at every operating point, so with
590
+ True a part whose material's core-loss fit does not cover an operating
591
+ frequency (e.g. a 50 Hz mains point) is excluded and listed in
592
+ failedCandidates; with False and no loss-based filter it is kept.
541
593
 
542
594
  Returns:
543
595
  JSON object with "data" array containing ranked results.
@@ -550,6 +602,19 @@ void register_adviser_bindings(py::module& m) {
550
602
  not be evaluated -- its core material carries no core-loss model. The part is
551
603
  ranked on the filters that apply to it, with no loss-based filter scored, and
552
604
  is returned without simulated outputs.
605
+ - "judgedFrequencies" (only with a frequency-wise requirement): the requirement
606
+ frequencies, in Hz, each such filter judged the part on, keyed by filter enum
607
+ name, e.g. {"IMPEDANCE": [150000.0, 1000000.0]}. IMPEDANCE judges a
608
+ minimumImpedance point only inside the core material's tabulated mu(f) range;
609
+ a point not listed was not judged (neither passed nor failed), and the
610
+ IMPEDANCE score is the mean over the listed points.
611
+ And a "failedCandidates" array next to "data": one {"reference", "error"} per
612
+ candidate the search excluded: a filter or the final simulation raised (e.g.
613
+ IMPEDANCE when no minimumImpedance point lies inside the material's mu(f) range),
614
+ or the LOSS_MODEL_FREQUENCY_SPAN gate excluded it because an operating frequency
615
+ lies outside its material's fitted core-loss span while the flow or the final
616
+ simulation computes core losses. Such a candidate is not ranked; this names it
617
+ and the reason instead of dropping it silently.
553
618
 
554
619
  Note:
555
620
  Cache must be populated before calling this function.