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:
templatestr, optional

Name of the template.

If None, all templates are shown.

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:
templatestr

Name of the template.

**kwargs

Parameters passed to the template.

Returns:
gtypestr

Type of the generated input data.

datadict

Input data that can be passed to write_hdf5 method of a corresponding type.

Raises:
ValueError

When given template was not found.