templates
Package for generating inputs from templates and imported data.
- class a5py.templates.Template(ascot)
Class for creating input data from templates or imported data.
The templates are constructed by calling
construct()
and specifying the template. The templates are constructed in other (public) methods of this class. The name of the template is the name of the method, and details of the template can be found from the method description.- showtemplate(template=None)
Show information about a template or a list of all templates.
- Parameters:
- template
str
,optional
Name of the template.
If None, all templates are shown.
- template
- usetemplate(template, **kwargs)
Create input from a template or import data.
This method is just a wrapper for calling other methods that generate the inputs. The name of the template should be the name of the corresponding method (whitespace instead of underscores and capital letters are allowed).
- Parameters:
- template
str
Name of the template.
- **kwargs
Parameters passed to the template.
- template
- Returns:
- Raises:
ValueError
When given template was not found.