PyOpenMagnetics 1.4.0__tar.gz → 1.4.2__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 (85) hide show
  1. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/.github/workflows/publish.yml +34 -15
  2. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/CMakeLists.txt +13 -2
  3. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/PKG-INFO +1 -1
  4. pyopenmagnetics-1.4.2/__init__.py +4 -0
  5. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/pyproject.toml +6 -3
  6. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/.github/workflows/ci.yml +0 -0
  7. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/.gitignore +0 -0
  8. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/AGENTS.md +0 -0
  9. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/LICENSE +0 -0
  10. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/PyOpenMagnetics.pyi +0 -0
  11. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/README.md +0 -0
  12. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/api/MAS.py +0 -0
  13. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/api/mas_db_reader.py +0 -0
  14. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/api/validation.py +0 -0
  15. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/clear_cibuildwheel_cache.sh +0 -0
  16. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/docs/compatibility.md +0 -0
  17. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/docs/errors.md +0 -0
  18. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/docs/performance.md +0 -0
  19. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/README.md +0 -0
  20. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/buck_inductor.py +0 -0
  21. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/complete_simulation_example.py +0 -0
  22. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/converter_design_example.py +0 -0
  23. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/debug_bobbin.py +0 -0
  24. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/debug_coil.py +0 -0
  25. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/debug_core.py +0 -0
  26. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/debug_plotting.py +0 -0
  27. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/flyback_220v_12v_1a.py +0 -0
  28. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/flyback_220v_12v_2a_complete.py +0 -0
  29. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/flyback_bh_curve.png +0 -0
  30. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/flyback_core.png +0 -0
  31. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/flyback_design.py +0 -0
  32. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/flyback_summary.png +0 -0
  33. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/flyback_waveforms.png +0 -0
  34. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/list_plot_funcs.py +0 -0
  35. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/plot_flyback_design.py +0 -0
  36. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/plot_flyback_pyom.py +0 -0
  37. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/test_field_calc.py +0 -0
  38. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/examples/test_field_plot.py +0 -0
  39. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/force_fresh_build.sh +0 -0
  40. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/llms.txt +0 -0
  41. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/notebooks/01_getting_started.ipynb +0 -0
  42. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/notebooks/02_buck_inductor.ipynb +0 -0
  43. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/notebooks/03_core_losses.ipynb +0 -0
  44. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/notebooks/README.md +0 -0
  45. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/requirements.txt +0 -0
  46. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/advisers.cpp +0 -0
  47. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/advisers.h +0 -0
  48. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/bobbin.cpp +0 -0
  49. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/bobbin.h +0 -0
  50. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/common.h +0 -0
  51. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/converter.cpp +0 -0
  52. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/converter.h +0 -0
  53. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/core.cpp +0 -0
  54. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/core.h +0 -0
  55. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/database.cpp +0 -0
  56. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/database.h +0 -0
  57. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/logging.cpp +0 -0
  58. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/logging.h +0 -0
  59. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/losses.cpp +0 -0
  60. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/losses.h +0 -0
  61. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/module.cpp +0 -0
  62. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/plotting.cpp +0 -0
  63. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/plotting.h +0 -0
  64. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/settings.cpp +0 -0
  65. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/settings.h +0 -0
  66. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/simulation.cpp +0 -0
  67. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/simulation.h +0 -0
  68. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/utils.cpp +0 -0
  69. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/utils.h +0 -0
  70. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/winding.cpp +0 -0
  71. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/winding.h +0 -0
  72. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/wire.cpp +0 -0
  73. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/src/wire.h +0 -0
  74. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/test.py +0 -0
  75. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/__init__.py +0 -0
  76. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/conftest.py +0 -0
  77. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/test_converter_endpoints.py +0 -0
  78. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/test_core.py +0 -0
  79. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/test_core_adviser.py +0 -0
  80. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/test_examples_integration.py +0 -0
  81. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/test_inputs.py +0 -0
  82. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/test_logging.py +0 -0
  83. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/test_magnetic_adviser.py +0 -0
  84. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/test_plotting.py +0 -0
  85. {pyopenmagnetics-1.4.0 → pyopenmagnetics-1.4.2}/tests/test_winding.py +0 -0
@@ -22,15 +22,24 @@ env:
22
22
  jobs:
23
23
  # Build and publish Linux wheels independently
24
24
  build_and_publish_linux:
25
- name: Build and Publish Linux wheels
25
+ name: Build and Publish Linux wheels (${{ matrix.python }})
26
26
  runs-on: ubuntu-22.04
27
+ # Each matrix job builds a single CPython version. Building all four
28
+ # (cp310-cp313) sequentially in one job exceeded the runner's window and
29
+ # was killed mid-compile (exit 143). One version per parallel job keeps
30
+ # each job short and well under any timeout.
31
+ timeout-minutes: 120
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ python: [cp310, cp311, cp312, cp313]
27
36
  environment:
28
37
  name: pypi
29
38
  url: https://pypi.org/p/pyopenmagnetics
30
39
  permissions:
31
40
  id-token: write # Required for trusted publishing
32
41
  if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
33
-
42
+
34
43
  steps:
35
44
  - uses: actions/checkout@v4
36
45
  with:
@@ -40,9 +49,9 @@ jobs:
40
49
  uses: actions/cache@v4
41
50
  with:
42
51
  path: ~/.cache/cibuildwheel
43
- key: cibuildwheel-linux-${{ hashFiles('**/pyproject.toml') }}
52
+ key: cibuildwheel-linux-${{ matrix.python }}-${{ hashFiles('**/pyproject.toml') }}
44
53
  restore-keys: |
45
- cibuildwheel-linux-
54
+ cibuildwheel-linux-${{ matrix.python }}-
46
55
 
47
56
  - name: Cache npm
48
57
  uses: actions/cache@v4
@@ -101,7 +110,7 @@ jobs:
101
110
  - name: Build wheels
102
111
  run: python -m cibuildwheel --output-dir wheelhouse
103
112
  env:
104
- CIBW_BUILD: cp310-* cp311-* cp312-* cp313-*
113
+ CIBW_BUILD: ${{ matrix.python }}-*
105
114
  CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux* pp*"
106
115
  CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
107
116
  CIBW_BEFORE_ALL_LINUX: |
@@ -134,15 +143,20 @@ jobs:
134
143
 
135
144
  # Build and publish Windows wheels independently
136
145
  build_and_publish_windows:
137
- name: Build and Publish Windows wheels
146
+ name: Build and Publish Windows wheels (${{ matrix.python }})
138
147
  runs-on: windows-2022
148
+ timeout-minutes: 120
149
+ strategy:
150
+ fail-fast: false
151
+ matrix:
152
+ python: [cp310, cp311, cp312, cp313]
139
153
  environment:
140
154
  name: pypi
141
155
  url: https://pypi.org/p/pyopenmagnetics
142
156
  permissions:
143
157
  id-token: write # Required for trusted publishing
144
158
  if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
145
-
159
+
146
160
  steps:
147
161
  - uses: actions/checkout@v4
148
162
  with:
@@ -152,9 +166,9 @@ jobs:
152
166
  uses: actions/cache@v4
153
167
  with:
154
168
  path: C:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache
155
- key: cibuildwheel-windows-${{ hashFiles('**/pyproject.toml') }}
169
+ key: cibuildwheel-windows-${{ matrix.python }}-${{ hashFiles('**/pyproject.toml') }}
156
170
  restore-keys: |
157
- cibuildwheel-windows-
171
+ cibuildwheel-windows-${{ matrix.python }}-
158
172
 
159
173
  - name: Cache npm
160
174
  uses: actions/cache@v4
@@ -183,7 +197,7 @@ jobs:
183
197
  - name: Build wheels
184
198
  run: python -m cibuildwheel --output-dir wheelhouse
185
199
  env:
186
- CIBW_BUILD: cp310-* cp311-* cp312-* cp313-*
200
+ CIBW_BUILD: ${{ matrix.python }}-*
187
201
  CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux* pp*"
188
202
  CIBW_BEFORE_ALL_WINDOWS: npm install -g quicktype
189
203
  CIBW_BEFORE_BUILD: pip install --default-timeout=60 --retries 5 scikit-build-core "cmake<4" ninja pybind11
@@ -208,16 +222,21 @@ jobs:
208
222
 
209
223
  # Build and publish macOS wheels independently
210
224
  build_and_publish_macos:
211
- name: Build and Publish macOS wheels
225
+ name: Build and Publish macOS wheels (${{ matrix.python }})
212
226
  runs-on: macos-15
227
+ timeout-minutes: 120
213
228
  continue-on-error: true # Allow macOS to fail without blocking
229
+ strategy:
230
+ fail-fast: false
231
+ matrix:
232
+ python: [cp310, cp311, cp312, cp313]
214
233
  environment:
215
234
  name: pypi
216
235
  url: https://pypi.org/p/pyopenmagnetics
217
236
  permissions:
218
237
  id-token: write # Required for trusted publishing
219
238
  if: (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && (github.event_name != 'workflow_dispatch' || !inputs.skip_macos)
220
-
239
+
221
240
  steps:
222
241
  - uses: actions/checkout@v4
223
242
  with:
@@ -227,9 +246,9 @@ jobs:
227
246
  uses: actions/cache@v4
228
247
  with:
229
248
  path: ~/Library/Caches/cibuildwheel
230
- key: cibuildwheel-macos-${{ hashFiles('**/pyproject.toml') }}
249
+ key: cibuildwheel-macos-${{ matrix.python }}-${{ hashFiles('**/pyproject.toml') }}
231
250
  restore-keys: |
232
- cibuildwheel-macos-
251
+ cibuildwheel-macos-${{ matrix.python }}-
233
252
 
234
253
  - name: Cache npm
235
254
  uses: actions/cache@v4
@@ -263,7 +282,7 @@ jobs:
263
282
  - name: Build wheels
264
283
  run: python -m cibuildwheel --output-dir wheelhouse
265
284
  env:
266
- CIBW_BUILD: cp310-* cp311-* cp312-* cp313-*
285
+ CIBW_BUILD: ${{ matrix.python }}-*
267
286
  CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux* pp*"
268
287
  CIBW_BEFORE_ALL_MACOS: |
269
288
  for i in {1..5}; do
@@ -31,8 +31,14 @@ else ()
31
31
  # Enable Link Time Optimization to reduce binary size
32
32
  set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE) # TEMP: disable LTO (OOM)
33
33
 
34
- # Debug build: keep symbols and frame pointers for gdb backtraces.
35
- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O1 -g -fno-omit-frame-pointer")
34
+ # Wheel/CI build: -O1 keeps compilation fast and low-memory. -g is
35
+ # intentionally dropped full debug info on the large pybind11 + json
36
+ # translation units (converter.cpp is ~6k lines) balloons RAM during
37
+ # compile and OOM-kills CI runners (exit 143). Frame pointers are kept
38
+ # for usable backtraces. We REPLACE (not append) the flags so the -g in
39
+ # the default RelWithDebInfo flags is stripped too. For local debugging
40
+ # with symbols, re-add -g here.
41
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -DNDEBUG -fno-omit-frame-pointer")
36
42
  endif()
37
43
 
38
44
  SET(MAS_DIRECTORY "${CMAKE_BINARY_DIR}/MAS/")
@@ -383,5 +389,10 @@ include_directories("src/")
383
389
 
384
390
  install(TARGETS PyOpenMagnetics LIBRARY DESTINATION .)
385
391
 
392
+ # Install the package __init__.py so `import PyOpenMagnetics` exposes the
393
+ # compiled extension's API. Without it the wheel installs as an empty PEP-420
394
+ # namespace package and `PyOpenMagnetics.<fn>` resolves to nothing.
395
+ install(FILES __init__.py DESTINATION .)
396
+
386
397
  # Install documentation files for AI assistants
387
398
  install(FILES AGENTS.md llms.txt PyOpenMagnetics.pyi DESTINATION .)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PyOpenMagnetics
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: Python wrapper for OpenMagnetics
5
5
  Author-Email: Alfonso Martinez <Alfonso_VII@hotmail.com>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -0,0 +1,4 @@
1
+ from .PyOpenMagnetics import * # noqa: F401,F403
2
+ from . import PyOpenMagnetics as _ext # noqa: F401
3
+
4
+ __all__ = [name for name in dir(_ext) if not name.startswith("_")]
@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
4
4
 
5
5
  [project]
6
6
  name = "PyOpenMagnetics"
7
- version = "1.4.0"
7
+ version = "1.4.2"
8
8
  requires-python = ">=3.8"
9
9
  authors = [
10
10
  { name="Alfonso Martinez", email="Alfonso_VII@hotmail.com" },
@@ -33,7 +33,7 @@ sdist.exclude = [".venv*", ".venv*/**", "build", "build/**", "dist", "dist/**",
33
33
  wheel.packages = ["."]
34
34
  wheel.install-dir = "PyOpenMagnetics"
35
35
  # Ensure AGENTS.md and llms.txt are included in sdist and wheel
36
- sdist.include = ["AGENTS.md", "llms.txt", "PyOpenMagnetics.pyi"]
36
+ sdist.include = ["__init__.py", "AGENTS.md", "llms.txt", "PyOpenMagnetics.pyi"]
37
37
 
38
38
  [[tool.scikit-build.overrides]]
39
39
  if.platform-system = "^linux"
@@ -62,7 +62,10 @@ before-all = [
62
62
  "npm --version",
63
63
  "npm install -g quicktype@23.0.170"
64
64
  ]
65
- environment = { GIT_LFS_SKIP_SMUDGE=1, CMAKE_BUILD_PARALLEL_LEVEL="3" }
65
+ # Parallel level 2 (not 3): two large pybind11 TUs compiling at once stays
66
+ # within the runner's RAM. Combined with dropping -g (see CMakeLists.txt),
67
+ # this avoids the OOM that recycled the runner mid-compile (exit 143).
68
+ environment = { GIT_LFS_SKIP_SMUDGE=1, CMAKE_BUILD_PARALLEL_LEVEL="2" }
66
69
 
67
70
  [tool.cibuildwheel.macos]
68
71
  before-all = "npm --version && npm install -g quicktype@23.0.170"
File without changes
File without changes