Skip to content

Commit 5b5f306

Browse files
changes in the set_domain_result_file_path function
1 parent ff7c0ba commit 5b5f306

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/ansys/dpf/core/data_sources.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,27 +266,32 @@ def guess_second_key(filepath: str) -> str:
266266

267267
def set_domain_result_file_path(
268268
self, path: Union[str, os.PathLike], domain_id: int, key: Union[str, None] = None
269-
):
270-
"""Add a result file path by domain.
269+
) -> None:
270+
"""Set a result file path by domain.
271271
272272
This method is used to handle files created by a
273273
distributed solve.
274274
275275
Parameters
276276
----------
277-
path:
277+
path
278278
Path to the file.
279-
domain_id:
279+
domain_id
280280
Domain ID for the distributed files.
281-
key:
281+
key
282282
Key to associate to the file.
283283
284284
Examples
285285
--------
286+
Set the main result file path to the data sources in their respective domains.
287+
286288
>>> from ansys.dpf import core as dpf
287-
>>> data_sources = dpf.DataSources()
288-
>>> data_sources.set_domain_result_file_path('/tmp/file0.sub', 0)
289-
>>> data_sources.set_domain_result_file_path('/tmp/file1.sub', 1)
289+
>>>
290+
>>> # Create the DataSources object
291+
>>> my_data_sources = dpf.DataSources()
292+
>>> # Define the path where the main result data can be found and specify its domain
293+
>>> my_data_sources.set_domain_result_file_path(path='/tmp/file0.rst', key='rst', domain_id=0)
294+
>>> my_data_sources.set_domain_result_file_path(path='/tmp/file1.rst', key='rst', domain_id=1)
290295
291296
"""
292297
if key:

0 commit comments

Comments
 (0)