hup.base.stype module

Structural / Symbolic Types.

class Domain

Bases: tuple

Class for Domain Parameters.

basis

Alias for field number 2

frame

Alias for field number 1

type

Alias for field number 0

class Field

Bases: tuple

Class for Field Parameters.

id

Alias for field number 0

type

Alias for field number 1

class Variable

Bases: tuple

Class for the storage of variable definitions.

frame

Alias for field number 2

name

Alias for field number 0

operator

Alias for field number 1

create_basis(arg: Any) → Tuple[Tuple[Hashable, ...], Dict[Hashable, hup.base.stype.Field]]

Create domain frame and basis from given field definitions.

Args:

Returns:

create_domain(domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None, defaults: Optional[Mapping[str, Any]] = None) → hup.base.stype.Domain

Create Domain object from domain definition.

Parameters:
  • domain – Optional domain like parameter, that specifies the type and (if required) the frame of a domain.
  • defaults – Optional mapping which is used to complete the given domain definition. The key ‘type’ specifies the default domain type and is required to be given as a type. The key ‘fields’ specifies a default ordered basis for the domain and is required to be given as a single or a tuple of field definitions.
Returns:

Instance of the class Domain

create_field

Create a Field object.

Parameters:fieldField definition
Returns:Instance of class Field
create_variable(var: Union[str, Tuple[str], Tuple[str, Hashable], Tuple[str, Tuple[Hashable, ...]], Tuple[str, Callable[[...], Any]], Tuple[str, Callable[[...], Any], Hashable], Tuple[str, Callable[[...], Any], Tuple[Hashable, ...]], Tuple[str, str, Hashable], Tuple[str, str, Tuple[Hashable, ...]]], default: Optional[Callable[[...], Any]] = None) → hup.base.stype.Variable

Create variable from variable definition.

Parameters:
  • var – Variable defintion
  • default

Returns: