copy_from_session#

Session.copy_from_session(local_prefix: str, filelist: List[str], remote_prefix: str | None = None, progress: bool = False) list#

Copy a collection of files out of the EnSight session.

Copy files from the filesystem of the remote EnSight instance to the filesystem of the local PyEnsight instance.

Note

For a LocalLauncheransys.pyensight.core.LocalLauncher> instance, these are the same filesystems.

Parameters:
local_prefixstr

URL prefix of the location to save the files to. The only protocol currently supported is 'file://', which is the local filesystem.

filelistlist
List of the files to copy. These files are prefixed

with session.launcher.session_directory/remote_prefix and written relative to URL prefix specified for the local_prefix parameter.

remote_prefixstr, optional

Directory on the remote (EnSight) filesystem that is the source for the files. This prefix is appended to session.launcher.session_directory.

progressbool, optional

Whether to show a progress bar. The default is False. If True and the tqdm module is available, a progress bar is shown.

Returns:
list

List of the files that were copied.

Examples

>>> the_files = ["fluent_data_dir", "ensight_script.py"]
>>> session.copy_from_session("file:///D:/restored_data", the_files, progress=True)
>>> the_files = ["fluent_data_dir", "ensight_script.py"]
>>> session.copy_from_session("file:///scratch/restored_data", the_files,
        remote_prefix="data")