aiida_castep.calculations.helper package#
Submodules#
aiida_castep.calculations.helper.generate module#
Module for generation HELP information using CASTEP excutable.
- aiida_castep.calculations.helper.generate.dot_proc(iterable)[source]#
Provide a primitive progress bar
- aiida_castep.calculations.helper.generate.get_castep_commands(castep_command='castep.serial', key='all')[source]#
Module contents#
CASTEP HELPER Check for errors in input dictionary
- class aiida_castep.calculations.helper.CastepHelper(version=None)[source]#
Bases:
object
A class for helping castep inputs
- __dict__ = mappingproxy({'__module__': 'aiida_castep.calculations.helper', '__doc__': '\n A class for helping castep inputs\n ', '__init__': <function CastepHelper.__init__>, 'load_helper_dict': <function CastepHelper.load_helper_dict>, 'help_dict': <property object>, 'castep_help_version': <property object>, 'save_helper_dict': <function CastepHelper.save_helper_dict>, '_check_dict': <function CastepHelper._check_dict>, '_from_flat_dict': <function CastepHelper._from_flat_dict>, 'check_dict': <function CastepHelper.check_dict>, 'get_suggestion': <function CastepHelper.get_suggestion>, '__dict__': <attribute '__dict__' of 'CastepHelper' objects>, '__weakref__': <attribute '__weakref__' of 'CastepHelper' objects>, '__annotations__': {}})#
- __module__ = 'aiida_castep.calculations.helper'#
- __weakref__#
list of weak references to the object (if defined)
- _check_dict(input_dict)[source]#
Check a dictionary of inputs. Return invalid and wrong keys
- Parameters:
input_dict (dict) – A dictonary with “PARAM” and “CELL” keys.
- Returns:
A list of [invalid_keys, wrong_keys].
wrong_keys is a tuple of where the key should have being. (key, “PARAM”) or (key, “CELL”)
- _from_flat_dict(input_dict)[source]#
Construct a {“PARAM”:{}, “CELL”:{}} dictionary from dictionary with top-level keys other than PARAM and CELL :returns: a list of [out_dict, keys_not_found]
- property castep_help_version#
Version number of CASTEP that the help info is for
- check_dict(input_dict, auto_fix=True, allow_flat=False)[source]#
Check input dictionary. Apply and warn about errors :param input_dict dictionary: a dictionary as the input, contain “CELL”, “PARAM” and other keywords :param auto_fix bool: Whether we should fix error automatically :param allow_flat: Accept that the input dictionary is flat.
- Returns dict:
A structured dictionary
- property help_dict#
A dictionary containing information of the helper
- exception aiida_castep.calculations.helper.HelperCheckError[source]#
Bases:
RuntimeError
- __module__ = 'aiida_castep.calculations.helper'#
- __weakref__#
list of weak references to the object (if defined)
- aiida_castep.calculations.helper._get_suggestion(provided_string, allowed_strings)[source]#
Given a string and a list of allowed_strings, it returns a string to print on screen, with sensible text depending on whether no suggestion is found, or one or more than one suggestions are found.
- Parameters:
provided_string – the string to compare
allowed_strings – a list of valid strings
- Returns:
A string to print on output, to suggest to the user
a possible valid value.
- aiida_castep.calculations.helper.check_incompatible(dict_in, inc_list)[source]#
Check any conflicting keys in the dictionary