femagtools 1.7.3__py3-none-any.whl → 1.7.4__py3-none-any.whl
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.
- femagtools/__init__.py +1 -1
- femagtools/airgap.py +11 -0
- femagtools/bch.py +28 -20
- femagtools/dxfsl/fslrenderer.py +3 -2
- femagtools/fsl.py +8 -17
- femagtools/heat_source_network.py +403 -0
- femagtools/machine/pm.py +78 -4
- femagtools/machine/utils.py +109 -51
- femagtools/model.py +12 -1
- femagtools/parstudy.py +4 -5
- femagtools/plot/char.py +5 -2
- femagtools/templates/basic_modpar.mako +2 -0
- femagtools/templates/{therm-static.mako → therm_static.mako} +15 -13
- femagtools/windings.py +5 -2
- {femagtools-1.7.3.dist-info → femagtools-1.7.4.dist-info}/METADATA +2 -2
- {femagtools-1.7.3.dist-info → femagtools-1.7.4.dist-info}/RECORD +22 -20
- {femagtools-1.7.3.dist-info → femagtools-1.7.4.dist-info}/WHEEL +1 -1
- tests/test_heat_source_network.py +21 -0
- tests/test_machine.py +4 -4
- {femagtools-1.7.3.dist-info → femagtools-1.7.4.dist-info}/LICENSE +0 -0
- {femagtools-1.7.3.dist-info → femagtools-1.7.4.dist-info}/entry_points.txt +0 -0
- {femagtools-1.7.3.dist-info → femagtools-1.7.4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
import femagtools.heat_source_network as hsn
|
2
|
+
import pathlib
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
|
6
|
+
@pytest.fixture
|
7
|
+
def data_dir():
|
8
|
+
return pathlib.Path(__file__).with_name('data')
|
9
|
+
|
10
|
+
|
11
|
+
def test_heat_source_network(data_dir):
|
12
|
+
model = hsn.read(str(data_dir / 'temp_model.hsn'))
|
13
|
+
assert [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13] == model.nodes
|
14
|
+
names = model.get_node_names()
|
15
|
+
assert ['StZa', 'outs', 'StJo', 'Slot',
|
16
|
+
'Shaf', 'Iron', 'PMag', 'PMag',
|
17
|
+
'W1 ', 'W2 ', 'W3 '] == names
|
18
|
+
T = model.solve()
|
19
|
+
# [130.22552926, 56.75737966, 116.12788806, 150.18881253,
|
20
|
+
# 175.77455152, 175.77455152, 175.77526274, 175.77455152,
|
21
|
+
# 126.04691063, 122.49609205, 125.27401647])
|
tests/test_machine.py
CHANGED
@@ -272,10 +272,10 @@ def test_invpark():
|
|
272
272
|
iq = 1
|
273
273
|
id = 0
|
274
274
|
ia, ib, ic = femagtools.machine.invpark(w1t, iq, id)
|
275
|
-
assert ia[0] == pytest.approx(
|
276
|
-
assert ib[0] == pytest.approx(0.
|
277
|
-
assert ic[0] == pytest.approx(0.
|
278
|
-
assert ic[-1] == pytest.approx(
|
275
|
+
assert ia[0] == pytest.approx(0.0)
|
276
|
+
assert ib[0] == pytest.approx(0.866, rel=1e-3)
|
277
|
+
assert ic[0] == pytest.approx(-0.866, rel=1e-3)
|
278
|
+
assert ic[-1] == pytest.approx(0.866, rel=1e-3)
|
279
279
|
|
280
280
|
|
281
281
|
def test_psidq_create():
|
File without changes
|
File without changes
|
File without changes
|