copy_to_session#

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

Copy a collection of files into the EnSight session.

Copy files from the local filesystem into the filesystem that is hosting the EnSight instance.

Note

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

Parameters:
local_prefixstr

URL prefix to use for all files specified for the filelist parameter. The only protocol supported is 'file://', which is the local filesystem.

filelistlist

List of files to copy. These files are prefixed with local_prefix and written relative to the remote_prefix parameter appended to session.launcher.session_directory.

remote_prefixstr

Directory on the remote (EnSight) filesystem, which is the destination 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 filenames that were copied and their sizes.

Examples

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