ansys.dyna.core.pre.examples.download_utilities#

Classes#

DownloadManager

Manages downloads of example files.

Module Contents#

class ansys.dyna.core.pre.examples.download_utilities.DownloadManager[source]#

Manages downloads of example files.

Local paths are saved in this class so that a global cleanup of example files can be performed when the client is closed.

downloads_list = [][source]#
add_file(file_path: str)[source]#

Add the path for a downloaded example file to a list.

This list keeps track of where example files are downloaded so that a global cleanup of these files can be performed when the client is closed.

Parameters:
file_pathstr

Local path of the downloaded example file.

clear_download_cache()[source]#

Remove downloaded example files from the local path.

download_file(filename: str, *directory: str, destination: str | None = None, force: bool = False) str[source]#

Download an example file from the PyPrimeMesh repository.

Parameters:
filenamestr

Name of the example file to download.

destinationstr, optional

Path to download the example file to. The default is None, in which case the default path for app data is used.

forcebool, optional

Whether to always download the example file. The default is False, in which case if the example file is cached, it is reused.

directorytuple[str]

Path under the PyAnsys Github examples repository.

Returns:
tuple[str, str]

Tuple containing the filepath to use and the local filepath of the downloaded directory. The two are different in case of containers.