ObjectNumber

class ase2sprkkr.common.grammar_types.ObjectNumber(prefix=None, postfix=None, format='', default_value=None, condition=None, after_convert=None, description='', min=None, max=None)[source]

An abstract class, that describe an unsigned integer, that reffers to an object. User can give the object either using the object, or by the number. Descendant classes should take care of transforming the object to the resulting integer (by setting the result property of the described Option)

The type of te object should be given by the type class property.

Class hierarchy

Inheritance diagram of ase2sprkkr.common.grammar_types.ObjectNumber

Constructor

Parameters
  • prefix (Optional[str]) –

  • postfix (Optional[str]) –

  • format (str) –

  • default_value (Any) –

  • condition (Optional[Callable[[Any], Union[bool, str]]]) –

  • after_convert (Optional[Callable[[Any], Any]]) –

  • min (Optional[int]) –

  • max (Optional[int]) –

__init__(prefix=None, postfix=None, format='', default_value=None, condition=None, after_convert=None, description='', min=None, max=None)
Parameters
  • min (Optional[int]) – Minimal allowed value.

  • max (Optional[int]) – Maximal allowed value.

  • prefix (Optional[str]) –

  • postfix (Optional[str]) –

  • format (str) –

  • default_value (Any) –

  • condition (Optional[Callable[[Any], Union[bool, str]]]) –

  • after_convert (Optional[Callable[[Any], Any]]) –

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.