From c9c179739e11f2f9c50b1dd5d9f8528e2cd8fdd9 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Mon, 29 Sep 2025 10:30:31 +0200 Subject: [PATCH 1/8] Add pytest fixture fluent_axial_comp_flprj --- tests/conftest.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index f241ee23aa4..3859568b20a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -254,6 +254,20 @@ def return_ds(server=None): return return_ds +@pytest.fixture() +def fluent_axial_comp_flprj(): + """Return a function which creates a data sources + with a 'flrpj' file of fluent axial compressor case.""" + + def return_ds(server=None): + ds = core.DataSources(server=server) + files = examples.download_fluent_axial_comp(server=server) + ds.set_result_file_path(files["flprj"], "flprj") + return ds + + return return_ds + + @pytest.fixture() def fluent_mixing_elbow_steady_state(): """Return a function which creates a data sources From 270402d118c18762493181309eb26257c7b65551 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Mon, 29 Sep 2025 10:36:47 +0200 Subject: [PATCH 2/8] Add test_cff_model_flprj --- tests/test_cff.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_cff.py b/tests/test_cff.py index 5c0c4fdb036..1c125e1e7c3 100644 --- a/tests/test_cff.py +++ b/tests/test_cff.py @@ -39,6 +39,19 @@ def test_cff_model(server_type, fluent_multi_species): assert "faces" in str(mesh) +@pytest.mark.skipif( + not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_0, + reason="CFF source operators where not supported before 7.0,", +) +def test_cff_model_flprj(server_type, fluent_axial_comp_flprj): + ds = fluent_axial_comp_flprj(server_type) + model = dpf.Model(ds, server=server_type) + assert model is not None + assert "fluid" in str(model) + mesh_info = model.metadata.mesh_info + assert "faces" in str(mesh_info) + + @pytest.mark.skipif( not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_0, reason="CFF source operators where not supported before 7.0,", From 7b2424f5ce5369f9aa778af3127c56a817372ac4 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Fri, 14 Nov 2025 16:17:04 +0100 Subject: [PATCH 3/8] small changes --- tests/conftest.py | 7 +++++-- tests/test_cff.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 3859568b20a..ae1dd2277b5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -447,11 +447,14 @@ def remove_none_available_config(configs, config_names): configsserver_type, config_namesserver_type = remove_none_available_config( [ - ServerConfig(protocol=CommunicationProtocols.gRPC, legacy=True), + # ServerConfig(protocol=CommunicationProtocols.gRPC, legacy=True), ServerConfig(protocol=CommunicationProtocols.gRPC, legacy=False), ServerConfig(protocol=CommunicationProtocols.InProcess, legacy=False), ], - ["ansys-grpc-dpf", "gRPC CLayer", "in Process CLayer"], + [ # "ansys-grpc-dpf", + "gRPC CLayer", + "in Process CLayer", + ], ) diff --git a/tests/test_cff.py b/tests/test_cff.py index 1c125e1e7c3..1213713d219 100644 --- a/tests/test_cff.py +++ b/tests/test_cff.py @@ -44,12 +44,15 @@ def test_cff_model(server_type, fluent_multi_species): reason="CFF source operators where not supported before 7.0,", ) def test_cff_model_flprj(server_type, fluent_axial_comp_flprj): + print(dpf.misc.get_ansys_path()) ds = fluent_axial_comp_flprj(server_type) - model = dpf.Model(ds, server=server_type) + print(server_type) + rip = dpf.operators.metadata.result_info_provider(data_sources=ds, server=server_type).eval() + """model = dpf.Model(ds, server=server_type) assert model is not None assert "fluid" in str(model) mesh_info = model.metadata.mesh_info - assert "faces" in str(mesh_info) + assert "faces" in str(mesh_info)""" @pytest.mark.skipif( From 34f25274225938b210d309bf38f907e2ecee6708 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Mon, 17 Nov 2025 14:55:26 +0100 Subject: [PATCH 4/8] Add tests and version --- tests/conftest.py | 1 + tests/test_cff.py | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index ae1dd2277b5..b7d3ada7306 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -346,6 +346,7 @@ def return_ds(server=None): SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0 = meets_version( get_server_version(core._global_server()), "11.0" ) +SERVERS_VERSION_EQUAL_TO_10_0 = get_server_version(core._global_server()) == "10.0" SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0 = meets_version( get_server_version(core._global_server()), "10.0" ) diff --git a/tests/test_cff.py b/tests/test_cff.py index 1213713d219..d4e2a3368fb 100644 --- a/tests/test_cff.py +++ b/tests/test_cff.py @@ -43,16 +43,17 @@ def test_cff_model(server_type, fluent_multi_species): not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_0, reason="CFF source operators where not supported before 7.0,", ) +@pytest.mark.skipif( + not conftest.SERVERS_VERSION_EQUAL_TO_10_0, + reason="This feature is not available for sever version 10.0", +) def test_cff_model_flprj(server_type, fluent_axial_comp_flprj): - print(dpf.misc.get_ansys_path()) ds = fluent_axial_comp_flprj(server_type) - print(server_type) - rip = dpf.operators.metadata.result_info_provider(data_sources=ds, server=server_type).eval() - """model = dpf.Model(ds, server=server_type) + model = dpf.Model(ds, server=server_type) assert model is not None assert "fluid" in str(model) mesh_info = model.metadata.mesh_info - assert "faces" in str(mesh_info)""" + assert "faces" in str(mesh_info) @pytest.mark.skipif( From 66f2254ab5abd0d7abaa97c6a9bccd6c46b5f5d0 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Mon, 17 Nov 2025 14:59:33 +0100 Subject: [PATCH 5/8] Put back conftests --- tests/conftest.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index b7d3ada7306..2dded3492c6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -448,14 +448,11 @@ def remove_none_available_config(configs, config_names): configsserver_type, config_namesserver_type = remove_none_available_config( [ - # ServerConfig(protocol=CommunicationProtocols.gRPC, legacy=True), + ServerConfig(protocol=CommunicationProtocols.gRPC, legacy=True), ServerConfig(protocol=CommunicationProtocols.gRPC, legacy=False), ServerConfig(protocol=CommunicationProtocols.InProcess, legacy=False), ], - [ # "ansys-grpc-dpf", - "gRPC CLayer", - "in Process CLayer", - ], + ["ansys-grpc-dpf", "gRPC CLayer", "in Process CLayer"], ) From 731e42e03d4546d794c86690f4695f66e5e81a84 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Mon, 17 Nov 2025 15:02:35 +0100 Subject: [PATCH 6/8] Invert if --- tests/test_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cff.py b/tests/test_cff.py index d4e2a3368fb..f9fe590a047 100644 --- a/tests/test_cff.py +++ b/tests/test_cff.py @@ -44,7 +44,7 @@ def test_cff_model(server_type, fluent_multi_species): reason="CFF source operators where not supported before 7.0,", ) @pytest.mark.skipif( - not conftest.SERVERS_VERSION_EQUAL_TO_10_0, + conftest.SERVERS_VERSION_EQUAL_TO_10_0, reason="This feature is not available for sever version 10.0", ) def test_cff_model_flprj(server_type, fluent_axial_comp_flprj): From 9804038c1fa57389aa67c57707af116c2ff48bb8 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Thu, 20 Nov 2025 15:39:28 +0100 Subject: [PATCH 7/8] Improve skipif strings --- tests/conftest.py | 1 - tests/test_cff.py | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 2dded3492c6..3859568b20a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -346,7 +346,6 @@ def return_ds(server=None): SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0 = meets_version( get_server_version(core._global_server()), "11.0" ) -SERVERS_VERSION_EQUAL_TO_10_0 = get_server_version(core._global_server()) == "10.0" SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0 = meets_version( get_server_version(core._global_server()), "10.0" ) diff --git a/tests/test_cff.py b/tests/test_cff.py index f9fe590a047..29cbb09f0d1 100644 --- a/tests/test_cff.py +++ b/tests/test_cff.py @@ -40,12 +40,8 @@ def test_cff_model(server_type, fluent_multi_species): @pytest.mark.skipif( - not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_0, - reason="CFF source operators where not supported before 7.0,", -) -@pytest.mark.skipif( - conftest.SERVERS_VERSION_EQUAL_TO_10_0, - reason="This feature is not available for sever version 10.0", + not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0, + reason="Bug due to gatebin incompatibilities for servers <26.1", ) def test_cff_model_flprj(server_type, fluent_axial_comp_flprj): ds = fluent_axial_comp_flprj(server_type) From 4ab8f0bcc3a8acbcb6f0ff79f7767c6916a137d6 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Thu, 20 Nov 2025 15:59:35 +0100 Subject: [PATCH 8/8] 26.1, not 25.2 --- tests/test_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cff.py b/tests/test_cff.py index 29cbb09f0d1..761c24b0a55 100644 --- a/tests/test_cff.py +++ b/tests/test_cff.py @@ -40,7 +40,7 @@ def test_cff_model(server_type, fluent_multi_species): @pytest.mark.skipif( - not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0, + not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0, reason="Bug due to gatebin incompatibilities for servers <26.1", ) def test_cff_model_flprj(server_type, fluent_axial_comp_flprj):