IntBool

class ase2sprkkr.sprkkr.test.grammar_types.basic.IntBool(prefix=None, postfix=None, format='', after_format=None, default_value=None, condition=None, after_convert=None, description='', reversed=False)[source]

A bool type, whose value is represented by a letter (1 or 0)

Class hierarchy

Inheritance diagram of ase2sprkkr.sprkkr.test.grammar_types.basic.IntBool

Constructor

Parameters:
  • prefix (str | None)

  • postfix (str | None)

  • format (str)

  • after_format (str | None)

  • default_value (Any)

  • condition (Callable[[Any], bool | str] | None)

  • after_convert (Callable[[Any], Any] | None)

__init__(prefix=None, postfix=None, format='', after_format=None, default_value=None, condition=None, after_convert=None, description='', reversed=False)[source]
Parameters:
  • reversed – “reversed integer-boolean” returns 1 if it is False

  • prefix (str | None)

  • postfix (str | None)

  • format (str)

  • after_format (str | None)

  • default_value (Any)

  • condition (Callable[[Any], bool | str] | None)

  • after_convert (Callable[[Any], Any] | None)

_grammar = {'1' | '0'}
Parameters:

name (str | None)

Return type:

ParserElement

_rev_grammar = {'1' | '0'}
Parameters:

name (str | None)

Return type:

ParserElement

grammar_name()[source]

Human readable expression of the grammar. By default, this is what is set by grammar.setName, however, sometimes is desirable to set even shorter string

_string(val)[source]

Convert the value to the ouput.

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

I = <IntBool>