collections#
Domains for common python collections such as lists and dictionaries.
Classes#
Domain of lists of elements of a particular domain. |
|
Domain of dictionaries. |
- class ListDomain#
Bases:
tmlt.core.domains.base.Domain
Domain of lists of elements of a particular domain.
- element_domain :tmlt.core.domains.base.Domain#
Domain of list elements.
- length :Optional[int]#
Number of elements in lists in the domain. If None, this is unrestricted.
- validate(self, value)#
Raises error if value is not a row with matching schema.
- Parameters
value (Any) –
- class DictDomain#
Bases:
tmlt.core.domains.base.Domain
Domain of dictionaries.
- key_to_domain :Dict[Any, tmlt.core.domains.base.Domain]#
Mapping from key to domain.
- __getitem__(self, key)#
Returns domain associated with given key.
- Parameters
key (Any) –
- Return type
- validate(self, value)#
Raises error if value is not in the domain.
- Parameters
value (Any) –