The pyedb.misc.downloads library#

Summary#

delete_downloads

Delete all downloaded examples to free space or update the files.

download_aedb

Download an example of AEDB File and return the def path.

download_edb_merge_utility

Download an example of WPF Project which allows to merge 2aedb files.

download_via_wizard

Download an example of Hfss Via Wizard and return the def path.

download_touchstone

Download an example of touchstone File and return the def path.

download_file

Download file from directory.

unzip

Description#

Download example datasets from pyansys/example-data

Module detail#

downloads.delete_downloads()#

Delete all downloaded examples to free space or update the files.

downloads.download_aedb(destination=None)#

Download an example of AEDB File and return the def path.

Examples files are downloaded to a persistent cache to avoid re-downloading the same file twice.

Parameters:
destinationstr, optional

Path for downloading files. The default is the user’s temp folder.

Returns:
str

Path to the example file.

Examples

Download an example result file and return the path of the file. >>> import pyedb.misc.downloads >>> path = pyedb.misc.downloads.download_aedb() >>> path ‘C:/Users/user/AppData/local/temp/Galileo.aedb’

downloads.download_edb_merge_utility(force_download=False, destination=None)#

Download an example of WPF Project which allows to merge 2aedb files.

Examples files are downloaded to a persistent cache to avoid re-downloading the same file twice.

Parameters:
force_downloadbool

Force to delete cache and download files again.

destinationstr, optional

Path for downloading files. The default is the user’s temp folder.

Returns:
str

Path to the example file.

Examples

Download an example result file and return the path of the file. >>> import pyedb.misc.downloads >>> path = pyedb.misc.downloads.download_edb_merge_utility(force_download=True) >>> path ‘C:/Users/user/AppData/local/temp/wpf_edb_merge/merge_wizard.py’

downloads.download_via_wizard(destination=None)#

Download an example of Hfss Via Wizard and return the def path.

Examples files are downloaded to a persistent cache to avoid re-downloading the same file twice.

Parameters:
destinationstr, optional

Path for downloading files. The default is the user’s temp folder.

Returns:
str

Path to the example file.

Examples

Download an example result file and return the path of the file.

>>> import pyedb.misc.downloads
>>> path = pyedb.misc.downloads.download_via_wizard()
>>> path
'C:/Users/user/AppData/local/temp/pyaedtexamples/Graphic_Card.aedt'
downloads.download_touchstone(destination=None)#

Download an example of touchstone File and return the def path.

Examples files are downloaded to a persistent cache to avoid re-downloading the same file twice.

Parameters:
destinationstr, optional

Path for downloading files. The default is the user’s temp folder.

Returns:
str

Path to the example file.

Examples

Download an example result file and return the path of the file. >>> import pyedb.misc.downloads >>> path = pyedb.misc.downloads.download_touchstone() >>> path ‘C:/Users/user/AppData/local/temp/pyaedtexamples/ssn_ssn.s6p’

downloads.download_file(directory, filename=None, destination=None)#

Download file from directory.

Files are downloaded to a destination. If filename is not specified, the full directory will be downloaded.

Parameters:
directorystr

Directory name.

filenamestr, optional

File name to download. The default is all files inside directory.

destinationstr, optional

Path where files will be downloaded. Default is user temp folder.

Returns:
str

Path to the example file.

Examples

Download an example result file and return the path of the file.

>>> import pyedb.misc.downloads
>>> path = pyedb.misc.downloads.download_file("motorcad", "IPM_Vweb_Hairpin.mot")
>>> path
'C:/Users/user/AppData/local/temp/PyAEDTExamples/motorcad'
downloads.unzip(source_filename, dest_dir)#
downloads.EXAMPLE_REPO = 'https://github.com/ansys/example-data/raw/main/'#
downloads.EXAMPLES_PATH#
downloads.tmpfold#