PyOpenMagnetics 1.2.1__tar.gz → 1.3.0__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.2.1 → pyopenmagnetics-1.3.0}/.github/workflows/publish.yml +103 -12
- pyopenmagnetics-1.3.0/AGENTS.md +2443 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/CMakeLists.txt +14 -1
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/PKG-INFO +33 -1
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/README.md +32 -0
- pyopenmagnetics-1.3.0/examples/complete_simulation_example.py +539 -0
- pyopenmagnetics-1.3.0/examples/converter_design_example.py +336 -0
- pyopenmagnetics-1.3.0/examples/debug_bobbin.py +47 -0
- pyopenmagnetics-1.3.0/examples/debug_coil.py +64 -0
- pyopenmagnetics-1.3.0/examples/debug_core.py +49 -0
- pyopenmagnetics-1.3.0/examples/debug_plotting.py +29 -0
- pyopenmagnetics-1.3.0/examples/flyback_220v_12v_1a.py +640 -0
- pyopenmagnetics-1.3.0/examples/flyback_220v_12v_2a_complete.py +588 -0
- pyopenmagnetics-1.3.0/examples/flyback_bh_curve.png +0 -0
- pyopenmagnetics-1.3.0/examples/flyback_core.png +0 -0
- pyopenmagnetics-1.3.0/examples/flyback_summary.png +0 -0
- pyopenmagnetics-1.3.0/examples/flyback_waveforms.png +0 -0
- pyopenmagnetics-1.3.0/examples/list_plot_funcs.py +14 -0
- pyopenmagnetics-1.3.0/examples/plot_flyback_design.py +486 -0
- pyopenmagnetics-1.3.0/examples/plot_flyback_pyom.py +238 -0
- pyopenmagnetics-1.3.0/examples/test_field_calc.py +76 -0
- pyopenmagnetics-1.3.0/examples/test_field_plot.py +57 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/pyproject.toml +6 -1
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/common.h +1 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/converter.cpp +86 -13
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/core.cpp +11 -1
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/.github/workflows/ci.yml +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/.gitignore +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/LICENSE +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/PyOpenMagnetics.pyi +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/api/MAS.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/api/mas_db_reader.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/api/validation.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/clear_cibuildwheel_cache.sh +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/docs/compatibility.md +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/docs/errors.md +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/docs/performance.md +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/examples/README.md +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/examples/buck_inductor.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/examples/flyback_design.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/force_fresh_build.sh +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/llms.txt +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/notebooks/01_getting_started.ipynb +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/notebooks/02_buck_inductor.ipynb +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/notebooks/03_core_losses.ipynb +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/notebooks/README.md +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/requirements.txt +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/advisers.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/advisers.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/bobbin.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/bobbin.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/converter.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/core.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/database.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/database.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/logging.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/logging.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/losses.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/losses.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/module.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/plotting.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/plotting.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/settings.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/settings.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/simulation.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/simulation.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/utils.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/utils.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/winding.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/winding.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/wire.cpp +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/src/wire.h +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/test.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/tests/__init__.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/tests/conftest.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/tests/test_converter_endpoints.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/tests/test_core.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/tests/test_core_adviser.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/tests/test_examples_integration.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/tests/test_inputs.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/tests/test_logging.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/tests/test_magnetic_adviser.py +0 -0
- {pyopenmagnetics-1.2.1 → pyopenmagnetics-1.3.0}/tests/test_winding.py +0 -0
|
@@ -4,6 +4,12 @@ on:
|
|
|
4
4
|
release:
|
|
5
5
|
types: [published]
|
|
6
6
|
workflow_dispatch: # Allow manual trigger for testing
|
|
7
|
+
inputs:
|
|
8
|
+
skip_macos:
|
|
9
|
+
description: 'Skip macOS builds (useful when macOS builds are failing due to infrastructure issues)'
|
|
10
|
+
required: false
|
|
11
|
+
default: false
|
|
12
|
+
type: boolean
|
|
7
13
|
|
|
8
14
|
env:
|
|
9
15
|
GIT_LFS_SKIP_SMUDGE: 1 # Skip LFS to avoid bandwidth quota issues
|
|
@@ -12,16 +18,36 @@ jobs:
|
|
|
12
18
|
build_wheels:
|
|
13
19
|
name: Build wheels on ${{ matrix.os }}
|
|
14
20
|
runs-on: ${{ matrix.os }}
|
|
21
|
+
continue-on-error: ${{ matrix.os == 'macos-15' }}
|
|
15
22
|
strategy:
|
|
16
23
|
fail-fast: false
|
|
17
24
|
matrix:
|
|
18
|
-
os: [ubuntu-22.04, windows-2022, macos-15]
|
|
25
|
+
os: ${{ github.event_name == 'workflow_dispatch' && inputs.skip_macos && fromJson('["ubuntu-22.04", "windows-2022"]') || fromJson('["ubuntu-22.04", "windows-2022", "macos-15"]') }}
|
|
19
26
|
|
|
20
27
|
steps:
|
|
21
28
|
- uses: actions/checkout@v4
|
|
22
29
|
with:
|
|
23
30
|
submodules: recursive
|
|
24
31
|
|
|
32
|
+
- name: Cache cibuildwheel
|
|
33
|
+
uses: actions/cache@v4
|
|
34
|
+
with:
|
|
35
|
+
path: |
|
|
36
|
+
~/.cache/cibuildwheel
|
|
37
|
+
~/Library/Caches/cibuildwheel
|
|
38
|
+
C:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache
|
|
39
|
+
key: cibuildwheel-${{ runner.os }}-${{ hashFiles('**/pyproject.toml') }}
|
|
40
|
+
restore-keys: |
|
|
41
|
+
cibuildwheel-${{ runner.os }}-
|
|
42
|
+
|
|
43
|
+
- name: Cache npm
|
|
44
|
+
uses: actions/cache@v4
|
|
45
|
+
with:
|
|
46
|
+
path: ~/.npm
|
|
47
|
+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
48
|
+
restore-keys: |
|
|
49
|
+
${{ runner.os }}-npm-
|
|
50
|
+
|
|
25
51
|
- name: Set up Python
|
|
26
52
|
uses: actions/setup-python@v5
|
|
27
53
|
with:
|
|
@@ -33,11 +59,51 @@ jobs:
|
|
|
33
59
|
node-version: "18"
|
|
34
60
|
|
|
35
61
|
- name: Install quicktype
|
|
36
|
-
|
|
62
|
+
shell: bash
|
|
63
|
+
run: |
|
|
64
|
+
for i in {1..5}; do
|
|
65
|
+
npm install -g quicktype && break
|
|
66
|
+
if [ $i -lt 5 ]; then
|
|
67
|
+
echo "Retry $i failed, waiting 60s..."
|
|
68
|
+
sleep 60
|
|
69
|
+
fi
|
|
70
|
+
done
|
|
37
71
|
|
|
38
72
|
- name: Install cibuildwheel
|
|
39
73
|
run: python -m pip install cibuildwheel==2.21.3
|
|
40
74
|
|
|
75
|
+
- name: Pre-download virtualenv
|
|
76
|
+
shell: bash
|
|
77
|
+
run: |
|
|
78
|
+
# Create cache directory
|
|
79
|
+
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
|
80
|
+
CACHE_DIR="$LOCALAPPDATA/pypa/cibuildwheel/Cache"
|
|
81
|
+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
82
|
+
CACHE_DIR="$HOME/Library/Caches/cibuildwheel"
|
|
83
|
+
else
|
|
84
|
+
CACHE_DIR="$HOME/.cache/cibuildwheel"
|
|
85
|
+
fi
|
|
86
|
+
mkdir -p "$CACHE_DIR"
|
|
87
|
+
|
|
88
|
+
# Download virtualenv.pyz with retry
|
|
89
|
+
VENV_VERSION="20.26.6"
|
|
90
|
+
VENV_FILE="$CACHE_DIR/virtualenv-$VENV_VERSION.pyz"
|
|
91
|
+
VENV_URL="https://github.com/pypa/get-virtualenv/blob/$VENV_VERSION/public/virtualenv.pyz?raw=true"
|
|
92
|
+
|
|
93
|
+
if [[ ! -f "$VENV_FILE" ]]; then
|
|
94
|
+
echo "Downloading virtualenv.pyz..."
|
|
95
|
+
for i in {1..10}; do
|
|
96
|
+
if curl -fsSL --max-time 30 "$VENV_URL" -o "$VENV_FILE"; then
|
|
97
|
+
echo "Downloaded successfully"
|
|
98
|
+
break
|
|
99
|
+
fi
|
|
100
|
+
echo "Download attempt $i failed, waiting 60s..."
|
|
101
|
+
sleep 60
|
|
102
|
+
done
|
|
103
|
+
else
|
|
104
|
+
echo "virtualenv.pyz already cached"
|
|
105
|
+
fi
|
|
106
|
+
|
|
41
107
|
- name: Build wheels
|
|
42
108
|
run: python -m cibuildwheel --output-dir wheelhouse
|
|
43
109
|
env:
|
|
@@ -50,19 +116,26 @@ jobs:
|
|
|
50
116
|
# Install Node.js 18 and quicktype in the build container (Linux)
|
|
51
117
|
# Also install gcc-toolset-13 for C++23 support
|
|
52
118
|
CIBW_BEFORE_ALL_LINUX: |
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
119
|
+
for i in {1..3}; do
|
|
120
|
+
(dnf install -y gcc-toolset-13 eigen3-devel && \
|
|
121
|
+
source /opt/rh/gcc-toolset-13/enable && \
|
|
122
|
+
curl -fsSL --max-time 10 https://rpm.nodesource.com/setup_18.x | bash - && \
|
|
123
|
+
dnf install -y nodejs && \
|
|
124
|
+
npm install -g quicktype) && break
|
|
125
|
+
if [ $i -lt 3 ]; then sleep 60; fi
|
|
126
|
+
done
|
|
127
|
+
CIBW_BEFORE_ALL_MACOS: |
|
|
128
|
+
for i in {1..5}; do
|
|
129
|
+
npm install -g quicktype && break
|
|
130
|
+
if [ $i -lt 5 ]; then sleep 60; fi
|
|
131
|
+
done
|
|
59
132
|
CIBW_BEFORE_ALL_WINDOWS: npm install -g quicktype
|
|
60
133
|
# Set macOS deployment target to 15.0 for arm64 (Homebrew libraries require it)
|
|
61
134
|
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=15.0
|
|
62
135
|
# Enable gcc-toolset-13 before build for C++23
|
|
63
136
|
CIBW_ENVIRONMENT_LINUX: PATH=/opt/rh/gcc-toolset-13/root/usr/bin:$PATH LD_LIBRARY_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64:$LD_LIBRARY_PATH
|
|
64
|
-
# Install build dependencies
|
|
65
|
-
CIBW_BEFORE_BUILD: pip install scikit-build-core cmake ninja pybind11
|
|
137
|
+
# Install build dependencies with retry
|
|
138
|
+
CIBW_BEFORE_BUILD: pip install --default-timeout=60 --retries 5 scikit-build-core cmake ninja pybind11
|
|
66
139
|
# Test the wheel
|
|
67
140
|
CIBW_TEST_COMMAND: python -c "import PyOpenMagnetics; print(f'PyOpenMagnetics loaded successfully with {len(dir(PyOpenMagnetics))} functions')"
|
|
68
141
|
|
|
@@ -79,6 +152,14 @@ jobs:
|
|
|
79
152
|
with:
|
|
80
153
|
submodules: recursive
|
|
81
154
|
|
|
155
|
+
- name: Cache npm
|
|
156
|
+
uses: actions/cache@v4
|
|
157
|
+
with:
|
|
158
|
+
path: ~/.npm
|
|
159
|
+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
160
|
+
restore-keys: |
|
|
161
|
+
${{ runner.os }}-npm-
|
|
162
|
+
|
|
82
163
|
- name: Set up Python
|
|
83
164
|
uses: actions/setup-python@v5
|
|
84
165
|
with:
|
|
@@ -90,7 +171,15 @@ jobs:
|
|
|
90
171
|
node-version: "18"
|
|
91
172
|
|
|
92
173
|
- name: Install quicktype
|
|
93
|
-
|
|
174
|
+
shell: bash
|
|
175
|
+
run: |
|
|
176
|
+
for i in {1..5}; do
|
|
177
|
+
npm install -g quicktype && break
|
|
178
|
+
if [ $i -lt 5 ]; then
|
|
179
|
+
echo "Retry $i failed, waiting 60s..."
|
|
180
|
+
sleep 60
|
|
181
|
+
fi
|
|
182
|
+
done
|
|
94
183
|
|
|
95
184
|
- name: Install build
|
|
96
185
|
run: python -m pip install build
|
|
@@ -121,9 +210,10 @@ jobs:
|
|
|
121
210
|
with:
|
|
122
211
|
path: dist
|
|
123
212
|
merge-multiple: true
|
|
213
|
+
continue-on-error: true
|
|
124
214
|
|
|
125
215
|
- name: List distribution files
|
|
126
|
-
run: ls -la dist/
|
|
216
|
+
run: ls -la dist/ 2>/dev/null || echo "No distribution files found"
|
|
127
217
|
|
|
128
218
|
- name: Publish to PyPI
|
|
129
219
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -150,6 +240,7 @@ jobs:
|
|
|
150
240
|
with:
|
|
151
241
|
path: dist
|
|
152
242
|
merge-multiple: true
|
|
243
|
+
continue-on-error: true
|
|
153
244
|
|
|
154
245
|
- name: Publish to TestPyPI
|
|
155
246
|
uses: pypa/gh-action-pypi-publish@release/v1
|