aiida_castep.calculations package#
Subpackages#
- aiida_castep.calculations.helper package
- Submodules
- aiida_castep.calculations.helper.generate module
- Module contents
CastepHelper
CastepHelper.__dict__
CastepHelper.__init__()
CastepHelper.__module__
CastepHelper.__weakref__
CastepHelper._check_dict()
CastepHelper._from_flat_dict()
CastepHelper.castep_help_version
CastepHelper.check_dict()
CastepHelper.get_suggestion()
CastepHelper.help_dict
CastepHelper.load_helper_dict()
CastepHelper.save_helper_dict()
HelperCheckError
_get_suggestion()
check_incompatible()
find_help_info()
load_json()
Submodules#
aiida_castep.calculations.castep module#
Calculations of CASTEP
- class aiida_castep.calculations.castep.CastepCalculation(*args: Any, **kwargs: Any)[source]#
Bases:
CalcJob
,CastepInputGenerator
Class representing a generic CASTEP calculation - This class should work for all types of calculations.
- _DEFAULTS = {'input_filename': 'aiida.cell', 'output_filename': 'aiida.castep', 'parent_folder_name': 'parent', 'parser_name': 'castep.castep', 'seedname': 'aiida', 'symlink_usage': True, 'use_kpoints': True, 'withmpi': True}#
- __abstractmethods__ = frozenset({})#
- __module__ = 'aiida_castep.calculations.castep'#
- _abc_impl = <_abc_data object>#
- _acceptable_tasks = ['singlepoint', 'geometryoptimization', 'geometryoptimisation']#
- _cell_links = ['parameters', 'structure', 'settings', 'kpoints']#
- _copied_attributes = ['jobresource_param', 'custom_scheduler_commands', 'max_wallclock_seconds']#
- _default_retrieve_list = ['*.err', '*.den_fmt', '*.elf_fmt', '*-out.cell', '*.pdos_bin']#
- _extra_kpoints = {'bs': {'need_weigthts': False, 'task': ('bandstructure',)}, 'elnes': {'need_weights': True, 'task': ('elnes',)}, 'magres': {'need_weights': True, 'task': ('magres',)}, 'optics': {'need_weights': True, 'task': ('optics',)}, 'phonon': {'need_weights': False, 'task': ('phonon', 'phonon+efield')}, 'phonon_fine': {'need_weights': False, 'task': ('phonon', 'phonon+efield')}, 'spectral': {'need_weights': True, 'task': ('spectral',)}, 'supercell': {'need_weights': True, 'task': ('phonon',)}}#
- _generate_header_lines(other_nodes=None)[source]#
Generate header lines to go into param and cell files :param other_nodes: A list of pairs of (linkname, node)
- _param_links = ['parameters']#
- _write_headers = True#
- classmethod check_restart(builder, verbose=False)[source]#
Check the existence of restart file is needed
- classmethod define(spec)[source]#
Define the process specification, including its inputs, outputs and known exit codes.
Ports are added to the metadata input namespace (inherited from the base Process), and a code input Port, a remote_folder output Port and retrieved folder output Port are added.
- Parameters:
spec – the calculation job process spec to define.
- classmethod dryrun_test(inputs, castep_exe='castep.serial', verbose=True)[source]#
Do a dryrun test in a folder with prepared builder or inputs
- prepare_for_submission(folder)[source]#
Routine to be called when create the input files and other stuff
- Parameters:
folder – a aiida.common.folders.Folder subclass where the plugin should put all its files.
inputdict – a dictionary with the input nodes, as they would be returned by get_inputs_dict (without the Code!)
- retrieve_dict = {'geometryoptimisation': ['.geom'], 'geometryoptimization': ['.geom'], 'magres': ['.magres'], 'molecular dynamics': ['.md'], 'moleculardynamics': ['.md'], 'phonon': ['.phonon'], 'phonon+efield': ['.phonon', '.efield'], 'spectral': ['.ome_bin', '.dome_bin'], 'transitionstatesearch': ['.ts']}#
aiida_castep.calculations.datastructure module#
Classes for .param and .cell files
- class aiida_castep.calculations.datastructure.CastepInputFile(*args, **kwargs)[source]#
Bases:
OrderedDict
Class for storing key - values pairs of CASTEP inputs This class can be used for .param, .cell and also other CASTEP style inputs such as OptaDos’s odi file
self.get_file_lines
is used for getting a list of strings as lines to be written to the fileself.get_string
is used for getting the content to be passed towrite
function of a file-like objectsepecial properties: *
header
a list of lines to be put into the header *units
a dictionary of the units- __module__ = 'aiida_castep.calculations.datastructure'#
- class aiida_castep.calculations.datastructure.CellFile(*args, **kwargs)[source]#
Bases:
CastepInputFile
- __module__ = 'aiida_castep.calculations.datastructure'#
- class aiida_castep.calculations.datastructure.ParamFile(*args, **kwargs)[source]#
Bases:
CastepInputFile
- __module__ = 'aiida_castep.calculations.datastructure'#
aiida_castep.calculations.inpgen module#
Module for generating text based CASTEP inputs
- class aiida_castep.calculations.inpgen.CastepInputGenerator[source]#
Bases:
object
Class for generating CASTEP inputs
- __dict__ = mappingproxy({'__module__': 'aiida_castep.calculations.inpgen', '__doc__': '\n Class for generating CASTEP inputs\n ', '__init__': <function CastepInputGenerator.__init__>, 'prepare_inputs': <function CastepInputGenerator.prepare_inputs>, '_prepare_cell_file': <function CastepInputGenerator._prepare_cell_file>, '_include_extra_kpoints': <function CastepInputGenerator._include_extra_kpoints>, '_prepare_pseudo_potentials': <function CastepInputGenerator._prepare_pseudo_potentials>, '_prepare_param_file': <function CastepInputGenerator._prepare_param_file>, '__dict__': <attribute '__dict__' of 'CastepInputGenerator' objects>, '__weakref__': <attribute '__weakref__' of 'CastepInputGenerator' objects>, '__annotations__': {}})#
- __module__ = 'aiida_castep.calculations.inpgen'#
- __weakref__#
list of weak references to the object (if defined)
aiida_castep.calculations.tools module#
Tools for calculations
- class aiida_castep.calculations.tools.CastepCalcTools(node)[source]#
Bases:
CalculationTools
- __module__ = 'aiida_castep.calculations.tools'#
- compare_with(the_other_calc, reverse=False)[source]#
Compare with another calculation Look for difference in get_castep_input_summary functions :params node: pk or uuid or node :params reverse: reverse the comparison, by default this node is the “new” and the one compared with is “old”.
- aiida_castep.calculations.tools.castep_input_summary(calc)[source]#
Convenient fuction for getting a summary of the input of this calculation
- Parameters:
calc – A CalcJobNode or ProcessBuilder or a nested input dictionary
- Returns:
A dictionary
- aiida_castep.calculations.tools.create_restart(inputs, entry_point='castep.castep', calcjob=None, param_update=None, param_delete=None, restart_mode='restart', use_castep_bin=False, parent_folder=None, reuse=False)[source]#
Function to create a restart for a calculation. :param inputs: A builder or nested dictionary :param entry_point: Name of the entry points :param param_update: Update the parameters :param param_delete: A list of parameters to be deleted :param restart_mode: Mode of the restart, ‘continuation’ or ‘restart’ :param use_castep_bin: Use hte ‘castep_bin’ file instead of check :param parent_folder: Remote folder to be used for restart :param reuse: Use the reuse mode
- aiida_castep.calculations.tools.update_parameters(inputs, force=False, delete=None, **kwargs)[source]#
Convenient function to update the parameters of the calculation. Will atomiatically set the PARAM or CELL field in unstored ParaemterData linked to the calculation. If no
Dict
is linked to the calculation, a new node will be created.- ..note:
This method relies on the help information to check and assign keywords to PARAM or CELL field of the Dict (i.e for generating .param and .cell file)
calc.update_parameters(task=”singlepoint”)
- Parameters:
force – flag to force the update even if the Dict node is stored.
delete – A list of the keywords to be deleted.
- aiida_castep.calculations.tools.use_pseudos_from_family(builder, family_name)[source]#
Set the pseudos port namespace for a builder using pseudo family name :note: The structure must already be set in the builder.
- Parameters:
builder – ProcessBuilder instance to be processed, it must have a structure
family_name – the name of the group containing the pseudos
- Returns:
The same builder with the pseudopotential set
aiida_castep.calculations.utils module#
Utility module
- aiida_castep.calculations.utils._lowercase_dict(in_dict, dict_name)[source]#
Make sure the dictionary’s keys are in lower case :param dict_name: A string of the name for the dictionary. Only used in warning message.
- aiida_castep.calculations.utils._uppercase_dict(in_dict, dict_name)[source]#
Make sure the dictionary’s keys are in upper case :param dict_name: A string of the name for the dictionary. Only used in warning message.
- aiida_castep.calculations.utils.get_castep_ion_line(name, pos, label=None, spin=None, occupation=None, mix_num=None)[source]#
Generate a line in POSITIONS_ABS or POSITIONS_FRAC block
- Parameters:
name – A sting or tuple of the names
pos – Position, a sequence of 3
label – A string or tuple of the labels
spin – Spins. (spin), (spin1, spin2), (x, y, z) or ((x1,y1,z1), (x2, y2, z2))
occupation – tuple of two of the occupation number
mix_num – mixture number, can be any integer but should not be repeated in a single cell file
- Return line:
a string of the line to be added to the cell file
Module contents#
Sub-package for calculation plugins