File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,37 @@ def set_result_file_path(
180180
181181 @staticmethod
182182 def guess_result_key (filepath : str ) -> str :
183- """Guess result key for files without a file extension."""
183+ """Guess result key for files without a file extension.
184+
185+ Parameters
186+ ----------
187+ filepath
188+ Path to the file.
189+
190+ Returns
191+ -------
192+ str
193+ Extension key name
194+
195+ Examples
196+ --------
197+ Gives the result key for the result file of the given path
198+
199+ >>> from ansys.dpf import core as dpf
200+ >>> from ansys.dpf.core import examples
201+ >>>
202+ >>> # Create the DataSources object
203+ >>> my_data_sources = dpf.DataSources()
204+ >>> # Download the result files
205+ >>> path = examples.download_d3plot_beam()
206+ >>> # Define the path where the main result file can be found
207+ >>> my_data_sources.set_result_file_path(filepath=path[0])
208+ >>> # Define the extension key for the file in the given path
209+ >>> my_file_key = my_data_sources.guess_result_key(filepath=path[0])
210+ >>> print(my_file_key)
211+ d3plot
212+
213+ """
184214 result_keys = ["d3plot" , "binout" ]
185215 base_name = os .path .basename (filepath )
186216 # Handle files without extension
You can’t perform that action at this time.
0 commit comments