PyOpenMagnetics 1.6.0__tar.gz → 1.6.1__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 (87) hide show
  1. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/.github/workflows/publish.yml +11 -5
  2. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/CMakeLists.txt +34 -3
  3. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/PKG-INFO +1 -1
  4. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/pyproject.toml +1 -1
  5. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/.github/workflows/ci.yml +0 -0
  6. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/.gitignore +0 -0
  7. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/AGENTS.md +0 -0
  8. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/LICENSE +0 -0
  9. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/PyOpenMagnetics.pyi +0 -0
  10. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/README.md +0 -0
  11. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/__init__.py +0 -0
  12. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/api/MAS.py +0 -0
  13. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/api/mas_db_reader.py +0 -0
  14. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/api/validation.py +0 -0
  15. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/clear_cibuildwheel_cache.sh +0 -0
  16. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/docs/compatibility.md +0 -0
  17. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/docs/errors.md +0 -0
  18. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/docs/performance.md +0 -0
  19. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/README.md +0 -0
  20. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/buck_inductor.py +0 -0
  21. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/complete_simulation_example.py +0 -0
  22. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/converter_design_example.py +0 -0
  23. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/debug_bobbin.py +0 -0
  24. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/debug_coil.py +0 -0
  25. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/debug_core.py +0 -0
  26. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/debug_plotting.py +0 -0
  27. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/flyback_220v_12v_1a.py +0 -0
  28. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/flyback_220v_12v_2a_complete.py +0 -0
  29. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/flyback_bh_curve.png +0 -0
  30. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/flyback_core.png +0 -0
  31. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/flyback_design.py +0 -0
  32. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/flyback_summary.png +0 -0
  33. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/flyback_waveforms.png +0 -0
  34. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/list_plot_funcs.py +0 -0
  35. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/plot_flyback_design.py +0 -0
  36. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/plot_flyback_pyom.py +0 -0
  37. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/test_field_calc.py +0 -0
  38. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/examples/test_field_plot.py +0 -0
  39. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/force_fresh_build.sh +0 -0
  40. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/llms.txt +0 -0
  41. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/notebooks/01_getting_started.ipynb +0 -0
  42. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/notebooks/02_buck_inductor.ipynb +0 -0
  43. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/notebooks/03_core_losses.ipynb +0 -0
  44. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/notebooks/README.md +0 -0
  45. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/requirements.txt +0 -0
  46. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/advisers.cpp +0 -0
  47. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/advisers.h +0 -0
  48. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/bobbin.cpp +0 -0
  49. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/bobbin.h +0 -0
  50. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/cmc.cpp +0 -0
  51. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/cmc.h +0 -0
  52. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/common.h +0 -0
  53. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/converter.cpp +0 -0
  54. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/converter.h +0 -0
  55. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/core.cpp +0 -0
  56. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/core.h +0 -0
  57. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/database.cpp +0 -0
  58. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/database.h +0 -0
  59. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/logging.cpp +0 -0
  60. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/logging.h +0 -0
  61. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/losses.cpp +0 -0
  62. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/losses.h +0 -0
  63. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/module.cpp +0 -0
  64. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/plotting.cpp +0 -0
  65. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/plotting.h +0 -0
  66. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/settings.cpp +0 -0
  67. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/settings.h +0 -0
  68. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/simulation.cpp +0 -0
  69. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/simulation.h +0 -0
  70. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/utils.cpp +0 -0
  71. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/utils.h +0 -0
  72. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/winding.cpp +0 -0
  73. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/winding.h +0 -0
  74. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/wire.cpp +0 -0
  75. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/src/wire.h +0 -0
  76. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/test.py +0 -0
  77. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/__init__.py +0 -0
  78. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/conftest.py +0 -0
  79. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/test_converter_endpoints.py +0 -0
  80. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/test_core.py +0 -0
  81. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/test_core_adviser.py +0 -0
  82. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/test_examples_integration.py +0 -0
  83. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/test_inputs.py +0 -0
  84. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/test_logging.py +0 -0
  85. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/test_magnetic_adviser.py +0 -0
  86. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/test_plotting.py +0 -0
  87. {pyopenmagnetics-1.6.0 → pyopenmagnetics-1.6.1}/tests/test_winding.py +0 -0
@@ -114,6 +114,7 @@ jobs:
114
114
  CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux* pp*"
115
115
  CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
116
116
  CIBW_BEFORE_ALL_LINUX: |
117
+ git config --global url."https://github.com/".insteadOf "git@github.com:"
117
118
  for i in {1..3}; do
118
119
  (dnf install -y gcc-toolset-13 eigen3-devel && \
119
120
  source /opt/rh/gcc-toolset-13/enable && \
@@ -131,6 +132,7 @@ jobs:
131
132
  uses: pypa/gh-action-pypi-publish@release/v1
132
133
  with:
133
134
  password: ${{ secrets.PYPI_API_TOKEN }}
135
+ skip-existing: true
134
136
  packages-dir: wheelhouse/
135
137
 
136
138
  - name: Publish Linux wheels to TestPyPI
@@ -139,6 +141,7 @@ jobs:
139
141
  with:
140
142
  repository-url: https://test.pypi.org/legacy/
141
143
  password: ${{ secrets.TEST_PYPI_API_TOKEN }}
144
+ skip-existing: true
142
145
  packages-dir: wheelhouse/
143
146
 
144
147
  # Build and publish Windows wheels independently
@@ -199,7 +202,7 @@ jobs:
199
202
  env:
200
203
  CIBW_BUILD: ${{ matrix.python }}-*
201
204
  CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux* pp*"
202
- CIBW_BEFORE_ALL_WINDOWS: npm install -g quicktype
205
+ CIBW_BEFORE_ALL_WINDOWS: git config --global url."https://github.com/".insteadOf "git@github.com:" && npm install -g quicktype
203
206
  CIBW_BEFORE_BUILD: pip install --default-timeout=60 --retries 5 scikit-build-core "cmake<4" ninja pybind11
204
207
  CIBW_TEST_COMMAND: python -c "import PyOpenMagnetics; print(f'PyOpenMagnetics loaded successfully with {len(dir(PyOpenMagnetics))} functions')"
205
208
 
@@ -208,14 +211,14 @@ jobs:
208
211
 
209
212
  - name: Publish Windows wheels to PyPI
210
213
  if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.publish_to_pypi)
211
- run: python -m twine upload wheelhouse/*.whl
214
+ run: python -m twine upload --skip-existing wheelhouse/*.whl
212
215
  env:
213
216
  TWINE_USERNAME: __token__
214
217
  TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
215
218
 
216
219
  - name: Publish Windows wheels to TestPyPI
217
220
  if: github.event_name == 'workflow_dispatch' && !inputs.publish_to_pypi
218
- run: python -m twine upload --repository-url https://test.pypi.org/legacy/ wheelhouse/*.whl
221
+ run: python -m twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ wheelhouse/*.whl
219
222
  env:
220
223
  TWINE_USERNAME: __token__
221
224
  TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
@@ -285,6 +288,7 @@ jobs:
285
288
  CIBW_BUILD: ${{ matrix.python }}-*
286
289
  CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux* pp*"
287
290
  CIBW_BEFORE_ALL_MACOS: |
291
+ git config --global url."https://github.com/".insteadOf "git@github.com:"
288
292
  for i in {1..5}; do
289
293
  npm install -g quicktype && break
290
294
  if [ $i -lt 5 ]; then sleep 60; fi
@@ -298,14 +302,14 @@ jobs:
298
302
 
299
303
  - name: Publish macOS wheels to PyPI
300
304
  if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.publish_to_pypi)
301
- run: python -m twine upload wheelhouse/*.whl
305
+ run: python -m twine upload --skip-existing wheelhouse/*.whl
302
306
  env:
303
307
  TWINE_USERNAME: __token__
304
308
  TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
305
309
 
306
310
  - name: Publish macOS wheels to TestPyPI
307
311
  if: github.event_name == 'workflow_dispatch' && !inputs.publish_to_pypi
308
- run: python -m twine upload --repository-url https://test.pypi.org/legacy/ wheelhouse/*.whl
312
+ run: python -m twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ wheelhouse/*.whl
309
313
  env:
310
314
  TWINE_USERNAME: __token__
311
315
  TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
@@ -366,6 +370,7 @@ jobs:
366
370
  uses: pypa/gh-action-pypi-publish@release/v1
367
371
  with:
368
372
  password: ${{ secrets.PYPI_API_TOKEN }}
373
+ skip-existing: true
369
374
  packages-dir: dist/
370
375
 
371
376
  - name: Publish sdist to TestPyPI
@@ -374,4 +379,5 @@ jobs:
374
379
  with:
375
380
  repository-url: https://test.pypi.org/legacy/
376
381
  password: ${{ secrets.TEST_PYPI_API_TOKEN }}
382
+ skip-existing: true
377
383
  packages-dir: dist/
@@ -344,6 +344,9 @@ add_custom_command(
344
344
  COMMAND ${CMAKE_COMMAND} -E remove -f "${CAS_DIRECTORY}/CAS.hpp"
345
345
  COMMAND quicktype -l c++ -s schema ${CAS_DIR}/schemas/inputs.json
346
346
  -S ${CAS_DIR}/schemas/inputs/designRequirements.json
347
+ # designRequirements.allowedTechnologies $refs ../capacitor.json#/$defs/technology; feed it as a
348
+ # source so Windows quicktype resolves it by $id (relative file-URI resolution fails on Windows).
349
+ -S ${CAS_DIR}/schemas/capacitor.json
347
350
  -S ${PEAS_DIR}/schemas/utils.json
348
351
  -S ${PEAS_DIR}/schemas/inputs/twoTerminalOperatingPoint.json
349
352
  -S ${PEAS_DIR}/schemas/inputs/operatingConditions.json
@@ -458,12 +461,26 @@ include(ExternalProject)
458
461
  set(KIRCHHOFF_GIT_TAG "main" CACHE STRING "Kirchhoff git tag/branch to build (when fetching from GitHub)")
459
462
  set(KIRCHHOFF_SOURCE_DIR "" CACHE PATH "Local Kirchhoff working tree (leave empty to fetch from GitHub)")
460
463
  set(KIRCHHOFF_BUILD_DIR "${CMAKE_BINARY_DIR}/kirchhoff-build")
461
- set(KIRCHHOFF_API_LIB "${KIRCHHOFF_BUILD_DIR}/libKirchhoffApi.so")
464
+ # Platform-specific shared-lib artifact names. On Windows a shared library links against an
465
+ # import library (.lib, IMPORTED_IMPLIB) with the .dll as the runtime (IMPORTED_LOCATION);
466
+ # Linux/macOS link the .so/.dylib directly.
467
+ if(WIN32)
468
+ set(KIRCHHOFF_API_LIB "${KIRCHHOFF_BUILD_DIR}/KirchhoffApi.dll")
469
+ set(KIRCHHOFF_API_IMPLIB "${KIRCHHOFF_BUILD_DIR}/KirchhoffApi.lib")
470
+ elseif(APPLE)
471
+ set(KIRCHHOFF_API_LIB "${KIRCHHOFF_BUILD_DIR}/libKirchhoffApi.dylib")
472
+ else()
473
+ set(KIRCHHOFF_API_LIB "${KIRCHHOFF_BUILD_DIR}/libKirchhoffApi.so")
474
+ endif()
462
475
  if(KIRCHHOFF_SOURCE_DIR)
463
476
  set(_kirchhoff_src SOURCE_DIR "${KIRCHHOFF_SOURCE_DIR}")
464
477
  set(_kirchhoff_hdr_dir "${KIRCHHOFF_SOURCE_DIR}/src")
465
478
  else()
466
- set(_kirchhoff_src GIT_REPOSITORY "git@github.com:OpenConverters/Kirchhoff.git"
479
+ # HTTPS (not SSH): the manylinux wheel containers have no ssh binary. Kirchhoff and its PSMA
480
+ # submodules are public, so anonymous HTTPS clones them fine. The submodule URLs in Kirchhoff's
481
+ # own .gitmodules are SSH, so CI additionally sets url."https://github.com/".insteadOf in
482
+ # CIBW_BEFORE_ALL (publish.yml) to rewrite those during the recursive clone.
483
+ set(_kirchhoff_src GIT_REPOSITORY "https://github.com/OpenConverters/Kirchhoff.git"
467
484
  GIT_TAG "${KIRCHHOFF_GIT_TAG}")
468
485
  set(_kirchhoff_hdr_dir "${CMAKE_BINARY_DIR}/kirchhoff-ext-prefix/src/kirchhoff_ext/src")
469
486
  endif()
@@ -478,14 +495,28 @@ ExternalProject_Add(kirchhoff_ext
478
495
  -DENABLE_NGSPICE=ON # KH carries the simulator MKF stopped building
479
496
  BUILD_ALWAYS OFF
480
497
  INSTALL_COMMAND ""
481
- BUILD_BYPRODUCTS "${KIRCHHOFF_API_LIB}")
498
+ BUILD_BYPRODUCTS "${KIRCHHOFF_API_LIB}" "${KIRCHHOFF_API_IMPLIB}")
482
499
  include_directories("${_kirchhoff_hdr_dir}")
483
500
  add_library(KirchhoffApi SHARED IMPORTED)
484
501
  set_target_properties(KirchhoffApi PROPERTIES IMPORTED_LOCATION "${KIRCHHOFF_API_LIB}")
502
+ if(WIN32)
503
+ set_target_properties(KirchhoffApi PROPERTIES IMPORTED_IMPLIB "${KIRCHHOFF_API_IMPLIB}")
504
+ endif()
485
505
  add_dependencies(KirchhoffApi kirchhoff_ext)
486
506
  target_link_libraries(PyOpenMagnetics PRIVATE KirchhoffApi)
487
507
  add_dependencies(PyOpenMagnetics kirchhoff_ext)
488
508
 
509
+ # Ship libKirchhoffApi next to the extension in the wheel and point the extension's RPATH at
510
+ # itself, so (1) the co-built shared lib resolves at runtime and (2) the wheel-repair tools
511
+ # (auditwheel / delocate / delvewheel) can LOCATE and vendor it — otherwise auditwheel fails with
512
+ # "required library libKirchhoffApi.so could not be located" even though the build linked fine.
513
+ if(APPLE)
514
+ set_target_properties(PyOpenMagnetics PROPERTIES INSTALL_RPATH "@loader_path" BUILD_WITH_INSTALL_RPATH TRUE)
515
+ elseif(NOT WIN32)
516
+ set_target_properties(PyOpenMagnetics PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_WITH_INSTALL_RPATH TRUE)
517
+ endif()
518
+ install(FILES "${KIRCHHOFF_API_LIB}" DESTINATION .)
519
+
489
520
  # target_link_libraries(PyOpenMagnetics PUBLIC MKF)
490
521
 
491
522
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PyOpenMagnetics
3
- Version: 1.6.0
3
+ Version: 1.6.1
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.6.0"
7
+ version = "1.6.1"
8
8
  requires-python = ">=3.8"
9
9
  authors = [
10
10
  { name="Alfonso Martinez", email="Alfonso_VII@hotmail.com" },
File without changes
File without changes