swectral.download_demo_data#

swectral.download_demo_data(data_dir='/home/runner/work/swectral/swectral/docs', demo_dir_url='https://raw.githubusercontent.com/siwei66/swectral/master/demo/demo_data/', files=('demo_1.xml', 'demo_2.xml', 'demo_3.xml', 'demo_4.xml', 'demo_5.xml', 'demo.tiff'), retry_limit=5)[source]#

Download real-world demo data files for demonstration or user testing purposes.

Parameters:
data_dirstr, optional

Local directory where downloaded files will be saved.

Default is the current working directory (os.getcwd()).

demo_dir_urlstr, optional

Base URL of the remote demo data repository of Swectral package.

Default is 'https://raw.githubusercontent.com/siwei66/swectral/master/demo/demo_data/'.

filestuple of str, optional

Names of files to download from the repository.

Default includes ('demo_1.xml', 'demo_2.xml', 'demo_3.xml', 'demo_4.xml', 'demo_5.xml', 'demo.tiff'). The files must exist in the remote repository.

retry_limitint, optional

Maximum number of download retries per file in case of failure. Default is 5.

Returns:
None

The files are downloaded to data_dir. No value is returned.

Return type:

None

Examples

Download default demo files to the current directory:

>>> download_demo_data()

Download demo files to a custom directory:

>>> download_demo_data(data_dir="my_demo_data")

Download only a subset of files:

>>> download_demo_data(files=("demo_1.xml", "demo.tiff"))