TimeloopFE
|
Represents a type specifier for a node in the TimeloopFE library. More...
Public Member Functions | |
__init__ (self, str name, Type required_type, Any default=default_unspecified_, Union[Callable, None] callfunc=None, Type should_have_been_removed_by=None, bool part_name_match=False, bool no_change_key=False) | |
removed_by_str (self) | |
Any | cast_check_type (self, Any value, "Node" node, str key) |
Any | cast (self, Any value, bool __node_skip_parse=False) |
check_type (self, Any value, "Node" node, str key) | |
Public Attributes | |
str | name = name |
Type | required_type = required_type |
Any | default = default |
Callable | callfunc = callfunc |
Type | callfunc = required_type |
Type | should_have_been_removed_by = should_have_been_removed_by |
Any | set_from = self.should_have_been_removed_by |
bool | part_name_match = part_name_match |
bool | no_change_key = no_change_key |
Represents a type specifier for a node in the TimeloopFE library.
Attributes: name (str): The name of the type specifier. required_type (Type): The required type for the node. default (Any): The default value for the type specifier. callfunc (Union[Callable, None]): The function to call for casting the value. should_have_been_removed_by (Type): The type that should have removed or transformed the node. part_name_match (bool): Flag indicating if the name should be partially matched. no_change_key (bool): Flag indicating if the key should not be changed.
Methods: removed_by_str(self): Get the string representation of the type that should have removed or transformed the node. cast_check_type(self, value: Any, node: "Node", key: str) -> Any: Check and cast the value to the required type. cast(self, value: Any, __node_skip_parse: bool = False) -> Any: Cast the value to the required type. check_type(self, value: Any, node: "Node", key: str): Check if the value matches the required type.
timeloopfe.common.nodes.TypeSpecifier.__init__ | ( | self, | |
str | name, | ||
Type | required_type, | ||
Any | default = default_unspecified_, | ||
Union[Callable, None] | callfunc = None, | ||
Type | should_have_been_removed_by = None, | ||
bool | part_name_match = False, | ||
bool | no_change_key = False ) |
Any timeloopfe.common.nodes.TypeSpecifier.cast | ( | self, | |
Any | value, | ||
bool | __node_skip_parse = False ) |
Any timeloopfe.common.nodes.TypeSpecifier.cast_check_type | ( | self, | |
Any | value, | ||
"Node" | node, | ||
str | key ) |
timeloopfe.common.nodes.TypeSpecifier.check_type | ( | self, | |
Any | value, | ||
"Node" | node, | ||
str | key ) |
timeloopfe.common.nodes.TypeSpecifier.removed_by_str | ( | self | ) |
Callable timeloopfe.common.nodes.TypeSpecifier.callfunc = callfunc |
Type timeloopfe.common.nodes.TypeSpecifier.callfunc = required_type |
Any timeloopfe.common.nodes.TypeSpecifier.default = default |
str timeloopfe.common.nodes.TypeSpecifier.name = name |
bool timeloopfe.common.nodes.TypeSpecifier.no_change_key = no_change_key |
bool timeloopfe.common.nodes.TypeSpecifier.part_name_match = part_name_match |
Type timeloopfe.common.nodes.TypeSpecifier.required_type = required_type |
Any timeloopfe.common.nodes.TypeSpecifier.set_from = self.should_have_been_removed_by |
Type timeloopfe.common.nodes.TypeSpecifier.should_have_been_removed_by = should_have_been_removed_by |