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.
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (71.1.0)
2
+ Generator: setuptools (72.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -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(-1.0)
276
- assert ib[0] == pytest.approx(0.5)
277
- assert ic[0] == pytest.approx(0.5)
278
- assert ic[-1] == pytest.approx(-0.5, rel=1e-3)
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():