From f2b1897af42dea965563f7c06261f19be078e514 Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Fri, 12 Dec 2025 17:43:48 +0100 Subject: [PATCH 1/4] Assign .h5 files to hdf5 key --- src/ansys/dpf/core/data_sources.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ansys/dpf/core/data_sources.py b/src/ansys/dpf/core/data_sources.py index 847fad95cbc..bc82a8451c8 100644 --- a/src/ansys/dpf/core/data_sources.py +++ b/src/ansys/dpf/core/data_sources.py @@ -173,6 +173,8 @@ def set_result_file_path( # Look for another extension for .h5 and .cff files if key == "" and extension in [".h5", ".cff"]: key = self.guess_second_key(str(filepath)) + if key == "" and extension == ".h5": + key = "hdf5" if key == "": self._api.data_sources_set_result_file_path_utf8(self, str(filepath)) else: From c7b29715ebbd4f1fdd796ab320013f2a0f8ec689 Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Mon, 15 Dec 2025 10:32:28 +0100 Subject: [PATCH 2/4] Add test --- tests/test_datasources.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_datasources.py b/tests/test_datasources.py index 577aeac2cd0..a1135c81e6c 100644 --- a/tests/test_datasources.py +++ b/tests/test_datasources.py @@ -103,6 +103,11 @@ def test_set_resultpath_data_sources_cff(server_type): assert data_sources.result_key == "cas" +def test_auto_key_data_sources_h5dpf(server_type): + data_sources = dpf.core.DataSources(result_path="test.h5", server=server_type) + assert data_sources.result_key == "h5dpf" + + def test_set_resultpath_data_sources_cfx_res(server_type): from ansys.dpf.core import examples From c6c4198051a99ebb770c413ad7d6a70649ae7967 Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Mon, 15 Dec 2025 11:50:03 +0100 Subject: [PATCH 3/4] Apply suggestions from code review --- tests/test_datasources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_datasources.py b/tests/test_datasources.py index a1135c81e6c..b74166a83ad 100644 --- a/tests/test_datasources.py +++ b/tests/test_datasources.py @@ -105,7 +105,7 @@ def test_set_resultpath_data_sources_cff(server_type): def test_auto_key_data_sources_h5dpf(server_type): data_sources = dpf.core.DataSources(result_path="test.h5", server=server_type) - assert data_sources.result_key == "h5dpf" + assert data_sources.result_key == "hdf5" def test_set_resultpath_data_sources_cfx_res(server_type): From e88e478b4874c153e4584919248897f37f9b0a3e Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:34:45 +0100 Subject: [PATCH 4/4] Key is h5dpf and not hdf5 --- src/ansys/dpf/core/data_sources.py | 2 +- tests/test_datasources.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ansys/dpf/core/data_sources.py b/src/ansys/dpf/core/data_sources.py index bc82a8451c8..9c37a5d723a 100644 --- a/src/ansys/dpf/core/data_sources.py +++ b/src/ansys/dpf/core/data_sources.py @@ -174,7 +174,7 @@ def set_result_file_path( if key == "" and extension in [".h5", ".cff"]: key = self.guess_second_key(str(filepath)) if key == "" and extension == ".h5": - key = "hdf5" + key = "h5dpf" if key == "": self._api.data_sources_set_result_file_path_utf8(self, str(filepath)) else: diff --git a/tests/test_datasources.py b/tests/test_datasources.py index b74166a83ad..a1135c81e6c 100644 --- a/tests/test_datasources.py +++ b/tests/test_datasources.py @@ -105,7 +105,7 @@ def test_set_resultpath_data_sources_cff(server_type): def test_auto_key_data_sources_h5dpf(server_type): data_sources = dpf.core.DataSources(result_path="test.h5", server=server_type) - assert data_sources.result_key == "hdf5" + assert data_sources.result_key == "h5dpf" def test_set_resultpath_data_sources_cfx_res(server_type):