aiida_spirit package

Subpackages

Submodules

aiida_spirit.calculations module

Calculations provided by aiida_spirit.

Register calculations via the “aiida.calculations” entry point in setup.json.

class aiida_spirit.calculations.SpiritCalculation(*args: Any, **kwargs: Any)[source]

Bases: CalcJob

Run Spirit calculation from user defined inputs.

_DEFAULT_INPUT_FILE = 'input_created.cfg'
_DEFAULT_OUTPUT_FILE = 'spirit.stdout'
__abstractmethods__ = frozenset({})
__module__ = 'aiida_spirit.calculations'
_abc_impl = <_abc_data object>
classmethod define(spec)[source]

Define inputs and outputs of the calculation.

get_defects_info()[source]

Get the defects info that is added to the config file

prepare_for_submission(folder)[source]

Create input files.

Parameters:

folder – an aiida.common.folders.Folder where the plugin should temporarily place all files needed by the calculation.

Returns:

aiida.common.datastructures.CalcInfo instance

write_couplings_file(folder)[source]

Write the couplings.txt file that contains the Jij’s

write_defects_file(folder)[source]

Create the defects.txt file from the defects input array

We write the defects.txt in this format:

### Atom types: type index 0..n or or vacancy (type < 0) ### Specify the number of defects and then the defects in terms of translations and type ### i da db dc itype n_defects 3 # this is skipped and all defects that are found in the file are used 0 0 0 0 -1 0 1 0 0 -1 0 0 1 0 -1

write_initial_configuration(folder)[source]

Write the ‘initial_state.txt’ file that contains the direction for each spin

write_input_cfg(folder)[source]

Write the input.cfg file from the parameters input

write_mc_script(folder)[source]

Write the MC script version of run_spirit.py

write_pinning_file(folder)[source]

Create the pinning.txt file from the pinning input array

We write the pinning.txt in this format (i, da, db, dc, Sx, Sy, Sz):

0 0 0 0 1.0 0.0 0.0 0 1 0 0 0.0 1.0 0.0 0 0 1 0 0.0 0.0 1.0

write_run_spirit(folder)[source]

write the run_spirit.py script that controls the spirit python API.

aiida_spirit.calculations._get_geometry(structure)[source]

Get the geometry string from the structure

aiida_spirit.calculations._modify_line(my_string, new_value)[source]

Gets a line and the new parameter value as inputs and returns the line with the new parameter

aiida_spirit.calculations.validate_params(params, _)[source]

Validate the input parameters.

aiida_spirit.cli module

Command line interface (cli) for aiida_spirit.

Register new commands either via the “console_scripts” entry point or plug them directly into the ‘verdi’ command by using AiiDA-specific entry points like “aiida.cmdline.data” (both in the setup.json file).

aiida_spirit.parsers module

Parsers provided by aiida_spirit.

Register parsers via the “aiida.parsers” entry point in setup.json.

class aiida_spirit.parsers.SpiritParser(node)[source]

Bases: Parser

Parser class for parsing output of calculation.

__abstractmethods__ = frozenset({})
__init__(node)[source]

Initialize Parser instance

Checks that the ProcessNode being passed was produced by a SpiritCalculation.

Parameters:
__module__ = 'aiida_spirit.parsers'
_abc_impl = <_abc_data object>
_file_not_found(filename)[source]
_parse_if_found(filename, *args, folder=None, **kwargs)[source]

Parses a file and loads it with np.loadtxt. The *args and **kwargs are passed to np.loadtxt. If the file is not found it returns None.

parse(**kwargs)[source]

Parse outputs, store results in database.

Returns:

an exit code, if parsing fails (or nothing if parsing succeeds)

parse_retrieved()[source]

Parse the output from the retrieved and create aiida nodes

parse_temporary_retrieved(_retrieved_dict, retrieved_temporary_folder)[source]

Parse files that are defined in the retrieve_temporary_list

aiida_spirit.parsers.parse_outfile(txt)[source]

parse the spirit output file

Module contents

aiida_spirit

AiiDA plugin for the spirit code