From d63ce0f47fe7f37f0ffc4bcd1be08a2e096852d9 Mon Sep 17 00:00:00 2001 From: rpeixoto Date: Wed, 16 Jul 2025 11:49:48 +0200 Subject: [PATCH 1/6] Modify result_info tests --- tests/test_resultinfo.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/test_resultinfo.py b/tests/test_resultinfo.py index 206e24dde52..aeaa01a50bb 100644 --- a/tests/test_resultinfo.py +++ b/tests/test_resultinfo.py @@ -51,10 +51,19 @@ def test_get_resultinfo_no_model(velocity_acceleration, server_type): op.connect(4, dataSource) res = op.get_output(0, dpf.core.types.result_info) assert res.analysis_type == "static" + if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_1: assert res.n_results == 14 else: - assert res.n_results == 15 + available_results_names = [] + for result in res.available_results: + available_results_names.append(result.name) + expected_results = ["displacement", "velocity", "acceleration", "reaction_force", "stress", "elemental_volume", "stiffness_matrix_energy", +"artificial_hourglass_energy", "thermal_dissipation_energy", "kinetic_energy", "co_energy", "incremental_energy", "elastic_strain", +"element_euler_angles", "structural_temperature"] + for result in expected_results: + assert result in available_results_names + assert "m, kg, N, s, V, A" in res.unit_system assert res.physics_type == mechanical @@ -65,7 +74,15 @@ def test_get_resultinfo(model): if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_1: assert res.n_results == 14 else: - assert res.n_results == 15 + available_results_names = [] + for result in res.available_results: + available_results_names.append(result.name) + expected_results = ["displacement", "velocity", "acceleration", "reaction_force", "stress", "elemental_volume", "stiffness_matrix_energy", +"artificial_hourglass_energy", "thermal_dissipation_energy", "kinetic_energy", "co_energy", "incremental_energy", "elastic_strain", +"element_euler_angles", "structural_temperature"] + for result in expected_results: + assert result in available_results_names + assert "m, kg, N, s, V, A" in res.unit_system assert res.physics_type == mechanical assert "Static analysis" in str(res) From 5168a8f83bb19bd9d8f607ca16dcab2f03bbcac1 Mon Sep 17 00:00:00 2001 From: rpeixoto Date: Thu, 17 Jul 2025 09:58:24 +0200 Subject: [PATCH 2/6] formating --- tests/test_resultinfo.py | 42 +++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/tests/test_resultinfo.py b/tests/test_resultinfo.py index aeaa01a50bb..741dbba6b9b 100644 --- a/tests/test_resultinfo.py +++ b/tests/test_resultinfo.py @@ -58,9 +58,23 @@ def test_get_resultinfo_no_model(velocity_acceleration, server_type): available_results_names = [] for result in res.available_results: available_results_names.append(result.name) - expected_results = ["displacement", "velocity", "acceleration", "reaction_force", "stress", "elemental_volume", "stiffness_matrix_energy", -"artificial_hourglass_energy", "thermal_dissipation_energy", "kinetic_energy", "co_energy", "incremental_energy", "elastic_strain", -"element_euler_angles", "structural_temperature"] + expected_results = [ + "displacement", + "velocity", + "acceleration", + "reaction_force", + "stress", + "elemental_volume", + "stiffness_matrix_energy", + "artificial_hourglass_energy", + "thermal_dissipation_energy", + "kinetic_energy", + "co_energy", + "incremental_energy", + "elastic_strain", + "element_euler_angles", + "structural_temperature", + ] for result in expected_results: assert result in available_results_names @@ -77,12 +91,26 @@ def test_get_resultinfo(model): available_results_names = [] for result in res.available_results: available_results_names.append(result.name) - expected_results = ["displacement", "velocity", "acceleration", "reaction_force", "stress", "elemental_volume", "stiffness_matrix_energy", -"artificial_hourglass_energy", "thermal_dissipation_energy", "kinetic_energy", "co_energy", "incremental_energy", "elastic_strain", -"element_euler_angles", "structural_temperature"] + expected_results = [ + "displacement", + "velocity", + "acceleration", + "reaction_force", + "stress", + "elemental_volume", + "stiffness_matrix_energy", + "artificial_hourglass_energy", + "thermal_dissipation_energy", + "kinetic_energy", + "co_energy", + "incremental_energy", + "elastic_strain", + "element_euler_angles", + "structural_temperature", + ] for result in expected_results: assert result in available_results_names - + assert "m, kg, N, s, V, A" in res.unit_system assert res.physics_type == mechanical assert "Static analysis" in str(res) From 9101bffc53d72e0c3283ce14188625dbd6f96e08 Mon Sep 17 00:00:00 2001 From: rpeixoto Date: Thu, 17 Jul 2025 11:01:46 +0200 Subject: [PATCH 3/6] Change tests --- tests/test_resultinfo.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_resultinfo.py b/tests/test_resultinfo.py index 741dbba6b9b..3f78ea504eb 100644 --- a/tests/test_resultinfo.py +++ b/tests/test_resultinfo.py @@ -75,6 +75,10 @@ def test_get_resultinfo_no_model(velocity_acceleration, server_type): "element_euler_angles", "structural_temperature", ] + if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0: + expected_results.append("element_orientations") + else: + expected_results.append("element_euler_angles") for result in expected_results: assert result in available_results_names @@ -108,6 +112,10 @@ def test_get_resultinfo(model): "element_euler_angles", "structural_temperature", ] + if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0: + expected_results.append("element_orientations") + else: + expected_results.append("element_euler_angles") for result in expected_results: assert result in available_results_names From e9f6a61ef8ea694b050bec9159568b4848c3a498 Mon Sep 17 00:00:00 2001 From: rpeixoto Date: Thu, 17 Jul 2025 11:02:43 +0200 Subject: [PATCH 4/6] Leftover --- tests/test_resultinfo.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_resultinfo.py b/tests/test_resultinfo.py index 3f78ea504eb..f8bab396204 100644 --- a/tests/test_resultinfo.py +++ b/tests/test_resultinfo.py @@ -72,7 +72,6 @@ def test_get_resultinfo_no_model(velocity_acceleration, server_type): "co_energy", "incremental_energy", "elastic_strain", - "element_euler_angles", "structural_temperature", ] if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0: @@ -109,7 +108,6 @@ def test_get_resultinfo(model): "co_energy", "incremental_energy", "elastic_strain", - "element_euler_angles", "structural_temperature", ] if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0: From f12a0cff34dd307c3e35d736f297a226e654e14c Mon Sep 17 00:00:00 2001 From: rpeixoto Date: Thu, 17 Jul 2025 15:08:32 +0200 Subject: [PATCH 5/6] change version --- tests/test_resultinfo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_resultinfo.py b/tests/test_resultinfo.py index f8bab396204..f2da61567a4 100644 --- a/tests/test_resultinfo.py +++ b/tests/test_resultinfo.py @@ -31,6 +31,7 @@ SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_1, SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0, SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0, + SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0, ) if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_5_0: @@ -74,7 +75,7 @@ def test_get_resultinfo_no_model(velocity_acceleration, server_type): "elastic_strain", "structural_temperature", ] - if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0: + if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0: expected_results.append("element_orientations") else: expected_results.append("element_euler_angles") @@ -110,7 +111,7 @@ def test_get_resultinfo(model): "elastic_strain", "structural_temperature", ] - if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0: + if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0: expected_results.append("element_orientations") else: expected_results.append("element_euler_angles") From 8492935f24ac5b58d98a38e0aca7fad740a9d01e Mon Sep 17 00:00:00 2001 From: rpeixoto Date: Fri, 18 Jul 2025 10:49:10 +0200 Subject: [PATCH 6/6] wrong name --- tests/test_resultinfo.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/test_resultinfo.py b/tests/test_resultinfo.py index f2da61567a4..b3a9f5ed7c0 100644 --- a/tests/test_resultinfo.py +++ b/tests/test_resultinfo.py @@ -31,7 +31,6 @@ SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_1, SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0, SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0, - SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0, ) if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_5_0: @@ -73,12 +72,9 @@ def test_get_resultinfo_no_model(velocity_acceleration, server_type): "co_energy", "incremental_energy", "elastic_strain", + "element_orientations", "structural_temperature", ] - if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0: - expected_results.append("element_orientations") - else: - expected_results.append("element_euler_angles") for result in expected_results: assert result in available_results_names @@ -109,12 +105,9 @@ def test_get_resultinfo(model): "co_energy", "incremental_energy", "elastic_strain", + "element_orientations", "structural_temperature", ] - if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0: - expected_results.append("element_orientations") - else: - expected_results.append("element_euler_angles") for result in expected_results: assert result in available_results_names