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_dir
str,optional Local directory where downloaded files will be saved.
Default is the current working directory (
os.getcwd()).- demo_dir_url
str,optional Base URL of the remote demo data repository of
Swectralpackage.Default is
'https://raw.githubusercontent.com/siwei66/swectral/master/demo/demo_data/'.- files
tupleofstr,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_limit
int,optional Maximum number of download retries per file in case of failure. Default is 5.
- data_dir
- Returns:
NoneThe files are downloaded to
data_dir. No value is returned.
- Return type:
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"))