Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ansys/dpf/core/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "h5dpf"
if key == "":
self._api.data_sources_set_result_file_path_utf8(self, str(filepath))
else:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down