Example
The example module is designed to facilitate the downloading and setup of predefined examples for the Paramaterial library.
Function
download_example: A function to download a specified example, extract its content, and save it to a designated directory.
Currently Available Examples
- 'dan_msc_basic_usage_0.1.0'
- 'dan_msc_cs1_0.1.0'
- 'dan_msc_cs2_0.1.0'
- 'dan_msc_cs3_0.1.0'
- 'dan_msc_cs4_0.1.0'
Examples:
>>> # Download the 'dan_msc_basic_usage_0.1.0' example to the current directory
>>> from paramaterial import download_example
>>> download_example('dan_msc_basic_usage_0.1.0')
About the Example Repository
The examples are hosted in a GitHub repository and include datasets, notebooks, and other assets that showcase the functionality and capabilities of the Paramaterial library. These examples can be downloaded and run locally, providing an interactive way to explore and learn about the library.
The download_example function allows users to fetch any of the available examples by name. It takes care of
downloading and extracting the data, info, and notebook files to the specified directory.
download_example(example_name, to_directory='./')
Download and extract an example from the Paramaterial example repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
example_name |
str
|
The name of the example to download. Must be one of the predefined examples available in the Paramaterial example repository. Examples include:
|
required |
to_directory |
str
|
The directory to download and extract the example to. |
'./'
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the specified example_name is not recognized. |
Exception
|
If an error occurs during the download or extraction process. |
Examples:
>>> download_example('dan_msc_basic_usage_0.1.0')
Example dan_msc_basic_usage_0.1.0 downloaded to ./