77import os
88import warnings
99import traceback
10+ from typing import Union
1011
1112from ansys .dpf .core import server as server_module
1213from ansys .dpf .gate import (
@@ -135,18 +136,22 @@ def guess_result_key(filepath: str) -> str:
135136 return result_key
136137 return ""
137138
138- def set_domain_result_file_path (self , path , domain_id ):
139+ def set_domain_result_file_path (
140+ self , path : Union [str , os .PathLike ], domain_id : int , key : Union [str , None ] = None
141+ ):
139142 """Add a result file path by domain.
140143
141144 This method is used to handle files created by a
142145 distributed solve.
143146
144147 Parameters
145148 ----------
146- path: str or os.PathLike object
149+ path:
147150 Path to the file.
148- domain_id: int
151+ domain_id:
149152 Domain ID for the distributed files.
153+ key:
154+ Key to associate to the file.
150155
151156 Examples
152157 --------
@@ -156,7 +161,12 @@ def set_domain_result_file_path(self, path, domain_id):
156161 >>> data_sources.set_domain_result_file_path('/tmp/file1.sub', 1)
157162
158163 """
159- self ._api .data_sources_set_domain_result_file_path_utf8 (self , str (path ), domain_id )
164+ if key :
165+ self ._api .data_sources_set_domain_result_file_path_with_key_utf8 (
166+ self , str (path ), key , domain_id
167+ )
168+ else :
169+ self ._api .data_sources_set_domain_result_file_path_utf8 (self , str (path ), domain_id )
160170
161171 def add_file_path (self , filepath , key = "" , is_domain : bool = False , domain_id = 0 ):
162172 """Add a file path to the data sources.
0 commit comments