generator
This module contains a list of examples that can be used when learning to use Merlin, or for setting up new workflows.
Examples are packaged in directories, with the directory name denoting the example name. This must match the name of the Merlin specification inside.
gather_all_examples()
Get all the example YAML files.
Returns:
| Type | Description |
|---|---|
List[str]
|
A list of file paths to all YAML files in the example directories. |
Source code in merlin/examples/generator.py
gather_example_dirs()
Get all the example directories.
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
A dictionary where the keys and values are the names of example directories. |
Source code in merlin/examples/generator.py
list_examples()
List all available examples with their descriptions.
Returns:
| Type | Description |
|---|---|
str
|
A formatted string table of example names and their descriptions. |
Source code in merlin/examples/generator.py
setup_example(name, outdir)
Set up the given example by copying it to the specified output directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the example to set up. |
required |
outdir
|
str
|
The output directory where the example will be copied. |
required |
Returns:
| Type | Description |
|---|---|
Union[str, None]
|
The name of the example if successful, or None if the example was not found or an error occurred. |
Source code in merlin/examples/generator.py
write_example(src_path, dst_path)
Write out the example workflow to a file or directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src_path
|
str
|
The path to copy the example from. |
required |
dst_path
|
str
|
The destination path to copy the example to. |
required |