PyOpenMagnetics 1.3.5__tar.gz → 1.3.8__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.3.5 → pyopenmagnetics-1.3.8}/.github/workflows/publish.yml +22 -18
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/CMakeLists.txt +85 -73
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/PKG-INFO +1 -1
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/converter_design_example.py +2 -2
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/pyproject.toml +1 -1
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/bobbin.cpp +27 -62
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/core.cpp +80 -171
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/losses.cpp +2 -4
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/settings.cpp +1 -2
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/tests/test_converter_endpoints.py +6 -6
- pyopenmagnetics-1.3.8/tests/test_plotting.py +705 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/.github/workflows/ci.yml +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/.gitignore +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/AGENTS.md +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/LICENSE +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/PyOpenMagnetics.pyi +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/README.md +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/api/MAS.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/api/mas_db_reader.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/api/validation.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/clear_cibuildwheel_cache.sh +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/docs/compatibility.md +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/docs/errors.md +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/docs/performance.md +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/README.md +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/buck_inductor.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/complete_simulation_example.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/debug_bobbin.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/debug_coil.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/debug_core.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/debug_plotting.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/flyback_220v_12v_1a.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/flyback_220v_12v_2a_complete.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/flyback_bh_curve.png +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/flyback_core.png +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/flyback_design.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/flyback_summary.png +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/flyback_waveforms.png +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/list_plot_funcs.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/plot_flyback_design.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/plot_flyback_pyom.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/test_field_calc.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/examples/test_field_plot.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/force_fresh_build.sh +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/llms.txt +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/notebooks/01_getting_started.ipynb +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/notebooks/02_buck_inductor.ipynb +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/notebooks/03_core_losses.ipynb +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/notebooks/README.md +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/requirements.txt +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/advisers.cpp +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/advisers.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/bobbin.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/common.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/converter.cpp +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/converter.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/core.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/database.cpp +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/database.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/logging.cpp +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/logging.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/losses.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/module.cpp +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/plotting.cpp +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/plotting.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/settings.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/simulation.cpp +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/simulation.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/utils.cpp +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/utils.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/winding.cpp +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/winding.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/wire.cpp +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/src/wire.h +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/test.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/tests/__init__.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/tests/conftest.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/tests/test_core.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/tests/test_core_adviser.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/tests/test_examples_integration.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/tests/test_inputs.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/tests/test_logging.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/tests/test_magnetic_adviser.py +0 -0
- {pyopenmagnetics-1.3.5 → pyopenmagnetics-1.3.8}/tests/test_winding.py +0 -0
|
@@ -184,20 +184,22 @@ jobs:
|
|
|
184
184
|
CIBW_BEFORE_BUILD: pip install --default-timeout=60 --retries 5 scikit-build-core cmake ninja pybind11
|
|
185
185
|
CIBW_TEST_COMMAND: python -c "import PyOpenMagnetics; print(f'PyOpenMagnetics loaded successfully with {len(dir(PyOpenMagnetics))} functions')"
|
|
186
186
|
|
|
187
|
+
- name: Install twine
|
|
188
|
+
run: python -m pip install twine
|
|
189
|
+
|
|
187
190
|
- name: Publish Windows wheels to PyPI
|
|
188
191
|
if: github.event_name == 'release'
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
run: python -m twine upload wheelhouse/*.whl
|
|
193
|
+
env:
|
|
194
|
+
TWINE_USERNAME: __token__
|
|
195
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
193
196
|
|
|
194
197
|
- name: Publish Windows wheels to TestPyPI
|
|
195
198
|
if: github.event_name == 'workflow_dispatch'
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
packages-dir: wheelhouse/
|
|
199
|
+
run: python -m twine upload --repository-url https://test.pypi.org/legacy/ wheelhouse/*.whl
|
|
200
|
+
env:
|
|
201
|
+
TWINE_USERNAME: __token__
|
|
202
|
+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
201
203
|
|
|
202
204
|
# Build and publish macOS wheels independently
|
|
203
205
|
build_and_publish_macos:
|
|
@@ -267,20 +269,22 @@ jobs:
|
|
|
267
269
|
CIBW_BEFORE_BUILD: pip install --default-timeout=60 --retries 5 scikit-build-core cmake ninja pybind11
|
|
268
270
|
CIBW_TEST_COMMAND: python -c "import PyOpenMagnetics; print(f'PyOpenMagnetics loaded successfully with {len(dir(PyOpenMagnetics))} functions')"
|
|
269
271
|
|
|
272
|
+
- name: Install twine
|
|
273
|
+
run: python -m pip install twine
|
|
274
|
+
|
|
270
275
|
- name: Publish macOS wheels to PyPI
|
|
271
276
|
if: github.event_name == 'release'
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
277
|
+
run: python -m twine upload wheelhouse/*.whl
|
|
278
|
+
env:
|
|
279
|
+
TWINE_USERNAME: __token__
|
|
280
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
276
281
|
|
|
277
282
|
- name: Publish macOS wheels to TestPyPI
|
|
278
283
|
if: github.event_name == 'workflow_dispatch'
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
packages-dir: wheelhouse/
|
|
284
|
+
run: python -m twine upload --repository-url https://test.pypi.org/legacy/ wheelhouse/*.whl
|
|
285
|
+
env:
|
|
286
|
+
TWINE_USERNAME: __token__
|
|
287
|
+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
284
288
|
|
|
285
289
|
# Build and publish source distribution independently
|
|
286
290
|
build_and_publish_sdist:
|
|
@@ -29,7 +29,7 @@ else ()
|
|
|
29
29
|
set(CMAKE_BUILD_TYPE Release)
|
|
30
30
|
|
|
31
31
|
# Enable Link Time Optimization to reduce binary size
|
|
32
|
-
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION
|
|
32
|
+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE) # TEMP: disable LTO (OOM)
|
|
33
33
|
|
|
34
34
|
# Strip symbols and use size optimization
|
|
35
35
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s -Os")
|
|
@@ -37,8 +37,15 @@ else ()
|
|
|
37
37
|
endif()
|
|
38
38
|
|
|
39
39
|
SET(MAS_DIRECTORY "${CMAKE_BINARY_DIR}/MAS/")
|
|
40
|
-
|
|
41
|
-
SET(
|
|
40
|
+
if(DEFINED ENV{LOCAL_MKF_DIR})
|
|
41
|
+
SET(LOCAL_MKF_MAS TRUE)
|
|
42
|
+
SET(MAS_DIR "${PROJECT_SOURCE_DIR}/_mas_local")
|
|
43
|
+
SET(MKF_DIR "${PROJECT_SOURCE_DIR}/_mkf_local")
|
|
44
|
+
else()
|
|
45
|
+
SET(LOCAL_MKF_MAS FALSE)
|
|
46
|
+
SET(MAS_DIR "${CMAKE_BINARY_DIR}/_deps/mas-src")
|
|
47
|
+
SET(MKF_DIR "${CMAKE_BINARY_DIR}/_deps/mkf-src")
|
|
48
|
+
endif()
|
|
42
49
|
SET(FETCHCONTENT_QUIET FALSE)
|
|
43
50
|
|
|
44
51
|
message(STATUS MAS_DIRECTORY)
|
|
@@ -110,63 +117,68 @@ FetchContent_Declare(eigen
|
|
|
110
117
|
FetchContent_MakeAvailable(eigen)
|
|
111
118
|
include_directories("${CMAKE_BINARY_DIR}/_deps/eigen-src")
|
|
112
119
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
message(STATUS "
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
120
|
+
if(NOT LOCAL_MKF_MAS)
|
|
121
|
+
message(STATUS "Fetching MKF")
|
|
122
|
+
# Force fresh clone by using a unique timestamp - update this when MKF changes
|
|
123
|
+
set(MKF_FORCE_REFRESH "2025-02-26-01")
|
|
124
|
+
# Tell MKF to disable matplotplusplus and use SVG-based Painter instead
|
|
125
|
+
set(INCLUDE_PYMKF ON CACHE BOOL "Build Python interface" FORCE)
|
|
126
|
+
FetchContent_Declare(MKF
|
|
127
|
+
GIT_REPOSITORY https://github.com/OpenMagnetics/MKF.git
|
|
128
|
+
GIT_TAG main
|
|
129
|
+
GIT_PROGRESS TRUE
|
|
130
|
+
GIT_SHALLOW TRUE)
|
|
131
|
+
|
|
132
|
+
message(STATUS "Fetching mas")
|
|
133
|
+
# Skip Git LFS to avoid bandwidth quota issues - data files are optional for build
|
|
134
|
+
set(ENV{GIT_LFS_SKIP_SMUDGE} "1")
|
|
135
|
+
# Force fresh clone by using a unique timestamp - update this when MAS changes
|
|
136
|
+
set(MAS_FORCE_REFRESH "2025-02-26-01")
|
|
137
|
+
FetchContent_Declare(
|
|
138
|
+
mas
|
|
139
|
+
GIT_REPOSITORY https://github.com/OpenMagnetics/MAS.git
|
|
140
|
+
GIT_TAG main
|
|
141
|
+
GIT_SHALLOW TRUE)
|
|
142
|
+
|
|
143
|
+
message(STATUS "Fetching Properties mas")
|
|
144
|
+
FetchContent_GetProperties(mas)
|
|
145
|
+
message(STATUS "Fetching Properties MKF")
|
|
146
|
+
FetchContent_GetProperties(MKF)
|
|
147
|
+
message(STATUS "MAS_POPULATED: ${MAS_POPULATED}")
|
|
148
|
+
message(STATUS "MKF_POPULATED: ${MKF_POPULATED}")
|
|
149
|
+
|
|
150
|
+
# Always delete and repopulate MAS to ensure we get the latest
|
|
151
|
+
if(EXISTS ${CMAKE_BINARY_DIR}/_deps/mas-src)
|
|
152
|
+
message(STATUS "Removing old MAS source to force fresh clone")
|
|
153
|
+
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/_deps/mas-src)
|
|
154
|
+
endif()
|
|
155
|
+
message(STATUS "Populating MAS")
|
|
156
|
+
FetchContent_Populate(mas)
|
|
157
|
+
# Show git log to verify version
|
|
158
|
+
execute_process(
|
|
159
|
+
COMMAND git -C ${mas_SOURCE_DIR} log --oneline -1
|
|
160
|
+
OUTPUT_VARIABLE MAS_GIT_LOG
|
|
161
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
162
|
+
ERROR_VARIABLE MAS_GIT_ERROR
|
|
163
|
+
)
|
|
164
|
+
message(STATUS "MAS version: ${MAS_GIT_LOG}")
|
|
165
|
+
if(MAS_GIT_ERROR)
|
|
166
|
+
message(STATUS "MAS git error: ${MAS_GIT_ERROR}")
|
|
167
|
+
endif()
|
|
168
|
+
|
|
169
|
+
if(NOT MKF_POPULATED)
|
|
170
|
+
message(STATUS "Populating MKF")
|
|
171
|
+
FetchContent_Populate(MKF)
|
|
172
|
+
else()
|
|
173
|
+
message(STATUS "MKF already populated at: ${MKF_SOURCE_DIR}")
|
|
174
|
+
endif()
|
|
175
|
+
|
|
176
|
+
message(STATUS ${MAS_SOURCE_DIR})
|
|
164
177
|
else()
|
|
165
|
-
message(STATUS "
|
|
178
|
+
message(STATUS "Using local MKF at ${MKF_DIR}")
|
|
179
|
+
message(STATUS "Using local MAS at ${MAS_DIR}")
|
|
166
180
|
endif()
|
|
167
181
|
|
|
168
|
-
message(STATUS ${MAS_SOURCE_DIR})
|
|
169
|
-
|
|
170
182
|
message(STATUS "Compiling MAS")
|
|
171
183
|
|
|
172
184
|
|
|
@@ -226,14 +238,14 @@ add_custom_target(PyMASGeneration
|
|
|
226
238
|
DEPENDS "${MAS_DIRECTORY}/MAS.hpp")
|
|
227
239
|
|
|
228
240
|
message(STATUS "Compiling PyOpenMagnetics with modular structure")
|
|
229
|
-
file(GLOB SOURCES src/*.cpp
|
|
230
|
-
${
|
|
231
|
-
${
|
|
232
|
-
${
|
|
233
|
-
${
|
|
234
|
-
${
|
|
235
|
-
${
|
|
236
|
-
${
|
|
241
|
+
file(GLOB SOURCES src/*.cpp
|
|
242
|
+
${MKF_DIR}/src/*.cpp
|
|
243
|
+
${MKF_DIR}/src/advisers/*.cpp
|
|
244
|
+
${MKF_DIR}/src/constructive_models/*.cpp
|
|
245
|
+
${MKF_DIR}/src/converter_models/*.cpp
|
|
246
|
+
${MKF_DIR}/src/physical_models/*.cpp
|
|
247
|
+
${MKF_DIR}/src/processors/*.cpp
|
|
248
|
+
${MKF_DIR}/src/support/*.cpp
|
|
237
249
|
)
|
|
238
250
|
message(STATUS SOURCES)
|
|
239
251
|
message(STATUS ${SOURCES})
|
|
@@ -247,7 +259,7 @@ file(DOWNLOAD "https://raw.githubusercontent.com/vector-of-bool/cmrc/master/CMak
|
|
|
247
259
|
"${CMAKE_BINARY_DIR}/CMakeRC.cmake")
|
|
248
260
|
include("${CMAKE_BINARY_DIR}/CMakeRC.cmake")
|
|
249
261
|
|
|
250
|
-
include_directories("${
|
|
262
|
+
include_directories("${MKF_DIR}/")
|
|
251
263
|
|
|
252
264
|
cmrc_add_resource_library(insulation_standards ALIAS data::insulation_standards NAMESPACE insulationData WHENCE ${MKF_DIR}/ ${MKF_DIR}/src/data/insulation_standards/IEC_60664-1.json ${MKF_DIR}/src/data/insulation_standards/IEC_60664-4.json ${MKF_DIR}/src/data/insulation_standards/IEC_60664-5.json ${MKF_DIR}/src/data/insulation_standards/IEC_62368-1.json ${MKF_DIR}/src/data/insulation_standards/IEC_61558-1.json ${MKF_DIR}/src/data/insulation_standards/IEC_61558-2-16.json ${MKF_DIR}/src/data/insulation_standards/IEC_60335-1.json)
|
|
253
265
|
target_link_libraries(PyOpenMagnetics PUBLIC data::insulation_standards)
|
|
@@ -276,13 +288,13 @@ include_directories("${CMAKE_BINARY_DIR}/_deps/magic-enum-src/include")
|
|
|
276
288
|
include_directories("${CMAKE_BINARY_DIR}/_deps/svg-src/src")
|
|
277
289
|
include_directories("${CMAKE_BINARY_DIR}/_deps/spline-src/src")
|
|
278
290
|
include_directories("${CMAKE_BINARY_DIR}/_deps/json-src/include/")
|
|
279
|
-
include_directories("${
|
|
280
|
-
include_directories("${
|
|
281
|
-
include_directories("${
|
|
282
|
-
include_directories("${
|
|
283
|
-
include_directories("${
|
|
284
|
-
include_directories("${
|
|
285
|
-
include_directories("${
|
|
291
|
+
include_directories("${MKF_DIR}/src/")
|
|
292
|
+
include_directories("${MKF_DIR}/src/advisers/")
|
|
293
|
+
include_directories("${MKF_DIR}/src/constructive_models/")
|
|
294
|
+
include_directories("${MKF_DIR}/src/converter_models/")
|
|
295
|
+
include_directories("${MKF_DIR}/src/physical_models/")
|
|
296
|
+
include_directories("${MKF_DIR}/src/processors/")
|
|
297
|
+
include_directories("${MKF_DIR}/src/support/")
|
|
286
298
|
include_directories("${CMAKE_BINARY_DIR}/_deps/eigen-src")
|
|
287
299
|
include_directories("${CMAKE_BINARY_DIR}/_cmrc/include")
|
|
288
300
|
include_directories("${MAS_DIRECTORY}")
|
|
@@ -169,8 +169,8 @@ def design_buck_with_converter_method():
|
|
|
169
169
|
"desiredInductance": 4.7e-6, # 4.7 µH
|
|
170
170
|
"currentRippleRatio": 0.3,
|
|
171
171
|
"operatingPoints": [{
|
|
172
|
-
"
|
|
173
|
-
"
|
|
172
|
+
"outputVoltages": [3.3],
|
|
173
|
+
"outputCurrents": [5.0],
|
|
174
174
|
"switchingFrequency": 500000, # 500 kHz
|
|
175
175
|
"ambientTemperature": 25
|
|
176
176
|
}]
|
|
@@ -3,83 +3,48 @@
|
|
|
3
3
|
namespace PyMKF {
|
|
4
4
|
|
|
5
5
|
json get_bobbins() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
catch (const std::exception &exc) {
|
|
17
|
-
json exception;
|
|
18
|
-
exception["data"] = "Exception: " + std::string{exc.what()};
|
|
19
|
-
return exception;
|
|
20
|
-
}
|
|
6
|
+
auto bobbins = OpenMagnetics::get_bobbins();
|
|
7
|
+
json result = json::array();
|
|
8
|
+
for (auto elem : bobbins) {
|
|
9
|
+
json aux;
|
|
10
|
+
to_json(aux, elem);
|
|
11
|
+
result.push_back(aux);
|
|
12
|
+
}
|
|
13
|
+
return result;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
16
|
json get_bobbin_names() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
result.push_back(elem);
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
catch (const std::exception &exc) {
|
|
33
|
-
json exception;
|
|
34
|
-
exception["data"] = "Exception: " + std::string{exc.what()};
|
|
35
|
-
return exception;
|
|
17
|
+
auto bobbinNames = OpenMagnetics::get_bobbin_names();
|
|
18
|
+
json result = json::array();
|
|
19
|
+
for (auto elem : bobbinNames) {
|
|
20
|
+
result.push_back(elem);
|
|
36
21
|
}
|
|
22
|
+
return result;
|
|
37
23
|
}
|
|
38
24
|
|
|
39
25
|
json find_bobbin_by_name(json bobbinName) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
|
-
catch (const std::exception &exc) {
|
|
47
|
-
json exception;
|
|
48
|
-
exception["data"] = "Exception: " + std::string{exc.what()};
|
|
49
|
-
return exception;
|
|
50
|
-
}
|
|
26
|
+
auto bobbinData = OpenMagnetics::find_bobbin_by_name(bobbinName);
|
|
27
|
+
json result;
|
|
28
|
+
to_json(result, bobbinData);
|
|
29
|
+
return result;
|
|
51
30
|
}
|
|
52
31
|
|
|
53
32
|
json create_basic_bobbin(json coreDataJson, bool nullDimensions) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
auto bobbin = OpenMagnetics::Bobbin::create_quick_bobbin(core, nullDimensions);
|
|
33
|
+
OpenMagnetics::Core core(coreDataJson, false, false, false);
|
|
34
|
+
auto bobbin = OpenMagnetics::Bobbin::create_quick_bobbin(core, nullDimensions);
|
|
57
35
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
catch (const std::exception &exc) {
|
|
63
|
-
json exception;
|
|
64
|
-
exception["data"] = "Exception: " + std::string{exc.what()};
|
|
65
|
-
return exception;
|
|
66
|
-
}
|
|
36
|
+
json result;
|
|
37
|
+
to_json(result, bobbin);
|
|
38
|
+
return result;
|
|
67
39
|
}
|
|
68
40
|
|
|
69
41
|
json create_basic_bobbin_by_thickness(json coreDataJson, double thickness) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
auto bobbin = OpenMagnetics::Bobbin::create_quick_bobbin(core, thickness);
|
|
42
|
+
OpenMagnetics::Core core(coreDataJson, false, false, false);
|
|
43
|
+
auto bobbin = OpenMagnetics::Bobbin::create_quick_bobbin(core, thickness);
|
|
73
44
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
catch (const std::exception &exc) {
|
|
79
|
-
json exception;
|
|
80
|
-
exception["data"] = "Exception: " + std::string{exc.what()};
|
|
81
|
-
return exception;
|
|
82
|
-
}
|
|
45
|
+
json result;
|
|
46
|
+
to_json(result, bobbin);
|
|
47
|
+
return result;
|
|
83
48
|
}
|
|
84
49
|
|
|
85
50
|
json calculate_bobbin_data(json magneticJson) {
|