Complex

class ase2sprkkr.common.grammar_types.Complex(type, default_value=None, length=None, max_length=None, min_length=None, as_list=False, format=None, **kwargs)[source]

Class hierarchy

Inheritance diagram of ase2sprkkr.common.grammar_types.Complex

Constructor

__init__(type, default_value=None, length=None, max_length=None, min_length=None, as_list=False, format=None, **kwargs)[source]
Parameters
  • type – The grammar type of the values in the list (it can be given by a python type)

  • default_value – The default value for the list

  • length – If it is set, the list have to have just this length (it sets min_ and max_length to the length)

  • min_length – The minimal allowed length of the list.

  • max_length – The maximal allowed length of the list.

  • as_list – Type of the value array. True means List, False means np.ndarray, or custom type (e.g. tuple) can be provided. However, the value can be set using tuple or list anyway.

convert(value)[source]

Convert a value from user to the “cannonical form”

_validate(value, why='set')[source]

Return error message if the value is not valid.

_grammar_name()[source]
_string(val)[source]

The string method do some additional transformation (add prefix, postfix etc.), so the actual way how to convert the value for the output should be here.

I = <Complex>