Skip to content

Commit 74f87c4

Browse files
updates in the DataSources api reference
1 parent b29f6bb commit 74f87c4

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

src/ansys/dpf/core/data_sources.py

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -223,39 +223,7 @@ def guess_result_key(filepath: str) -> str:
223223

224224
@staticmethod
225225
def guess_second_key(filepath: str) -> str:
226-
"""For files with an h5 or cff second extension, look for the first extension.
227-
228-
Parameters
229-
----------
230-
filepath :
231-
Path to the file.
232-
233-
Returns
234-
-------
235-
str :
236-
First extension key name
237-
238-
Examples
239-
--------
240-
Find the first extension key of a result file with multiple extensions keys
241-
242-
>>> from ansys.dpf import core as dpf
243-
>>> from ansys.dpf.core import examples
244-
>>>
245-
>>> # Download the result files
246-
>>> paths = examples.download_fluent_axial_comp()
247-
>>> # Create the DataSources object
248-
>>> my_data_sources = dpf.DataSources()
249-
>>> # Define the extension key for the file in the given path
250-
>>> # We see that the paths are given in a dictionary.
251-
>>> # So to choose the correct file you need to give as an argument:
252-
>>> # - the list label
253-
>>> # - the file index in that list
254-
>>> my_file_key = my_data_sources.guess_second_key(filepath=paths["cas"][0])
255-
>>> print(my_file_key)
256-
cas
257-
258-
"""
226+
"""For files with an h5 or cff second extension, look for the first extension."""
259227
accepted = ["cas", "dat"]
260228
without_ext = os.path.splitext(filepath)[0]
261229
new_split = os.path.splitext(without_ext)

0 commit comments

Comments
 (0)