aiida.calculations package

Submodules

Generic CalcJob implementation where input file is a parametrized template file.

class aiida.calculations.templatereplacer.TemplatereplacerCalculation(*args, **kwargs)[source]

Bases: aiida.engine.processes.calcjobs.calcjob.CalcJob

Simple stub of a plugin that can be used to replace some text in a given template. Can be used for many different codes, or as a starting point to develop a new plugin.

This simple plugin takes two node inputs, both of type Dict, with the labels ‘parameters’ and ‘template’

You can also add other SinglefileData nodes as input, that will be copied according to what is written in ‘template’ (see below).

  • parameters: a set of parameters that will be used for substitution.

  • template: can contain the following parameters:

    • input_file_template: a string with substitutions to be managed with the format() function of python, i.e. if you want to substitute a variable called ‘varname’, you write {varname} in the text. See http://www.python.org/dev/peps/pep-3101/ for more details. The replaced file will be the input file.

    • input_file_name: a string with the file name for the input. If it is not provided, no file will be created.

    • output_file_name: a string with the file name for the output. If it is not provided, no redirection will be done and the output will go in the scheduler output file.

    • cmdline_params: a list of strings, to be passed as command line parameters. Each one is substituted with the same rule of input_file_template. Optional

    • input_through_stdin: if True, the input file name is passed via stdin. Default is False if missing.

    • files_to_copy: if defined, a list of tuple pairs, with format (‘link_name’, ‘dest_rel_path’);

      for each tuple, an input link to this calculation is looked for, with link labeled ‘link_label’, and with file type ‘Singlefile’, and the content is copied to a remote file named ‘dest_rel_path’ Errors are raised in the input links are non-existent, or of the wrong type, or if there are unused input files.

    • retrieve_temporary_files: a list of relative filepaths, that if defined, will be retrieved and

      temporarily stored in an unstored FolderData node that will be available during the Parser.parser_with_retrieved call under the key specified by the Parser.retrieved_temporary_folder key

__abstractmethods__ = frozenset({})
__module__ = 'aiida.calculations.templatereplacer'
_abc_impl = <_abc_data object>
classmethod define(spec)[source]

Define the process specification, including its inputs, outputs and known exit codes.

Parameters

spec – the calculation job process spec to define.

prepare_for_submission(folder)[source]

This is the routine to be called when you want to create the input files and related stuff with a plugin.

Parameters

folder – a aiida.common.folders.Folder subclass where the plugin should put all its files.