h2lib-tests 13.1.3102__py3-none-any.whl → 13.1.3103__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.
- h2lib_tests/test_ellipsys_couplings.py +2 -2
- h2lib_tests/test_h2lib.py +24 -29
- h2lib_tests/test_topology_h2lib.py +1 -3
- {h2lib_tests-13.1.3102.dist-info → h2lib_tests-13.1.3103.dist-info}/METADATA +1 -1
- {h2lib_tests-13.1.3102.dist-info → h2lib_tests-13.1.3103.dist-info}/RECORD +7 -7
- {h2lib_tests-13.1.3102.dist-info → h2lib_tests-13.1.3103.dist-info}/WHEEL +0 -0
- {h2lib_tests-13.1.3102.dist-info → h2lib_tests-13.1.3103.dist-info}/top_level.txt +0 -0
@@ -39,10 +39,10 @@ def test_set_aerosections_windspeeds_without_init(capfd):
|
|
39
39
|
pos_gl_xyz = np.array(h2.get_aerosections_position(), order='F') + wt_pos[na, na, :]
|
40
40
|
uvw = np.asfortranarray(el.get_uvw(pos_gl_xyz))
|
41
41
|
|
42
|
-
with pytest.raises(Exception, match='
|
42
|
+
with pytest.raises(Exception, match='Please call init_AD or init_AL before set_aerosections_windspeed'):
|
43
43
|
h2.set_aerosections_windspeed(uvw)
|
44
44
|
out = capfd.readouterr().out
|
45
|
-
assert "Please call
|
45
|
+
assert "Please call init_AD or init_AL before set_aerosections_windspeed" in out
|
46
46
|
|
47
47
|
|
48
48
|
def test_ellipsys_dummy_workflow_1wt():
|
h2lib_tests/test_h2lib.py
CHANGED
@@ -301,7 +301,7 @@ def test_process_died():
|
|
301
301
|
h2.echo_version()
|
302
302
|
|
303
303
|
|
304
|
-
def test_error():
|
304
|
+
def test_error(capfd):
|
305
305
|
model_path = tfp + "minimal/"
|
306
306
|
htc = HTCFile(model_path + 'htc/minimal_mann_turb.htc')
|
307
307
|
htc.wind.scale_time_start = 200
|
@@ -310,44 +310,39 @@ def test_error():
|
|
310
310
|
htc.set_name('tmp')
|
311
311
|
htc.save()
|
312
312
|
|
313
|
-
with H2Lib() as h2:
|
314
|
-
|
313
|
+
with H2Lib(suppress_output=0) as h2:
|
314
|
+
version = h2.get_version()
|
315
|
+
with pytest.raises(Exception, match='Turbulence scale_time_start >= simulation length'):
|
315
316
|
h2.init('htc/tmp.htc', model_path)
|
317
|
+
out, err = capfd.readouterr()
|
318
|
+
assert "*** ERROR *** Turbulence scale_time_start >= simulation length" in out
|
319
|
+
assert h2.get_version() == version # hawc2 still alive
|
320
|
+
with pytest.raises(ValueError):
|
321
|
+
h2.get_version() # now it is closed
|
316
322
|
|
317
323
|
with MultiH2Lib(2) as h2:
|
318
|
-
|
324
|
+
version = h2.get_version()
|
325
|
+
with pytest.raises(Exception, match='Turbulence scale_time_start >= simulation length'):
|
319
326
|
h2.init('htc/tmp.htc', model_path)
|
327
|
+
assert h2.get_version() == version # hawc2 still alive
|
320
328
|
|
321
329
|
|
322
330
|
def test_fail():
|
323
331
|
with H2Lib() as h2:
|
324
|
-
|
332
|
+
version = h2.get_version()
|
333
|
+
with pytest.raises(Exception, match='MyError'):
|
325
334
|
h2.fail('MyError')
|
335
|
+
assert h2.get_version() == version # hawc2 still alive
|
336
|
+
stop_code = 0
|
337
|
+
|
338
|
+
# cover get_stop_code, get_stop_message and reset_stop_code_and_message, but
|
339
|
+
# reset_stop_code_and_message is already called, so stop_code and stop_message are 0 and ""
|
340
|
+
assert h2.get_stop_code(stop_code)[0][0] == 0
|
341
|
+
stop_msg = " " * 1024
|
342
|
+
assert h2.get_stop_message(stop_msg)[0][0].strip() == ''
|
343
|
+
h2.reset_stop_code_and_message()
|
326
344
|
|
327
345
|
with MultiH2Lib(2) as h2:
|
328
346
|
# , match=re.escape('H2LibThread process died before or while executing fail(...)')):
|
329
|
-
with pytest.raises(Exception):
|
347
|
+
with pytest.raises(Exception, match='MyError'):
|
330
348
|
h2.fail('MyError')
|
331
|
-
|
332
|
-
|
333
|
-
def test_dont_stop(capfd):
|
334
|
-
# This test is the same as test_error(), but instead we disable stop.
|
335
|
-
model_path = tfp + "minimal/"
|
336
|
-
htc = HTCFile(model_path + 'htc/minimal_mann_turb.htc')
|
337
|
-
htc.wind.scale_time_start = 200
|
338
|
-
htc.wind.turb_format = 1
|
339
|
-
htc.wind.mann.dont_scale = 0
|
340
|
-
htc.set_name('tmp')
|
341
|
-
htc.save()
|
342
|
-
|
343
|
-
with H2Lib() as h2:
|
344
|
-
h2.stop_on_error(False)
|
345
|
-
h2.init('htc/tmp.htc', model_path)
|
346
|
-
out, err = capfd.readouterr()
|
347
|
-
assert "*** ERROR *** Turbulence scale_time_start >= simulation length" in out
|
348
|
-
|
349
|
-
with MultiH2Lib(2) as h2:
|
350
|
-
h2.stop_on_error(False)
|
351
|
-
h2.init('htc/tmp.htc', model_path)
|
352
|
-
out, err = capfd.readouterr()
|
353
|
-
assert "*** ERROR *** Turbulence scale_time_start >= simulation length" in out
|
@@ -189,9 +189,7 @@ def test_set_orientation_relative_main_body_not_found(
|
|
189
189
|
):
|
190
190
|
h2_dtu_10mw_only_blade_rotate_relative.stop_on_error(False)
|
191
191
|
with pytest.raises(ValueError, match="MAIN_BODY_NOT_FOUND"):
|
192
|
-
h2_dtu_10mw_only_blade_rotate_relative.set_orientation_relative(
|
193
|
-
"hub1", "last", "blade", 0
|
194
|
-
)
|
192
|
+
h2_dtu_10mw_only_blade_rotate_relative.set_orientation_relative("hub1", "last", "blade", 0)
|
195
193
|
|
196
194
|
|
197
195
|
def test_set_orientation_relative_rot_not_found(
|
@@ -2,14 +2,14 @@ h2lib_tests/__init__.py,sha256=VjSqfGg8BzdmSjfSFhJh4hZbYZ_cME7xp9EWFKHQphA,61
|
|
2
2
|
h2lib_tests/conftest.py,sha256=DAxRUsOP7-3-JUTglMSuyr1qcsdrqeKEDerEtenL0lA,14753
|
3
3
|
h2lib_tests/dtu10mw.py,sha256=a7SXfyDwDQPastYKb5CgghOQcYfgO1eTwGrd-H3Enok,4374
|
4
4
|
h2lib_tests/test_calc.py,sha256=VNLfr2J9R2Jy9xTbdZ9dfbQ4dCwr7H7nbZRI3yP69fQ,2152
|
5
|
-
h2lib_tests/test_ellipsys_couplings.py,sha256=
|
6
|
-
h2lib_tests/test_h2lib.py,sha256=
|
5
|
+
h2lib_tests/test_ellipsys_couplings.py,sha256=JLos66l_zNDBY6glxwqSfDa6p0Uko5aRKAckh2uoSSM,3302
|
6
|
+
h2lib_tests/test_h2lib.py,sha256=LEV1n0Fwa1llQwIM06Mcqr07Y6WOn-j8mNxjzlCEOl0,14219
|
7
7
|
h2lib_tests/test_h2rotor.py,sha256=4P5bUGvwYDl8Z9hVNP_SXKa79DWhsA-ptpp0v0rT9ow,11309
|
8
8
|
h2lib_tests/test_lin.py,sha256=KujYIy9YXTo-uxi_umRWIWZwcHu0oH8GyeVgMcMCq0o,6383
|
9
9
|
h2lib_tests/test_mpi.py,sha256=8bMeukbWboijMgWLJIIu3Pn0QtaDadOGhhL099MfMls,6990
|
10
10
|
h2lib_tests/test_multiprocessinterface.py,sha256=h2o4havtK6IuMXsplNjGUa3VxOnbpEYGxdrrAKQilj0,1470
|
11
11
|
h2lib_tests/test_static_solver.py,sha256=ckzcBAuVge5V5tdrac4PPYxrH5TheNTUc3PKksbB89A,7426
|
12
|
-
h2lib_tests/test_topology_h2lib.py,sha256=
|
12
|
+
h2lib_tests/test_topology_h2lib.py,sha256=U1NOREhoJ9m7cYxb8sLsVuKSHRqjkEde6hoyl88IF4A,11486
|
13
13
|
h2lib_tests/test_files/__init__.py,sha256=9e6ZUPb42e0wf2E1rutdcTM8hROcWFRVPXtZriU3ySw,50
|
14
14
|
h2lib_tests/test_files/my_test_cls.py,sha256=7ZDsFkxrLfOY6q00U5Y-daxfuhATK-K5H04RP-VmQdE,850
|
15
15
|
h2lib_tests/test_files/DTU_10_MW/control/dtu_we_controller.dll,sha256=C5T_CuAFtIuDgCXSYAoNu24yKPwj2nWOeORacJbLN9s,1134592
|
@@ -89,7 +89,7 @@ h2lib_tests/test_files/minimal/res/minimal_mann_turb.hdf5,sha256=Q3cs3bZyplZjBpo
|
|
89
89
|
h2lib_tests/test_files/minimal/turb/hawc2_mann_l33.6_ae0.1000_g3.9_h0_512xd32xd16_2.000x3.00x4.00_s0001_u,sha256=byiorJmXDL6uKFbyfXthHTjJdm6ELvLR2lS202KrhRI,1048576
|
90
90
|
h2lib_tests/test_files/minimal/turb/hawc2_mann_l33.6_ae0.1000_g3.9_h0_512xd32xd16_2.000x3.00x4.00_s0001_v,sha256=cxK5Rfgfm3gyJsEYi_KlmYY8DIIl_G0aizN2jt18Glc,1048576
|
91
91
|
h2lib_tests/test_files/minimal/turb/hawc2_mann_l33.6_ae0.1000_g3.9_h0_512xd32xd16_2.000x3.00x4.00_s0001_w,sha256=xs61jAwhP3fIR1P5Oa8ovEt2baLoF8uCNs6pKIT8L4o,1048576
|
92
|
-
h2lib_tests-13.1.
|
93
|
-
h2lib_tests-13.1.
|
94
|
-
h2lib_tests-13.1.
|
95
|
-
h2lib_tests-13.1.
|
92
|
+
h2lib_tests-13.1.3103.dist-info/METADATA,sha256=2hyzPnwoJPCSkngKuqGVx5i49g2Kl_FRGaSA5OYxuek,419
|
93
|
+
h2lib_tests-13.1.3103.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
94
|
+
h2lib_tests-13.1.3103.dist-info/top_level.txt,sha256=WufAL3LO35YJBhWg1AfgTjSld-6l_WuRkXAkNKczUrM,12
|
95
|
+
h2lib_tests-13.1.3103.dist-info/RECORD,,
|
File without changes
|
File without changes
|