load_data#

Session.load_data(data_file: str, result_file: str | None = None, file_format: str | None = None, reader_options: dict | None = None, new_case: bool = False, representation: str = '3D_feature_2D_full', monitor_new_timesteps: str = 'off') None#

Load a dataset into the EnSight instance.

Load the data from a given file into EnSight. The new data replaces any currently loaded data in the session.

Parameters:
data_filestr

Name of the data file to load.

result_filestr, optional

Name of the second data file for dual-file datasets.

file_formatstr, optional

Name of the EnSight reader to use. The default is None, in which case EnSight selects a reader.

reader_optionsdict, optional

Dictionary of reader-specific option-value pairs that can be used to customize the reader behavior. The default is None.

new_casebool, optional

Whether to load the dataset in another case. The default is False, in which case the dataset replaces the one (if any) loaded in the existing current case.

representationstr, optional

Default representation for the parts loaded. The default is "3D_feature_2D_full".

monitor_new_timesteps: str, optional

Defaulted to off, if changed EnSight will monitor for new timesteps. The allowed values are MONITOR_NEW_TIMESTEPS_OFF, MONITOR_NEW_TIMESTEPS_STAY_AT_CURRENT and MONITOR_NEW_TIMESTEPS_JUMP_TO_END

Raises:
RuntimeError

If EnSight cannot guess the file format or an error occurs while the data is being read.

Examples

>>> from ansys.pyensight.core import LocalLauncher
>>> session = LocalLauncher().start()
>>> session.load_data(r'D:\data\CFX\example_data.res')